<?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>The Lost Notebook &#187; Tools</title>
	<atom:link href="http://funinc.org/category/tools/feed" rel="self" type="application/rss+xml" />
	<link>http://funinc.org</link>
	<description>Things that I tend to forget</description>
	<lastBuildDate>Sat, 31 Mar 2012 18:21:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Match SSL Certificate to Key and CSR</title>
		<link>http://funinc.org/20120315/match-ssl-certificate-to-key-and-csr</link>
		<comments>http://funinc.org/20120315/match-ssl-certificate-to-key-and-csr#comments</comments>
		<pubDate>Thu, 15 Mar 2012 08:46:03 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[certificates]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=342</guid>
		<description><![CDATA[Renewing an SSL certificate is usually straight forward. But sometimes you&#8217;re not sure which CSR to use. Or if you need to generate a new CSR, which SSL key. Here are the commands I use to verify the certificate related files: openssl x509 -noout -modulus -in mydomain.crt &#124; openssl md5 openssl rsa -noout -modulus -in [...]]]></description>
			<content:encoded><![CDATA[<p>Renewing an SSL certificate is usually straight forward. But sometimes you&#8217;re not sure which CSR to use. Or if you need to generate a new CSR, which SSL key. Here are the commands I use to verify the certificate related files:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">openssl x509 -noout -modulus -<span class="kw1">in</span> mydomain.crt | openssl md5</div>
</li>
<li class="li1">
<div class="de1">openssl rsa -noout -modulus -<span class="kw1">in</span> mydomain.key | openssl md5</div>
</li>
<li class="li1">
<div class="de1">openssl req -noout -modulus -<span class="kw1">in</span> mydomain.csr | openssl md5</div>
</li>
</ol>
</div>
<p>The MD5 hash should match.<br />
You could use a bash script to search a directory for a specific MD5 hash. For example: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">for</span> f <span class="kw1">in</span> $<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="re1">$SOMEDIR</span><span class="br0">&#41;</span>; <span class="kw1">do</span> <span class="kw3">echo</span> <span class="re1">$f</span>; openssl x509 -noout -modulus -<span class="kw1">in</span> <span class="re1">$SOMEDIR</span><span class="re1">$f</span> | openssl md5 | <span class="kw2">grep</span> <span class="st0">&quot;MYMD5HASH&quot;</span>; <span class="kw1">done</span></div>
</li>
</ol>
</div>
<p>I guess the above could use some work <img src='http://funinc.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><ins datetime="2012-03-15T08:29:20+00:00">for the CLI-phobics check out <a href="https://www.sslshopper.com/certificate-key-matcher.html" title="Key Matcher" target="_blank">this certificate key matcher</a></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20120315/match-ssl-certificate-to-key-and-csr/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Reverse Proxy + SSH Reverse Tunnel</title>
		<link>http://funinc.org/20111229/apache-reverse-proxy-ssh-reverse-tunnel</link>
		<comments>http://funinc.org/20111229/apache-reverse-proxy-ssh-reverse-tunnel#comments</comments>
		<pubDate>Thu, 29 Dec 2011 14:17:34 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=328</guid>
		<description><![CDATA[Disclaimer: This setup is just a bit crazy, and I wouldn&#8217;t recommend it for a production site. Works for me. I needed to allow some clients to test a web app I&#8217;m working on. But I didn&#8217;t want to deploy the code to a server for now for different reasons (mainly memory constraints). So the [...]]]></description>
			<content:encoded><![CDATA[<p><small><em>Disclaimer: This setup is just a bit crazy, and I wouldn&#8217;t recommend it for a production site. Works for me.</em></small><br />
I needed to allow some clients to test a web app I&#8217;m working on. But I didn&#8217;t want to deploy the code to a server for now for different reasons (mainly memory constraints). So the solution was to setup a reverse proxy using apache to my local machine. Check out the code after the break <span id="more-328"></span><br />
Here&#8217;s the <code>VirtualHost</code> I created: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;VirtualHost</span> *:<span class="nu0">80</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ServerName proj312.grat.in</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPass / http://home-ip:18000/</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPassReverse / http://home-ip:18000/</div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;/VirtualHost<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>The problem is that my home-ip is not fixed. A Dynamic DNS setup is the fix that comes to mind first. But, I thought I would try something else: <code>Reverse SSH Tunnel</code><br />
I used the recipe and explanations in <a href="http://toic.org/blog/2009/01/18/reverse-ssh-port-forwarding/" title="reverse-ssh-port-forwarding" target="_blank">this article</a>. Mostly, all I needed to do was the following:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> -fNR <span class="nu0">18000</span>:localhost:<span class="nu0">8000</span> myserver</div>
</li>
</ol>
</div>
<p>Where the 18000 is the port on the server, and 8000 is the port on the home machine. No harm in using the same port numbers, btw.</p>
<p>I then changed the <code>VirtualHost</code> configuration in apache on the server to read: </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;VirtualHost</span> *:<span class="nu0">80</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ServerName proj312.grat.in</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPass / http://127.0.0.1:18000/</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; ProxyPassReverse / http://127.0.0.1:18000/</div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;/VirtualHost<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>Restart apache on the server and all falls in place perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111229/apache-reverse-proxy-ssh-reverse-tunnel/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Suspend Ubuntu Desktop</title>
		<link>http://funinc.org/20111227/suspend-ubuntu-desktop</link>
		<comments>http://funinc.org/20111227/suspend-ubuntu-desktop#comments</comments>
		<pubDate>Tue, 27 Dec 2011 12:06:25 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[connectbot]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[lebanon]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=323</guid>
		<description><![CDATA[Simple command line: pm-suspend An interesting alternative would be: pm-suspend-hybrid From the man page: pm-suspend-hybrid Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can wake up quicker than for normal hibernation if you do not run out of power, [...]]]></description>
			<content:encoded><![CDATA[<p>Simple command line: <code>pm-suspend</code><br />
An interesting alternative would be: <code>pm-suspend-hybrid</code></p>
<p><span id="more-323"></span></p>
<p>From the man page:</p>
<blockquote><p><strong>pm-suspend-hybrid</strong><br />
           Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can<br />
           wake up quicker than for normal hibernation if you do not run out of power, and you can resume even if you run out of power. s2both(8) is an hybrid-suspend<br />
           implementation.</p>
</blockquote>
<p>Background story: Electricity problems in Lebanon, and old UPS, causing me plenty of headaches. So I needed a quick way to suspend/hibernate the desktop without loosing all my volatile settings and open files. I added a shortcut for a <a href="http://code.google.com/p/connectbot/">ConnectBot</a> host configuration on my android phone that runs this command on the desktop (remotely): <code>sudo pm-suspend-hybrid</code><br />
This way if the backup generator starts in time or not, everything is back up and running in under <del datetime="2011-12-27T12:14:51+00:00">45s</del>12s (just clocked it!).</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111227/suspend-ubuntu-desktop/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick SSH Tunnel using Putty</title>
		<link>http://funinc.org/20111221/quick-ssh-tunnel-using-putty</link>
		<comments>http://funinc.org/20111221/quick-ssh-tunnel-using-putty#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:27:56 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=314</guid>
		<description><![CDATA[Two easy steps to create a tunnel from a remote server port to your localhost. It&#8217;s handy if you&#8217;re trying to connect to a mysql, jboss, etc. installation bound to localhost only (for better security. Check out the screenshots after the break 1- Add the remote server&#8217;s information (Session) 2- Add the tunnel information (Connection [...]]]></description>
			<content:encoded><![CDATA[<p>Two easy steps to create a tunnel from a remote server port to your localhost. It&#8217;s handy if you&#8217;re trying to connect to a mysql, jboss, etc. installation bound to localhost only (for better security. Check out the screenshots after the break<span id="more-314"></span></p>
<p>1- Add the remote server&#8217;s information (Session)<br />
<a href="http://funinc.org/wp-content/uploads/putty-cfg-1.png"><img src="http://funinc.org/wp-content/uploads/putty-cfg-1-300x288.png" alt="" title="putty-cfg-1" width="300" height="288" class="alignnone size-medium wp-image-315" /></a></p>
<p>2- Add the tunnel information (Connection &#8211; SSH &#8211; Tunnels)<br />
<a href="http://funinc.org/wp-content/uploads/putty-cfg-2.png"><img src="http://funinc.org/wp-content/uploads/putty-cfg-2-300x288.png" alt="" title="putty-cfg-2" width="300" height="288" class="alignnone size-medium wp-image-316" /></a><br />
You need to edit the Source port and Destination then click the &#8220;Add&#8221; button. </p>
<p>This should be enough. Either go back to the &#8220;Session&#8221; screen and save the configuration for later. Or simply click &#8220;Open&#8221; to get started. </p>
<p>Creating an SSH tunnel or forwarding ports is pretty easy when you&#8217;re on a Linux machine. Simply type the following in the shell:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> -fLN <span class="nu0">8080</span>:<span class="nu0">127.0</span><span class="nu0">.0</span><span class="nu0">.1</span>:<span class="nu0">8080</span> myserver.tld</div>
</li>
</ol>
</div>
<p>Where the first 8080 is the local port and the second 8080 is the port on the server.</p>
<p>Practically, let&#8217;s say you have a <a href="http://glassfish.java.net" target="_blank">glassfish</a> installation on your server at 10.0.10.15. You cannot access the admin port 8484 on that server as it&#8217;s by default bound to localhost only. So, you can create a tunnel using the following command and access the glassfish admin site as if it&#8217;s on the local machine at <code>http://127.0.0.1:8484/</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">ssh</span> -fLN <span class="nu0">8484</span>:<span class="nu0">127.0</span><span class="nu0">.0</span><span class="nu0">.1</span>:<span class="nu0">8484</span> <span class="nu0">10.0</span><span class="nu0">.10</span><span class="nu0">.15</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111221/quick-ssh-tunnel-using-putty/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safely Rebooting RimuHosting VPS (via API)</title>
		<link>http://funinc.org/20111026/safely-rebooting-rimuhosting-vps-via-api</link>
		<comments>http://funinc.org/20111026/safely-rebooting-rimuhosting-vps-via-api#comments</comments>
		<pubDate>Wed, 26 Oct 2011 10:18:07 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=300</guid>
		<description><![CDATA[First, get the API keys from the control panel at https://rimuhosting.com/cp/apikeys.jsp The documentation for the API can be found here So to reboot, I use the following script: #!/bin/bash APIKEY=00000000000000000000000000 VPSOID=0000000 VPSNAME=whatever curl -H &#34;Content-Type: application/json&#34; -H &#34;Accept: application/json&#34; -H &#34;Authorization: rimuhosting apikey=$APIKEY&#34; -X PUT -d &#8216;{&#34;reboot_request&#34;: {&#34;running_state&#34;: &#34;RESTARTING&#34;}}&#8217; https://rimuhosting.com/r/orders/order-$VPSOID-$VPSNAME/vps/running-state That seems to be much [...]]]></description>
			<content:encoded><![CDATA[<p>First, get the API keys from the control panel at https://rimuhosting.com/cp/apikeys.jsp<br />
<a href="https://rimuhosting.com/cp/apikeys.jsp"><img src="http://funinc.org/wp-content/uploads/rimu-api-keys-234x300.png" alt="API Keys page" title="API Keys page" width="234" height="300" class="alignnone size-medium wp-image-301" /></a></p>
<p>The documentation for the API can be found <a href="http://apidocs.rimuhosting.com" title="RimuHosting API docs" target="_blank">here</a></p>
<p>So to reboot, I use the following script:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3">#!/bin/bash </span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">APIKEY=</span><span class="nu0">00000000000000000000000000</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">VPSOID=</span><span class="nu0">0000000</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">VPSNAME=</span>whatever</div>
</li>
<li class="li2">
<div class="de2">curl -H <span class="st0">&quot;Content-Type: application/json&quot;</span> -H <span class="st0">&quot;Accept: application/json&quot;</span> -H <span class="st0">&quot;Authorization: rimuhosting apikey=$APIKEY&quot;</span> -X PUT -d <span class="st0">&#8216;{&quot;reboot_request&quot;: {&quot;running_state&quot;: &quot;RESTARTING&quot;}}&#8217;</span> https://rimuhosting.com/r/orders/order-<span class="re1">$VPSOID</span>-<span class="re1">$VPSNAME</span>/vps/running-state</div>
</li>
</ol>
</div>
<p>That seems to be much safer than running: <code>sudo reboot</code> </p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20111026/safely-rebooting-rimuhosting-vps-via-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django uWSGI and Nginx on Ubuntu 11.10</title>
		<link>http://funinc.org/20110923/django-uwsgi-and-nginx-on-ubuntu-11-10</link>
		<comments>http://funinc.org/20110923/django-uwsgi-and-nginx-on-ubuntu-11-10#comments</comments>
		<pubDate>Fri, 23 Sep 2011 17:12:45 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[uwsgi]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=294</guid>
		<description><![CDATA[Installing my simple Django app on a new Ubuntu 11.10 machine using uWSGI and Nginx]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working my way through installing my simple django app on a new Ubuntu machine using the components mentioned above.</p>
<p>So far, here&#8217;s what I&#8217;ve done:</p>
<ul>
<li>apt-get install nginx-full</li>
<li>apt-get install uwsgi uwsgi-plugin-python</li>
<li>installed django from svn <a href="http://www.djangoproject.com/download/" target="_blank">described in the docs</a></li>
</ul>
<p>The nginx configuration can be found in /etc/nginx/sites-available/default. Of course, it&#8217;s best to make a copy of that file and edit it for the site/app I&#8217;m working on. Here&#8217;s what I put in it:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">server <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; listen &nbsp; <span class="nu0">80</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; server_name sss.<span class="me1">grat</span>.<span class="me1">in</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; access_log /var/log/nginx/sss.<span class="me1">grat</span>.<span class="me1">in</span>-access.<span class="me1">log</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; location /media <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; alias /home/sss/app/media/;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; location /<span class="kw4">static</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; alias /home/sss/app/<span class="kw4">static</span>/;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; location / <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; uwsgi_pass unix:<span class="co1">///var/run/sss.grat.in.sock;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; include uwsgi_params;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Now for the uWSGI configuration file. I created the file /etc/uwsgi/apps-available/sss.ini and added the following lines:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re0"><span class="br0">&#91;</span>uwsgi<span class="br0">&#93;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">chdir </span>=<span class="re2"> /home/sss/app</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">pythonpath </span>=<span class="re2"> /home/sss</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">env </span>=<span class="re2"> DJANGO_SETTINGS_MODULE=app.settings</span></div>
</li>
<li class="li2">
<div class="de2"># load django</div>
</li>
<li class="li1">
<div class="de1"><span class="re1">module </span>=<span class="re2"> django.core.handlers.wsgi:WSGIHandler<span class="br0">&#40;</span><span class="br0">&#41;</span></span></div>
</li>
</ol>
</div>
<p>it&#8217;s really just that. What took me so long was to figure out that in Debian/Ubuntu you <strong>have to</strong> install uwsgi-plugin-python, otherwise you&#8217;ll keep on getting weird error messages. Also, the default ini file has most of the settings (in /etc/default/uwsgi) so you should either read or edit that to make sure you&#8217;re getting all the right values.</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110923/django-uwsgi-and-nginx-on-ubuntu-11-10/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick rootkit checks</title>
		<link>http://funinc.org/20110425/quick-rootkit-checks</link>
		<comments>http://funinc.org/20110425/quick-rootkit-checks#comments</comments>
		<pubDate>Mon, 25 Apr 2011 13:12:33 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[rootkit]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=269</guid>
		<description><![CDATA[mkdir chkrootkit; wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz -O- &#124; tar zx &#8211;strip-components=1 -C chkrootkit; chkrootkit/chkrootkit &#124; grep -v &#8216;nothing found&#8217; &#124; grep -v &#8216;not infected&#8217; &#124; grep -v &#8216;not tested&#8217; &#124; grep -v &#8216;not found&#8217; mkdir rkhunter; wget http://downloads.sourceforge.net/sourceforge/rkhunter/rkhunter-1.3.8.tar.gz -O- &#124; tar zx &#8211;strip-components=1 -C rkhunter; cd rkhunter; ./installer.sh &#8211;layout /usr/local &#8211;install; /usr/local/bin/rkhunter &#8211;check &#8211;quiet or: wget -O- [...]]]></description>
			<content:encoded><![CDATA[<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">mkdir</span> chkrootkit; <span class="kw2">wget</span> <span class="kw2">ftp</span>://<span class="kw2">ftp</span>.pangeia.com.br/pub/seg/pac/chkrootkit.<span class="kw2">tar</span>.gz -O- | <span class="kw2">tar</span> zx &#8211;strip-<span class="re2">components=</span><span class="nu0">1</span> -C chkrootkit; chkrootkit/chkrootkit | <span class="kw2">grep</span> -v <span class="st0">&#8216;nothing found&#8217;</span> | <span class="kw2">grep</span> -v <span class="st0">&#8216;not infected&#8217;</span> | <span class="kw2">grep</span> -v <span class="st0">&#8216;not tested&#8217;</span> | <span class="kw2">grep</span> -v <span class="st0">&#8216;not found&#8217;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">mkdir</span> rkhunter; <span class="kw2">wget</span> http://downloads.sourceforge.net/sourceforge/rkhunter/rkhunter<span class="nu0">-1.3</span><span class="nu0">.8</span>.<span class="kw2">tar</span>.gz -O- | <span class="kw2">tar</span> zx &#8211;strip-<span class="re2">components=</span><span class="nu0">1</span> -C rkhunter; <span class="kw3">cd</span> rkhunter; ./installer.<span class="kw2">sh</span> &#8211;layout /usr/<span class="kw3">local</span> &#8211;<span class="kw2">install</span>; /usr/<span class="kw3">local</span>/bin/rkhunter &#8211;check &#8211;quiet</div>
</li>
</ol>
</div>
<p>or:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">wget</span> -O- http://is.gd/chkrks | bash</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110425/quick-rootkit-checks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Firefox/Thunderbird</title>
		<link>http://funinc.org/20110302/remote-firefoxthunderbird</link>
		<comments>http://funinc.org/20110302/remote-firefoxthunderbird#comments</comments>
		<pubDate>Wed, 02 Mar 2011 09:33:01 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=259</guid>
		<description><![CDATA[My previous post was about running X applications on my remote (next room) machine. The reason behind that was mostly to offload the memory usage of Firefox and Thunderbird both humming happily near 250M of RAM/each at the moment (slow day). What did I do to minimize the effort of moving both apps to the [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://funinc.org/20110302/remote-x.moo/">previous post</a> was about running X applications on my remote (next room) machine. The reason behind that was mostly to offload the memory usage of Firefox and Thunderbird both humming happily near 250M of RAM/each at the moment (slow day). </p>
<p>What did I do to minimize the effort of moving both apps to the remote machine without loosing all the customizations I have made?</p>
<p>Make sure to do the following <strong>before</strong> running firefox/thunderbird on the remote machine:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re3"># backup the following directories:</span></div>
</li>
<li class="li1">
<div class="de1">laptop $ <span class="kw3">cd</span> /home/abdallah</div>
</li>
<li class="li1">
<div class="de1">laptop $ <span class="kw2">tar</span> czf .thunderbird.tgz .thunderbird/</div>
</li>
<li class="li1">
<div class="de1">laptop $ <span class="kw2">tar</span> czf .mozilla.tgz .mozilla/</div>
</li>
<li class="li2">
<div class="de2">laptop $ <span class="kw2">scp</span> .thunderbird.tgz server:/home/abdallah</div>
</li>
<li class="li1">
<div class="de1">laptop $ <span class="kw2">scp</span> .mozilla.tgz server:/home/abdallah</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>After that, connect remotely with -X and run the commands:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">laptop $ <span class="kw2">ssh</span> -X server</div>
</li>
<li class="li1">
<div class="de1">server $ <span class="kw2">tar</span> zxf .mozilla.tgz</div>
</li>
<li class="li1">
<div class="de1">server $ <span class="kw2">tar</span> zxf .thunderbird.tgz</div>
</li>
<li class="li1">
<div class="de1">server $ /opt/ff4/firefox -no-remote &amp;</div>
</li>
<li class="li2">
<div class="de2">server $ /opt/tb/thunderbird &amp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Note that -no-remote is important if you ever want to run another local instance of firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110302/remote-firefoxthunderbird/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote X</title>
		<link>http://funinc.org/20110302/remote-x</link>
		<comments>http://funinc.org/20110302/remote-x#comments</comments>
		<pubDate>Wed, 02 Mar 2011 09:07:03 +0000</pubDate>
		<dc:creator>abdallah</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=257</guid>
		<description><![CDATA[Short story: local-machine $ ssh -X remote-server remote-server $ /opt/ff4/firefox -no-remote &#38; Now the rant: I have an underutilized PC sitting in the office mostly gathering dust. It has 4G of RAM and plenty of HD space. So, I decided to use it, remotely. I&#8217;m running the latest Ubuntu on my laptop/netbook. The &#8220;server&#8221; has [...]]]></description>
			<content:encoded><![CDATA[<p>Short story:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">local-machine $ <span class="kw2">ssh</span> -X remote-server</div>
</li>
<li class="li1">
<div class="de1">remote-server $ /opt/ff4/firefox -no-remote &amp;</div>
</li>
</ol>
</div>
<p><span id="more-257"></span></p>
<p>Now the rant:<br />
I have an underutilized PC sitting in the office mostly gathering dust. It has 4G of RAM and plenty of HD space. So, I decided to use it, remotely.</p>
<p>I&#8217;m running the latest Ubuntu on my laptop/netbook. The &#8220;server&#8221; has Windows 7 running on it, and I don&#8217;t want to mess with that as my wife uses the machine (also remotely) for her design work. The solution was pretty simple: download VirtualBox, install a fresh Ubuntu inside a VM, run the VM headless and access it remotely from the laptop.</p>
<pre>
# running headless
C:\Program Files\Oracle\VirtualBox>VBoxHeadless.exe -s newvm
Oracle VM VirtualBox Headless Interface 4.0.4

# changes in ubuntu vm:
# create/edit the file /etc/gdm/custom.conf with the following:
[daemon]
[security]
DisallowTCP=false
[xdmcp]
Enable=true
DisplaysPerHost=2
[greeter]
[chooser]
[debug]

# restarted GDM using: /etc/init.d/gdm restart

# then connected from the client machine (laptop)
ssh -X remote-server
</pre>
<p>Now all commands entered or apps launched in the ssh shell will in fact run on the server, but will be displayed on the laptop monitor. Simple and effective.</p>
<p>I am going to install a small footprint window manager/desktop environment and use that later on. But I&#8217;m happy with things as they are at the moment. I&#8217;m running firefox/thunderbird remotely (both use plenty of memory)</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20110302/remote-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLI blogging with Postie (via postie)</title>
		<link>http://funinc.org/20100209/cli-blogging-with-postie</link>
		<comments>http://funinc.org/20100209/cli-blogging-with-postie#comments</comments>
		<pubDate>Tue, 09 Feb 2010 06:44:25 +0000</pubDate>
		<dc:creator>wolf</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Postie]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://funinc.org/?p=238</guid>
		<description><![CDATA[Bookmark this category Another blogging test using the postie plugin]]></description>
			<content:encoded><![CDATA[<p><a href="http://funinc.org/category/blogging/">Bookmark this category</a><br />
Another blogging test using the postie plugin</p>
]]></content:encoded>
			<wfw:commentRss>http://funinc.org/20100209/cli-blogging-with-postie/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

