<?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>fabiolagana.net &#187; Linux</title>
	<atom:link href="http://blog.fabiolagana.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fabiolagana.net</link>
	<description>640 Kb should be enough memory for anybody</description>
	<lastBuildDate>Mon, 26 Oct 2009 13:17:04 +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>Update Expired SSL Certs</title>
		<link>http://blog.fabiolagana.net/update-expired-ssl-certs/</link>
		<comments>http://blog.fabiolagana.net/update-expired-ssl-certs/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 11:17:06 +0000</pubDate>
		<dc:creator>Fabio Laganà</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[certificats]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.fabiolagana.net/?p=98</guid>
		<description><![CDATA[&#160;Powered by Max Banner Ads&#160; - Farsi una copia del vecchio certificato cd /etc/ssl/certs cp -ap pop3ss.pem pop3s.pem.scaduto &#160; - Ricreazione nuovo certificato cd /etc/ssl openssl req -new -x509 -nodes -days 3650 -newkey rsa:1024 -keyout private/pop3s.key -out pop3s.cert touch certs/pop3s-new.pem chmod 600 certs/pop3s-new.pem cat private/pop3s.key pop3s.cert &#62; certs/pop3s-new.pem dd if=/dev/urandom count=2 &#124; openssl dhparam -rand [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_codebox"><table><tr id="p982"><td class="code" id="p98code2"><pre class="bash" style="font-family:monospace;">- Farsi una copia del vecchio certificato
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>certs
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-ap</span> pop3ss.pem pop3s.pem.scaduto
&nbsp;
- Ricreazione nuovo certificato
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span> <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">1024</span> <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>pop3s.key <span style="color: #660033;">-out</span> pop3s.cert
<span style="color: #c20cb9; font-weight: bold;">touch</span> certs<span style="color: #000000; font-weight: bold;">/</span>pop3s-new.pem
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> certs<span style="color: #000000; font-weight: bold;">/</span>pop3s-new.pem
<span style="color: #c20cb9; font-weight: bold;">cat</span> private<span style="color: #000000; font-weight: bold;">/</span>pop3s.key pop3s.cert <span style="color: #000000; font-weight: bold;">&gt;</span> certs<span style="color: #000000; font-weight: bold;">/</span>pop3s-new.pem
<span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #007800;">count</span>=<span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">|</span> openssl dhparam <span style="color: #660033;">-rand</span> - <span style="color: #000000;">512</span>
pico certs<span style="color: #000000; font-weight: bold;">/</span>pop3s-new.pem
<span style="color: #c20cb9; font-weight: bold;">chown</span> vpopmail certs<span style="color: #000000; font-weight: bold;">/</span>pop3s-new.pem
<span style="color: #7a0874; font-weight: bold;">cd</span> certs
<span style="color: #c20cb9; font-weight: bold;">mv</span> pop3s-new.pem pop3s.pem
&nbsp;
<span style="color: #660033;">--</span> rollback <span style="color: #000000; font-weight: bold;">in</span> caso qualcosa andasse storto <span style="color: #660033;">--</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> pop3s.pem.scaduto pop3s.pem</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.fabiolagana.net/update-expired-ssl-certs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash script for checking mysql problem by reading daemon.log</title>
		<link>http://blog.fabiolagana.net/bash-script-checking-mysql-problem-by-reading-daemonlog/</link>
		<comments>http://blog.fabiolagana.net/bash-script-checking-mysql-problem-by-reading-daemonlog/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 21:27:34 +0000</pubDate>
		<dc:creator>Fabio Laganà</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[daemon.log]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://blog.fabiolagana.net/?p=48</guid>
		<description><![CDATA[#!/bin/bash &#160; ### Checking del daemon.log per eventuali problemi sul DB MySQL # rel. 0.3 - 01 Agosto 2008 &#160; # time_to_check_min=`date +&#34;%b %d %k:%M&#34; -d &#34;-1 min&#34;` # time_to_check_hour=`date +&#34;%b %d %k:%M&#34; -d &#34;-1 hour&#34;` file_to_check=/var/log/daemon.log tmp_file=/tmp/info.tmp.01.$$ tmp_file1=/tmp/info.tmp.02.$$ host=`cat /etc/hostname` semaphore=/tmp/.flag_checking_daemon_log &#160; daemon=mysql &#160; if &#91;&#91; -e $semaphore &#93;&#93;; then echo &#34;checking for mysqld....Nothing [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_codebox"><table><tr id="p484"><td class="code" id="p48code4"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### Checking del daemon.log per eventuali problemi sul DB MySQL</span>
<span style="color: #666666; font-style: italic;"># rel. 0.3 - 01 Agosto 2008</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># time_to_check_min=`date +&quot;%b %d %k:%M&quot; -d &quot;-1 min&quot;`</span>
<span style="color: #666666; font-style: italic;"># time_to_check_hour=`date +&quot;%b %d %k:%M&quot; -d &quot;-1 hour&quot;`</span>
<span style="color: #007800;">file_to_check</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>daemon.log
<span style="color: #007800;">tmp_file</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>info.tmp.01.<span style="color: #007800;">$$</span>
<span style="color: #007800;">tmp_file1</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>info.tmp.02.<span style="color: #007800;">$$</span>
<span style="color: #007800;">host</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">semaphore</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>.flag_checking_daemon_log
&nbsp;
<span style="color: #007800;">daemon</span>=mysql
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$semaphore</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;
  <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;checking for mysqld....Nothing to do ....another cron is still working&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #007800;">$semaphore</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #ff0000;">'10'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">time_to_check_min</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%b %d %k:%M&quot;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;-1 min&quot;</span><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">'s/[[:space:]](0)([1-9])[[:space:]]/  2 /'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">time_to_check_hour</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%b %d %k:%M&quot;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;-1 hour&quot;</span><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">'s/[[:space:]](0)([1-9])[[:space:]]/  2 /'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #007800;">time_to_check_min</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%b %d %k:%M&quot;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;-1 min&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">time_to_check_hour</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%b %d %k:%M&quot;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;-1 hour&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;">#echo &quot;checking for &quot;&quot;$file_to_check  $time_to_check_min&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$time_to_check_min</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$file_to_check</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$tmp_file</span>
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$daemon</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp_file</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$tmp_file1</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$tmp_file1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$tmp_file1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Something happening on [ <span style="color: #007800;">$daemon</span> ] for &quot;</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">$host</span>&quot;</span> tech-c<span style="color: #000000; font-weight: bold;">@</span>bakeca.it <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #007800;">$tmp_file1</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #666666; font-style: italic;">#remove the tmp_file</span>
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$tmp_file</span>
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$tmp_file1</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
   <span style="color: #666666; font-style: italic;">#removing the semaphore</span>
   <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$semaphore</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.fabiolagana.net/bash-script-checking-mysql-problem-by-reading-daemonlog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Variables</title>
		<link>http://blog.fabiolagana.net/linux-variables/</link>
		<comments>http://blog.fabiolagana.net/linux-variables/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 12:32:27 +0000</pubDate>
		<dc:creator>Fabio Laganà</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Variables]]></category>

		<guid isPermaLink="false">http://blog.fabiolagana.net/?p=9</guid>
		<description><![CDATA[When variables are used they are referred to with the $ symbol in front of them. There are several useful variables available in the shell program. Here are a few: $$ = The PID number of the process executing the shell. $? = Exit status variable. $0 = The name of the command you used [...]]]></description>
			<content:encoded><![CDATA[<p>When variables are used they are referred to with the $ symbol in front of them. There are several useful variables available in the shell program. Here are a few:</p>
<ul>
<li>$$ = The PID number of the process executing the shell.</li>
<li>$? = Exit status variable.</li>
<li>$0 = The name of the command you used to call a program.</li>
<li>$1 = The first argument on the command line.</li>
<li>$2 = The second argument on the command line.</li>
<li>$n = The nth argument on the command line.</li>
<li>$* = All the arguments on the command line.</li>
<li>$# The number of command line arguments.</li>
</ul>
<p>The &#8220;shift&#8221; command can be used to shift command line arguments to the left, ie $1 becomes the value of $2, $3 shifts into $2, etc. The command, &#8220;shift 2&#8243; will shift 2 places meaning the new value of $1 will be the old value of $3 and so forth.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabiolagana.net/linux-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH dynamic port forwarding with SOCKS</title>
		<link>http://blog.fabiolagana.net/ssh-dynamic-port-forwarding-with-soks/</link>
		<comments>http://blog.fabiolagana.net/ssh-dynamic-port-forwarding-with-soks/#comments</comments>
		<pubDate>Thu, 26 Oct 2006 14:38:09 +0000</pubDate>
		<dc:creator>Fabio Laganà</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[SOCKS]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.fabio.lagana.name/?p=11</guid>
		<description><![CDATA[SSH has numerous uses beyond just logging into a remote system. In particular, SSH allows you to forward ports from one machine to another, tunnelling traffic through the secure SSH connection. This provides a convenient means of accessing a service hosted behind a firewall, or one blocked by an outgoing firewall. However, forwarding an individual [...]]]></description>
			<content:encoded><![CDATA[<p>SSH has numerous uses beyond just logging into a remote system. In<br />
particular, SSH allows you to forward ports from one machine to another,<br />
tunnelling traffic through the secure SSH connection. This provides a<br />
convenient means of accessing a service hosted behind a firewall, or one<br />
blocked by an outgoing firewall.</p>
<p>However, forwarding an individual port still requires you to change<br />
where your program connects, telling it to use a non-standard port on<br />
|localhost| rather than the standard port on the remote machine, and it<br />
requires a separate port forward for each machine you want to access.<br />
Dynamic port forwarding via SOCKS<br />
provides a more convenient alternative.</p>
<p>The examples in this article assume that you reside behind a restrictive<br />
firewall which does not allow outgoing SMTP connections except to a<br />
designated mail server. You want to connect to a different mail server,<br />
|mail.example.net|, on port 25. You have an SSH account on a machine<br />
|shell.example.org|, which does not reside within the restrictive<br />
firewall and can thus access port 25 on |mail.example.net|.</p>
<p>With standard SSH port forwarding, you could enter the command:</p>
<p>ssh -L 2525:mail.example.net:25 shell.example.org</p>
<p>This will forward port 2525 on your machine to port 25 on<br />
|mail.example.net|, by way of |shell.example.org|. You will then need to<br />
configure your mailer to send mail to |localhost|, port 2525, and use<br />
the authentication information for your mail account on<br />
|mail.example.net|. For example, in Thunderbird^WIcedove, you could add<br />
an additional outgoing mail server via Edit-&gt;Preferences, &#8220;Outgoing Mail<br />
Server (SMTP)&#8221;, &#8220;Add&#8230;&#8221;, and either set it as the default or explicitly<br />
set your mail account to use that server. You can then send your mail,<br />
which will potentially (if you use secure authentication with<br />
|mail.example.net|) give you a security warning about |localhost|<br />
presenting a certificate for |mail.example.net|, and then prompt you for<br />
your account password. After you have finished sending all the mails you<br />
want to send, you can then change your outgoing mail server back to the<br />
previous setting, and exit SSH.</p>
<p>To avoid all this hassle, SSH also supports dynamic port forwarding via<br />
SOCKS. SOCKS defines a standard mechanism for a client to connect to a<br />
server by way of a proxy. SSH can serve as the proxy, allowing you to<br />
connect to |shell.example.org| and make connections from there to an<br />
arbitrary server such as |mail.example.net|. Simply run:</p>
<p>ssh -D 1080 shell.example.org</p>
<p>to make the connection to |shell.example.org| and start a SOCKS proxy on<br />
|localhost| port 1080.</p>
<p>In order to make use of the SOCKS proxy, you can either use applications<br />
which can speak SOCKS natively, or you can use a socksifier program like<br />
tsocks. tsocks provides a library used with |LD_PRELOAD|, which replaces<br />
the standard sockets functions like |socket|, |connect|, and |sendto|<br />
with functions that make use of a designated SOCKS proxy. The tsocks<br />
script runs a program with this library loaded. The library will read<br />
|/etc/tsocks.conf| to find out what SOCKS proxy to use. To configure<br />
tsocks to work with an SSH SOCKS proxy on localhost, edit the default<br />
|/etc/tsocks.conf|, change the server variable to 127.0.0.1, and comment<br />
out the path example.</p>
<p>Now that you have tsocks configured, you can run the following whenever<br />
you want to send mail via |mail.example.net|:</p>
<p>ssh -D 1080 shell.example.org<br />
tsocks thunderbird</p>
<p>This will open the SSH-tunnelled SOCKS proxy to |shell.example.org| and<br />
run thunderbird. You can then send mail normally, without changing the<br />
outgoing server configuration, and without seeing any authentication<br />
mismatch warnings.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabiolagana.net/ssh-dynamic-port-forwarding-with-soks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
