<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GL.IB.LY &#187; tidbits</title>
	<atom:link href="http://gl.ib.ly/tag/tidbits/feed/" rel="self" type="application/rss+xml" />
	<link>http://gl.ib.ly</link>
	<description>Thoughts on security, computing, business and stuff!</description>
	<lastBuildDate>Sun, 18 May 2014 11:51:56 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Installing SNMPD (with remote access) on Debian 5/Lenny</title>
		<link>http://gl.ib.ly/stuff/2010/03/10/installing-snmpd-remote-access-debian-5lenny/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-snmpd-remote-access-debian-5lenny</link>
		<comments>http://gl.ib.ly/stuff/2010/03/10/installing-snmpd-remote-access-debian-5lenny/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 07:18:10 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[snmpd]]></category>
		<category><![CDATA[snmpwalk]]></category>
		<category><![CDATA[tidbits]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=91</guid>
		<description><![CDATA[<p>Today we&#8217;re installing snmpd so that we can query our debian server from another remote server that will use snmp in alert scripts and pretty graphing software. Snmpd installation is a little obtuse so here is how to do the<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2010/03/10/installing-snmpd-remote-access-debian-5lenny/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2010/03/10/installing-snmpd-remote-access-debian-5lenny/">Installing SNMPD (with remote access) on Debian 5/Lenny</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Today we&#8217;re installing snmpd so that we can query our debian server from another remote server that will use snmp in alert scripts and pretty graphing software.</p>
<p>Snmpd installation is a little obtuse so here is how to do the installation on Debian Lenny.</p>
<ul>
<ul>
<li>Install snmpd with: <code>sudo apt-get install snmpd</code></li>
</ul>
</ul>
<ul>
<ul>
<li>You should be using RCS/git/etc when editing system files at work. So use the appropriate techniques for checking in and out all conﬁg ﬁles. If you&#8217;re a home user don&#8217;t worry about this step; or, maybe you should. Muhahahaha! Eh, *cough*.</li>
</ul>
</ul>
<ul>
<ul>
<li>Open /etc/snmp/snmpd.conf and change to the following:<code># sec.name source community<br />
#com2sec paranoid default public<br />
#com2sec local localhost public<br />
com2sec local localhost mysecretcommunity<br />
com2sec readonly 192.168.XXX.XXX mysecretcommunity<br />
#com2sec readwrite default private</code></p>
<p>Here <i>mysecretcommunity</i> is the uber secret name of your community. Change this to something other than <i>public</i> or <i>mycommunity</i> &#8212; let common sense prevail. 192.168.XXX.XXX is the IP address of your remote server that will query snmpd.</li>
</ul>
</ul>
<ul>
<ul>
<li>Change /etc/default/snmpd so that it contains the following line:
<pre>SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid’</pre>
<p>Notice the lack of <code>127.0.0.1</code>?</li>
</ul>
</ul>
<ul>
<ul>
<li>Save the ﬁle!</li>
</ul>
</ul>
<ul>
<ul>
<li>Restart snmpd with <code>sudo /etc/init.d/snmpd restart</code>.</li>
</ul>
</ul>
<ul>
<ul>
<li>Test snmpd locally:
<pre>snmpwalk -Os -c mysecretcommunity -v 1 localhost system</pre>
</li>
<li>Test snmpd remotely from 192.168.XXX.XXX:
<pre>snmpwalk -Os -c mysecretcommunity -v 1 192.168.YYY.YYY system</pre>
<p>Here 192.168.YYY.YYY is the IP address of the debian server hosting snmpd.</li>
</ul>
</ul>
<ul>
<ul>
<li>Verify test outputs look like:<br />
<code><code>...<br />
sysObjectID.0 = OID: netSnmpAgentOIDs.10<br />
sysUpTimeInstance = Timeticks: (1201) 0:00:12.01<br />
sysContact.0 = STRING: root<br />
sysName.0 = STRING: irsplsemos01<br />
sysLocation.0 = STRING: Unknown<br />
sysORLastChange.0 = Timeticks: (0) 0:00:00.00<br />
sysORID.1 = OID: snmpFrameworkMIBCompliance<br />
sysORID.2 = OID: snmpMPDCompliance<br />
sysORID.3 = OID: usmMIBCompliance<br />
sysORID.4 = OID: snmpMIB<br />
sysORID.5 = OID: tcpMIB<br />
sysORID.6 = OID: ip<br />
sysORID.7 = OID: udpMIB<br />
sysORID.8 = OID: vacmBasicGroup<br />
...</code></code>&nbsp;</li>
</ul>
</ul>
<p>Thats all folks!</p>
<p>The post <a href="http://gl.ib.ly/stuff/2010/03/10/installing-snmpd-remote-access-debian-5lenny/">Installing SNMPD (with remote access) on Debian 5/Lenny</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2010/03/10/installing-snmpd-remote-access-debian-5lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing binary merge conflicts in git</title>
		<link>http://gl.ib.ly/stuff/2009/09/03/fixing-binary-merge-conflicts-git/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fixing-binary-merge-conflicts-git</link>
		<comments>http://gl.ib.ly/stuff/2009/09/03/fixing-binary-merge-conflicts-git/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 06:59:37 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[mergetool]]></category>
		<category><![CDATA[one liners]]></category>
		<category><![CDATA[opendiff]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[tidbits]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=86</guid>
		<description><![CDATA[<p>Git is an awesome tool for managing your code. However, it does take a while to get used to doing things in git. One question I get asked a bit too often is &#8220;how do I resolve binary merge conflicts&#8221;?<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2009/09/03/fixing-binary-merge-conflicts-git/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2009/09/03/fixing-binary-merge-conflicts-git/">Fixing binary merge conflicts in git</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><span style="color: #545454;">Git is an awesome tool for managing your code. However, it does take a while to get used to doing things in git. One question I get asked a bit too often is &#8220;how do I resolve binary merge conflicts&#8221;? Thankfully this is is pretty easy. I usually run the </span><code style="color: #545454;">git mergetool</code><span style="color: #545454;"> command to allow me to resolve merge conflicts using a graphical interface and then manipulate the resultant files on the command line. </span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<blockquote style="color: #76767a;"><p>You can specify which editor to use in your <code>~/.gitconfig</code> file. Favourites are <i>kdiff3</i>, <i>vimdiff</i>, <i>xxdiff</i>, and <i>opendiff</i>. If your on Mac OSX then you may be used to FileMerge, in which case you should be using <i>opendiff</i> in your <code>.gitconfig</code>; see below.</p>
<div><code>...<br />
[merge]<br />
tool = opendiff<br />
...<br />
</code></div>
</blockquote>
<p><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">So, when you are using mergetool option you will something like:</span></p>
<div style="color: #545454;"><code>Normal merge conflict for 'lib/yui/assets/skins/sam/editor-sprite.gif':<br />
{local}: created<br />
{remote}: created<br />
Hit return to start merge resolution tool (opendiff):<br />
</code></div>
<p><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">I just hit return so the editor opens, it will probably warn you the file is binary. In a separate terminal window navigate to the directory where the file is in and do an </span><code style="color: #545454;">ls</code><span style="color: #545454;">; you&#8217;ll see something like what is below:</span></p>
<div style="color: #545454;"><code>editor-sprite.gif<br />
editor-sprite.gif.BACKUP.41930.gif<br />
editor-sprite.gif.LOCAL.41930.gif<br />
editor-sprite.gif.REMOTE.41930.gif<br />
</code></div>
<p><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">In this case editor-sprite.gif.REMOTE.41930.gif is the new file and editor-sprite.gif is the original file. To resolve the conflict just copy the REMOTE file over the original file. In my case it would be </span><code style="color: #545454;">cp editor-sprite.gif.REMOTE.41930.gif editor-sprite.gif</code><span style="color: #545454;">. However, I use the following one liner to resolve these conflicts more generically.</span></p>
<div class="geshi" style="color: #545454;"><span style="font-weight: bold; color: #c20cb9;">ls</span> *.REMOTE.* | <span style="font-weight: bold; color: #c20cb9;">sed</span> <span style="color: #ff0000;">&#8220;s/\(\(.*\).REMOTE.*\)/cp \1 \2/g&#8221;</span> | <span style="font-weight: bold; color: #c20cb9;">sh</span></div>
<p><br style="color: #545454;" /><span style="color: #545454;">I have it in shell script in my path so I just run it when I need to resolve these types of conflicts. It just finds files with </span><i style="color: #545454;">REMOTE</i><span style="color: #545454;"> in them and then issues a </span><code style="color: #545454;">cp</code><span style="color: #545454;"> command to copy that file over the original.</span><br style="color: #545454;" /><br style="color: #545454;" /><span style="color: #545454;">Hope this helps!</span><br style="color: #545454;" /><br style="color: #545454;" /></p>
<blockquote style="color: #76767a;"><p>Outside of <i>git mergetool</i> you can just add the binary files using <i>git add file1 file2 &#8230;</i>.</p></blockquote>
<p>&nbsp;</p>
<p>The post <a href="http://gl.ib.ly/stuff/2009/09/03/fixing-binary-merge-conflicts-git/">Fixing binary merge conflicts in git</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/09/03/fixing-binary-merge-conflicts-git/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Searching compressed Apache logs</title>
		<link>http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=searching-compressed-apache-logs</link>
		<comments>http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 06:27:23 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[bunzip2]]></category>
		<category><![CDATA[compressed]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[one liners]]></category>
		<category><![CDATA[tidbits]]></category>
		<category><![CDATA[xargs]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=35</guid>
		<description><![CDATA[<p>From time to time things tend to go wrong and systems tend to go crazy. Sometimes these errors are more of nuisance than anything else, an intermittent annoyance you&#8217;d prefer not to investigate &#8212; trawling through logs is a pain in<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/">Read more &#8250;</a></div><!-- end of .read-more --></p><p>The post <a href="http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/">Searching compressed Apache logs</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>From time to time things tend to go wrong and <a title="http://gl.ib.ly/archives/10-Deleting-specific-emails-from-the-postfix-mail-queue.html" href="http://web.archive.org/web/20090814080809/http://gl.ib.ly/exit.php?url_id=65&amp;entry_id=27">systems tend to go crazy</a>. Sometimes these errors are more of nuisance than anything else, an intermittent annoyance you&#8217;d prefer not to investigate &#8212; trawling through logs is a pain in the backside. Now you need to take a peak at those compressed Apache error log files, ugh! Well before you look for suitable places to hang some rope try running some expressions across a certain number of files. Normally you&#8217;d only want to look at logs for the last 7 days, so lets give that a go.</p>
<div>The error messages I am interested in all contain the text <code>Healthcheck</code> so I will use trusty <code>grep</code>find matching lines in the logs. I will use <code>find</code> to get me all the files modified in the last seven days. A program called <code>xargs</code> will then be used to call <code>cat</code> which will pipe to a compression program which finally pipes to <code>grep</code>. Put this all together and you get something like this:</p>
<div>
<pre>find /var/log/apache2 -type f -name "error_*.bz2" -mtime -7 | sort | xargs cat | bunzip2 | grep"Healthcheck"</pre>
</div>
<p>If your files are <i>tar.gz</i> then you&#8217;ll need to replace <code>bunzip2</code> with gzip -dc. So that would look like:</p>
</div>
<div>
<pre>find /var/log/apache2 -type f -name "error_*.tar.gz" -mtime -7 | sort | xargs cat | gzip -dc |grep "Healthcheck"</pre>
<p>Have fun!</p>
</div>
<p>The post <a href="http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/">Searching compressed Apache logs</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/06/23/searching-compressed-apache-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rubber hose attacks!</title>
		<link>http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cryptography-rubber-hose-attacks</link>
		<comments>http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 06:07:10 +0000</pubDate>
		<dc:creator><![CDATA[tariq]]></dc:creator>
				<category><![CDATA[archives]]></category>
		<category><![CDATA[Stuff]]></category>
		<category><![CDATA[comic]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[deniable encryption]]></category>
		<category><![CDATA[rip]]></category>
		<category><![CDATA[rubber hose]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tidbits]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://gl.ib.ly/?p=29</guid>
		<description><![CDATA[<p>Awesome! Hot linked from xkcd. Also, checkout wikipedia for more details on what the Russians do and how public key cryptography could get you killed or landed in jail (if you live in the uk).</p><p>The post <a href="http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/">Rubber hose attacks!</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><img alt="" src="http://imgs.xkcd.com/comics/security.png" /></p>
<p>Awesome! Hot linked from <a title="http://xkcd.com/538/" href="http://web.archive.org/web/20090604081323/http://gl.ib.ly/exit.php?url_id=51&amp;entry_id=25">xkcd</a>. Also, checkout <a title="http://en.wikipedia.org/wiki/Rubber_hose_cryptanalysis" href="http://web.archive.org/web/20090604081323/http://gl.ib.ly/exit.php?url_id=52&amp;entry_id=25">wikipedia</a> for more details on what the Russians do and how public key cryptography could get you killed or landed in jail (<a title="http://www.statutelaw.gov.uk/content.aspx?activeTextDocId=1757378" href="http://web.archive.org/web/20090604081323/http://gl.ib.ly/exit.php?url_id=53&amp;entry_id=25">if you live in the uk</a>).</p>
<p>The post <a href="http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/">Rubber hose attacks!</a> appeared first on <a href="http://gl.ib.ly">GL.IB.LY</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gl.ib.ly/stuff/2009/02/07/cryptography-rubber-hose-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
