<?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>a32.Blog &#187; linux</title>
	<atom:link href="http://a32.me/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://a32.me</link>
	<description>It&#039;s all about. IT and &#34;stuff&#34; :)</description>
	<lastBuildDate>Sun, 05 Feb 2012 07:57:47 +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>Change Mysql root password &#8211; The Right Way</title>
		<link>http://a32.me/2012/01/change-mysql-root-password-the-right-way/</link>
		<comments>http://a32.me/2012/01/change-mysql-root-password-the-right-way/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 07:48:43 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://a32.me/?p=2199</guid>
		<description><![CDATA[Sometime MySQL root password is lost, because of last admin did not leave you any notes on the server or you are given your client server to fix some database or script related errors where MySQL root password is required. I always knew one way of resetting it, but recently came up with another which [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime MySQL root password is lost, because of last admin did not leave you any notes on the server or you are given your client server to fix some database or script related errors where MySQL root password is required.</p>
<p>I always knew one way of resetting it, but recently came up with another which is <strong>The Right Way</strong>.</p>
<p><span id="more-2199"></span></p>
<p>It works both for linux and win32 OSes, in my example it is linux. It requires just one MySQL restart and is more secure.</p>
<h2>How to reset MySQL root password - The Right Way</h2>
<h3>Create text file with following SQL statements</h3>
<pre>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '<strong>[NEW_PASS]</strong>' WIth GRANT OPTION;</pre>
<p>Replace <strong>[NEW_PASS]</strong> with desired new password and save this file somewhere like <strong>/tmp/pwd.sql</strong></p>
<h3>Update config <strong>my.cnf</strong></h3>
<p>Usually it is located in /etc/ or /etc/mysql/. Find section called <strong>[mysqld]</strong> and add following line</p>
<pre>[mysqld]
init-file = /tmp/pwd.sql</pre>
<p>Restart MySQL. Voila. Your new password should be in place.</p>
<p>Do not forget remove /tmp/pwd.sql and comment "init-file" option in config file, because without init-file found MySQL won't start next at all.</p>
<p><strong>Ubuntu users warning! </strong> In Ubuntu, MySQL is protected with Apparmor and is prohibited to read files from /tmp. In Ubuntu name file /etc/mysql/pwd.cnf, this way it is read by server process.</p>
<h2>The other way - The Bad One</h2>
<p>For some reason, the following method seems to be far more popular, starting MySQL with "<strong>--skip-grant-tables"</strong>.</p>
<p>When MySQL is started with this parameter, it completely avoids checking its grant tables upon connection and upon query. This means anyone can log in from anywhere, and do anything on the database.</p>
<p>While the manual does mention this is a less preferred way of doing it, it does not elaborate. Starting MySQL with this parameter is a huge security breach. This is why one may wish to add the --skip-networking parameter, to only allow connection from the localhost (using Unix socket, for example).</p>
<p>Moreover, after MySQL starts, and the necessary GRANT or CHANGE PASSWORD take place, the server is still unsuitable for connections. This is why it needs to be restarted again, this time without --skip-grant-tables.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2012/01/change-mysql-root-password-the-right-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx and Mercurial setup</title>
		<link>http://a32.me/2011/11/nginx-and-mercurial-setup/</link>
		<comments>http://a32.me/2011/11/nginx-and-mercurial-setup/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 14:06:04 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://a32.me/?p=2029</guid>
		<description><![CDATA[Some weeks ago I switched to Nginx and quit Apache and was quite happy with it. I was so happy that completely forgot about my Mercurial repositories hosted on same server. This happen when I was in hurry and needed to push and pull some changes,  damn. At first I quickly restored Apache, did all needed changes and [...]]]></description>
			<content:encoded><![CDATA[<p>Some weeks ago <a title="I quit Apache and moved to Nginx" href="http://a32.me/2011/11/nginx-php5-fpm-ubuntu/" target="_blank">I switched to Nginx and quit Apache</a> and was quite happy with it. I was so happy that completely forgot about my Mercurial repositories hosted on same server. This happen when I was in hurry and needed to push and pull some changes,  damn.</p>
<p>At first I quickly restored Apache, did all needed changes and switched back to Nginx. For sure, I did not like this way and explored how I can connect Mercurial directly to Nginx. I was quite surprised how easy it is and how flexible.</p>
<p>Continue reading...</p>
<h1><span id="more-2029"></span>Mercurial via Apache setup</h1>
<p>I had Mercurial setup through Apache in a very standard way.</p>
<p>/var/hg - Holding all my repositaries</p>
<p>/var/hg/hgweb.config</p>
<pre>[collections]
repos/ = repos/</pre>
<p>/var/hg/hgwebdir.cgi - For Apache CGI support</p>
<p>/var/hg/hguser - for user passwords in htpasswd format</p>
<p>Apache configuration was the following</p>
<pre>ScriptAliasMatch ^/hg(.*) /var/hg/hgwebdir.cgi$1
&lt;Directory /var/hg&gt;
  Options ExecCGI FollowSymLinks
  AllowOverride None
&lt;/Directory&gt;</pre>
<pre>&lt;Location /hg&gt;
   AuthType Basic
   AuthName "Mercurial repositories"
   AuthUserFile /var/hg/hgusers
   Require valid-user
&lt;/Location&gt;</pre>
<p>Switch to Nginx was really painless.</p>
<h1>Nginx and Mercurial setup</h1>
<h2>Prepare Mercurial</h2>
<p>First step I switched to FastCGI instead of CGI. To do this I copied file <strong>hgwebdir.fcgi</strong> to my repo root /var/hg and made it executable</p>
<pre>copy /usr/share/doc/mercurial-common/examples/hgwebdir.fcgi /var/hg
chmod +x /var/hg/hgwebdir.fcgi</pre>
<p>Or grab the file here</p>
<pre>wget http://selenic.com/repo/hg/raw-file/tip/contrib/hgwebdir.fcgi</pre>
<p>Next step is to install something that can spawn FastCGI processes, sine Nginx can not do this by itself.  This is easy with spawn-cgi</p>
<pre>#apt-get install spawn-fcgi</pre>
<p>I configured it via local unix socket instead of TCP port, it seems to me this way it is more secure. Run it like this:</p>
<pre>#spawn-fcgi -u www-data -g www-data -s /tmp/mercurial.sock -d /var/hg/ -- /var/hg/hgwebdir.fcgi</pre>
<p>At first start I've run into the problem</p>
<pre>spawn-fcgi: child exited with: 1</pre>
<p>After running with "-n" switch to see debug output, I  realised that I was missing one python module needed for a setup.</p>
<pre>Traceback (most recent call last):
 File "/var/hg/hgwebdir.fcgi", line 25, in
 from flup.server.fcgi import WSGIServer
 File "/usr/lib/pymodules/python2.6/mercurial/demandimport.py", line 106, in _demandimport
 mod = _origimport(name, globals, locals)
 ImportError: No module named flup.server.fcgi</pre>
<p>To fix this I installed missing python packages and issue was fixed.</p>
<pre>#apt-get install python-flup</pre>
<h2>Configure Nginx</h2>
<p>Edit file /etc/nginx/sites-available/mercurial.conf and add the following server definition:</p>
<pre>server {
   listen 80;
   server_name YOUR_MERCURIAL_DOMAIN;</pre>
<pre>   location / {
     auth_basic "Secure Login";
     auth_basic_user_file /var/hg/hgusers;
     include fastcgi_params;
     fastcgi_param PATH_INFO $uri;
     fastcgi_param REMOTE_USER $remote_user;
     fastcgi_intercept_errors on;
     fastcgi_pass unix:/tmp/mercurial.sock;
  } 
}</pre>
<p>The above settings will setup a new virtual host, where all traffic is redirected to the Mercurial FastCGI wrapper. It is important that you forward the PATH_INFO and REMOTE_USER variables. Mercurial will not work correctly without these.</p>
<p>Be sure that file /var/hg/hgusers contains all your Mercurial users with passwords, it can be created using <strong>htpasswd</strong> tool shipped with Apache.</p>
<pre><span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">Restart Nginx and try to to push pull.</span></pre>
<h1>Misc</h1>
<p>One thing that changed was repositary path. Before it has /hg/ in path line</p>
<pre>http://a32.me/hg/project1</pre>
<p>Now it become a full virtual host and changed to:</p>
<pre>http://hg.a32.me/project1</pre>
<p>I have to reconfigure all my projects, but it is not a pain like it was with CVS.</p>
<p>Next thing I though about, I can move repositories under its own uid:gid and not run it under <strong>www-data,</strong> this can improve security.</p>
<p>Do not forget to include running <strong>spawn-fcgi</strong> into /etc/rc.local for automatically start on system boot.</p>
<h1>Links</h1>
<p>My story is based on these links.</p>
<ul>
<li>http://www.opennet.ru/base/dev/mercurial_http.txt.html</li>
<li>http://geeksharp.com/2010/01/20/mercurial-web-with-fastcgi-nginx/</li>
<li>http://fosswire.com/post/2009/08/hosting-mercurial-repositories-with-nginx/</li>
<li>http://www.softwareprojects.com/resources/programming/t-how-to-serve-mercurial-hg-repository-over-nginx-1856.html</li>
<li>http://www.dikant.de/2009/07/29/running-mercurial-with-fastcgi-in-nginx/</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2011/11/nginx-and-mercurial-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I quit Apache and moved to Nginx</title>
		<link>http://a32.me/2011/11/nginx-php5-fpm-ubuntu/</link>
		<comments>http://a32.me/2011/11/nginx-php5-fpm-ubuntu/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 07:44:49 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://a32.me/?p=2010</guid>
		<description><![CDATA[Now this blog is riding on Nginx+php-fpm setup. You may have heard about quickly growing in popularity Russian made web-server. Several years earlier Nginx had a really narrow appliance on high loaded sites as balancer, front end, static content, etc.. Something too complex to be setup for simple site or blog. Time changed things, community has [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://a32.me/wp-content/uploads/2011/11/nginx-php.png"><br />
</a>Now this blog is riding on <strong>Nginx+php-fpm</strong> setup. You may have heard about quickly growing in popularity Russian made web-server. Several years earlier Nginx had a really narrow appliance on high loaded sites as balancer, front end, static content, etc.. Something too complex to be setup for simple site or blog.</p>
<p>Time changed things, community has grown, all sharp corners were smoothed. The PHP itself starting from version 5.3 has out-of-the-box support of FPM (FastCGI Process Manager) to communicate to Nginx in a very efficient manner. Ubuntu PPA repositories has all things already compiled and tons of docs are available on the Internet.</p>
<p><a href="http://a32.me/wp-content/uploads/2011/11/nginx-php.png"><img class="aligncenter" title="nginx-php" src="http://a32.me/wp-content/uploads/2011/11/nginx-php.png" alt="" width="349" height="125" /></a></p>
<p>At first I though of this more like experiment, but after I tested it for a while and made some performance tests, I was surprised how well it performed on my tiny virtual server. It eats less memory and does more job.</p>
<p>I really like Apache web server, I've spend 10 years with it and still consider it the best one for many appliances. But from now on I have one more option to use for my projects.</p>
<p>Welcome to continue reading...</p>
<p><span id="more-2010"></span></p>
<p>Actually there was <strong>one more reason to try Nginx - memory usage</strong>. Some time ago I moved my blog from VPS based on Virtuozzo to the Rackspace cloud based on XEN. This move was more related mostly to money savings. Same characteristic server  (10Gb HDD, 256MB RAM) is twice cheaper on the cloud, less lagging and more productive.</p>
<p>But this move revealed that XEN and Virtuozzo virtual machines counts free memory in different ways. I experienced memory shortage on XEN immediately after setup of LAMP stack and WordPress. Default Apache server limits are too optimistic and RAM is quickly filled up with Apache instances of 30Mb in size each. After lowering limits to values 2-3 of server instances situation got better.</p>
<p>All this time I knew it could be even better <img src='http://a32.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Once I found some time to do it, I've done it.</p>
<h1>Nginx + php-fpm + WordPress</h1>
<p>Setup is very easy, there are tons of blog posts, howtos and official documentation on the Internet. I chose the easiest one and following it have it up and running in half-hour.</p>
<p>I did all tests of my LIVE server with Apache running and did not want to crash my current blog activity. So I installed Nginx in parallel on another port (8080) and it went well. After successful tests I just swapped Apache and Nginx</p>
<h2>Difference from Apache</h2>
<p>In Apache, PHP usually works as module - mod_php, it is loaded into Apache address space and acts like part of it. All requests are handled by Apache instance, either it is static file it is sent directly from HD, in case of .php file, it is passed through mod_php and output is send to the client. Web requests are distributed through all Apache workers in round robin. Since mod_php eats lots of memory, all instances very soon become FAT.</p>
<p>Nginx has different approach. By default it serves only static files and does this in a very efficient way. Web requests to dynamic pages, to .php files, are redirected to special FPM daemon which runs this request though one of php-worker process and sends output back to Nginx and further back to the client. FPM is simular to CGI, but more efficient because can handle multiple requests with single process.</p>
<p>This difference means, small static files are served very quickly with small memory footprint and dynamic .PHP files are served by several FPM workers.</p>
<h2>Installation on Ubuntu 10.04-LTS</h2>
<p>Later versions of Ubuntu already have php5-fpm compiled, so <strong>no additional repositories are required</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-software-properties
<span style="color: #c20cb9; font-weight: bold;">sudo</span> add-apt-repository ppa:nginx<span style="color: #000000; font-weight: bold;">/</span>stable
<span style="color: #c20cb9; font-weight: bold;">sudo</span> add-apt-repository ppa:nginx<span style="color: #000000; font-weight: bold;">/</span>php5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nginx php5-fpm</pre></div></div>

<h2>Configure php-fpm</h2>
<p>It is a daemon which listens on localhost:9000 or unix socket for PHP requests, processes them balancing through available FPM workers. It also supports creating several pools of workers which may be running under different <strong>uid/gid</strong> or have different php.ini settings, this advanced usage is not covered here.</p>
<p>By default it is configured to have one default worker pool called <strong>www</strong> and if you are not concerned about performance or memory usage you may leave configuration as default.</p>
<p>I did some changes to limit number of processes to fit my little memory. Mine change to <strong>/etc/php5/fpm/pool.d/www.conf</strong> are:</p>
<pre style="padding-left: 30px;" language="ini">listen=/tmp/php-fpm.sock
pm = dynamic
pm.max_children = 4
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 2
pm.max_requests = 500</pre>
<h2>Configure Nginx</h2>
<p>How to reach php-fpm. Unix socket seems better option for a local machine. I have this setting in separate config.</p>
<p><strong>/etc/nginx/conf.d/php-fpm.conf</strong></p>
<pre style="padding-left: 30px;">upstream php {
   server unix:/tmp/php-fpm.sock;
   #server 127.0.0.1:9000;
}</pre>
<p>Main site config. I compiled it using several articles found and official one from WordPress.</p>
<p><strong>/etc/nginx/sites-enabled/a32.me</strong></p>
<pre>server {
	listen	80;
        server_name a32.me;
        server_name www.a32.me;
        root /home/ameoba32/www/;

        index index.php;

	if ($http_host != "a32.me") {
	    rewrite ^ http://a32.me$request_uri permanent;
	}

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

	# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
	location ~ /\. {
	    deny all;
	    access_log off;
	    log_not_found off;
	}

	location / {
	    # No php is touched for static content
            try_files $uri $uri/ /index.php?$args;
        }

	# Add trailing slash to */wp-admin requests.
	rewrite /wp-admin$ $scheme://$host$uri/ permanent;

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }

        location ~ \.php$ {
                expires off;
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

                include fastcgi_params;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
                fastcgi_pass php;
        }
}</pre>
<h2>Launch</h2>
<pre>/etc/init.d/apache stop
/etc/init.d/php5-fpm start
/etc/init.d/nginx start</pre>
<h2>Update startup</h2>
<p>iIf everything is well, do not forget to switch daemons on system start.</p>
<pre># update-rc.d apache remove
# update-rc.d nginx enable
# update-rc.d php5-fpm enable</pre>
<h1>What is the difference</h1>
<p>OK, I moved, what really has changed ? I did several load tests using ApacheBench (ab) tool, which can generate load on a web server.</p>
<p>"-i" switch means to do HEAD requests instead of GET, difference is not to do actual content downloading, just  test pure server performance.</p>
<p>Test Apache, after stop and run Nginx and do several tests in a row to get average result.</p>
<p><strong>Test of dynamic content, WordPress main page</strong></p>
<pre>$ ab -i -n 500 -c 20 http://a32.me/</pre>
<p><strong>Test of static content</strong></p>
<pre>$ ab -i -n 500 -c 20 http://a32.me/sitemap.xml</pre>
<h2>Apache vs Nginx on dynamic PHP pages</h2>
<h3>Apache PHP serving</h3>
<p>Requests per second: <strong>6.81 [#/sec]</strong> (mean)<br />
Time per request: 2935.476 [ms] (mean)<br />
Time per request: 146.774 [ms] (mean, across all concurrent requests)</p>
<h3>Nginx PHP serving</h3>
<p>Requests per second: <strong>14.27 [#/sec]</strong> (mean)<br />
Time per request: 1401.530 [ms] (mean)<br />
Time per request: 70.076 [ms] (mean, across all concurrent requests)</p>
<h2>Apache vs Nginx on static content</h2>
<h3>Apache static content serving</h3>
<p>Requests per second: <strong>15.38 [#/sec]</strong> (mean)<br />
Time per request: 1300.093 [ms] (mean)<br />
Time per request: 65.005 [ms] (mean, across all concurrent requests)</p>
<h3>Nginx static content serving</h3>
<p>Requests per second: <strong>55.84 [#/sec]</strong> (mean)<br />
Time per request: 358.182 [ms] (mean)<br />
Time per request: 17.909 [ms] (mean, across all concurrent requests)</p>
<h2>Apache vs Nginx conclusion</h2>
<p>On dynamic files I've got it <strong>109%</strong> increase in efficiency, on static content <strong>263%. </strong>All this by simple changing the web server software. I am very satisfied with simplicity and performance it gives. Nginx setups are also easy to scale using several servers.</p>
<h1>Nginx mod_rewrite</h1>
<p>One drawback I've found after move is that <strong>.htaccess files are not supported</strong> in the way Apache does. To overcome this .htaccess configuration has to be converted into Nginx comliant configuration and inserted into directly into Nginx main config.</p>
<p>I've found nice converter that can help to do this</p>
<p><a href="http://www.anilcetin.com/convert-apache-htaccess-to-nginx/">http://www.anilcetin.com/convert-apache-htaccess-to-nginx/</a></p>
<h1>Links</h1>
<ul>
<li><a href="http://codex.wordpress.org/Nginx">http://codex.wordpress.org/Nginx</a></li>
<li><a href="http://wordpress.org/extend/plugins/nginx-compatibility/">http://wordpress.org/extend/plugins/nginx-compatibility/</a></li>
<li><a href="http://www.thelinuxgeeks.info/howto-install-nginx-php-cgi-on-ubuntu/">http://www.thelinuxgeeks.info/howto-install-nginx-php-cgi-on-ubuntu/</a></li>
</ul>
<pre></pre>
<pre></pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2011/11/nginx-php5-fpm-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recompile linux kernel on vacation</title>
		<link>http://a32.me/2011/10/recompile-linux-kernel-on-vacation/</link>
		<comments>http://a32.me/2011/10/recompile-linux-kernel-on-vacation/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 11:32:56 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://a32.me/?p=1856</guid>
		<description><![CDATA[Sweetheart, just because you can recompile the server's Linux kernel from here doesn't mean you should]]></description>
			<content:encoded><![CDATA[<h3><a href="http://a32.me/wp-content/uploads/2011/10/recompile_linux_on_vacation.png"><img class="alignleft" title="recompile_linux_on_vacation" src="http://a32.me/wp-content/uploads/2011/10/recompile_linux_on_vacation.png" alt="" width="86" height="95" /></a>Sweetheart, just because you <span style="text-decoration: underline;">can</span> recompile the server's Linux kernel from here doesn't mean you <span style="text-decoration: underline;">should</span> <img src='http://a32.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </h3>
<p><span id="more-1856"></span></p>
<p><a href="http://a32.me/wp-content/uploads/2011/10/recompile_linux_on_vacation.png"><img class="aligncenter size-full wp-image-1857" title="recompile_linux_on_vacation" src="http://a32.me/wp-content/uploads/2011/10/recompile_linux_on_vacation.png" alt="" width="500" height="550" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2011/10/recompile-linux-kernel-on-vacation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the cloud &#8211; how to use</title>
		<link>http://a32.me/2011/06/what-is-the-cloud-how-to-use/</link>
		<comments>http://a32.me/2011/06/what-is-the-cloud-how-to-use/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 08:17:22 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://a32.me/?p=1352</guid>
		<description><![CDATA[The word "cloud" became a buzz-word quite a while and Google search results for the word cloud is far away from real clouds in the sky. Although, many people and even web developers are quite away from understanding of what cloud is, how it works and how to take an advantage by using it. So clouds are really "cloudy". [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://a32.me/wp-content/uploads/2011/06/cloud.jpg"><img class="alignleft size-thumbnail wp-image-1384" title="cloud" src="http://a32.me/wp-content/uploads/2011/06/cloud-150x150.jpg" alt="" width="105" height="105" /></a>The word "cloud" became a buzz-word quite a while and Google search results for the word <strong>cloud</strong> is far away from real clouds in the sky. Although, many people and even web developers are quite away from understanding of what cloud is, how it works and how to take an advantage by using it. So clouds are really "cloudy".</p>
<p>Being a web developer this topic is in area of my interests for some time, but I always thought that clouds are for really big players. By big I assume million of clients, billions of page loads, terabytes of data, etc.. My mistake!</p>
<p>Recently I came across with <strong>Rackspace cloud</strong> and understood how wrong I was. It changed my understanding  into more practical way and I gave up my VPS and moved to the cloud.</p>
<p><span id="more-1352"></span></p>
<h2>What is the cloud</h2>
<p>Cloud is something where I can put all my data and my code and it will work somehow, by definition :) In real life <strong>cloud is a hosting</strong>, thats it. It looks and acts like a VPS hosting.</p>
<p>The major differences are described below:</p>
<h3>Quick spin up</h3>
<p><strong><span style="font-weight: normal;"><strong> </strong>You may remeber your first purchase of  VPS hosting service. It took about 24 hours to get your new instance working. In cloud it is a little different. All you need is to enter your admin panel and order new server. You may choose CPU, RAM, HD space and operating system (10+ Linux distribution or windows OS). In minutes your server is ready to use and you may login with SSH and start your business. </span></strong></p>
<p>Either you need new server for new project or just for testing purposes or your load increased, it is easy to create and delete servers in a minutes.</p>
<h3>Scale to meed demands</h3>
<p>Need a bigger server? Hit the upgrade button and re-size your server instantly with more RAM, CPU and space. Useful for increased load, there is no work for migration.</p>
<h3>Pay as you go</h3>
<p>In case creating and deleting servers is an easy task it also means it is impossible to take money per month per sever. In the cloud there is a different approach: <strong>pay per second.</strong> You pay only for time your server is UP and running. In case new server is needed just for couple of days, you will be charged for that couple of days.</p>
<h3>API</h3>
<p>All cloud providers has Application Programmable Interface (API). This means simple thing, all actions which can be made though admin panel can be made by automatically by program. This adds great scalability for application. Here is the case: your  project is very successful and is aimed to North America continent customers. Usually during a day it has activity peak for 8 hours, but for rest 16 hours it is almost idle. Using Cloud API it is simple to spin up additional servers by cron task to handle peak load and kill them after. This saves money.</p>
<h3>Load balancer</h3>
<p>Load balancer is a simple box which balances or distributes traffic directed to one IP address to many server.</p>
<p><a href="http://a32.me/wp-content/uploads/2011/06/illustration_LoadBalancing.jpg"><img class="size-full wp-image-1375 alignnone" title="illustration_LoadBalancing" src="http://a32.me/wp-content/uploads/2011/06/illustration_LoadBalancing.jpg" alt="" width="581" height="243" /></a></p>
<p>Each new connection is redirected to another server, this way it spreads site load on many server. Once one server is not enough to handle all user visits and page views it is easy to add more and more servers behind load balancer. One can be setup through admin panel in a minutes.</p>
<h3>CDN</h3>
<p>Content Delivery Network - some sort of storage which can survive with high traffic content. It is up to cloud provider how they do it. Your duty is to upload your high traffic content like site images, user pictures, downloadable files to some cloud area and this content is always available  at high speed to all world locations.</p>
<h2>My experience</h2>
<p>I have rented VPS for a long time, it was cheap one, slow one. About a month ago I discovered <strong>Rackspace Cloud</strong> server, which conquered me with its speed, support and most important the price. Price entry to <strong>Rackspace Cloud</strong> is low comparing to other services.</p>
<p>Cheapest server with 256MB of RAM, 10GB of space is just 1.5¢/per hour that is about <strong>11$/mth</strong> with great performance.</p>
<p><strong>Highly recommended</strong></p>
<p><a href="http://www.rackspacecloud.com/2436-0-1-29.html" target="_blank"><img src="http://affiliates.rackspacecloud.com/banners/linux-336x280.png" alt="Linux Servers on the Cloud IN MINUTES" width="336" height="280" border="0" /></a><br />
cloud tech <a>move to the <strong>cloud </strong></a><strong><a>whats the <strong>cloud</strong></a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2011/06/what-is-the-cloud-how-to-use/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hardening linux server</title>
		<link>http://a32.me/2011/05/hardening-linux-server/</link>
		<comments>http://a32.me/2011/05/hardening-linux-server/#comments</comments>
		<pubDate>Sun, 22 May 2011 21:00:34 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://a32.me/?p=1069</guid>
		<description><![CDATA[If you consider yourself as Linux administrator this post might be useful for you. NSA published some nice papers with hardening Linux servers recommendations. NSA - National Security Agency - organization that is trusted. Latest version of 200 hundred pages guide in PDF for securing configuration of RHEL5. A very detailed manual, explaining general principles of secure [...]]]></description>
			<content:encoded><![CDATA[<p>If you consider yourself as Linux administrator this post might be useful for you. NSA published some nice papers with hardening Linux servers recommendations. NSA - National Security Agency - organization that is trusted. Latest version of 200 hundred pages guide in PDF for securing configuration of RHEL5. A very detailed manual, explaining general principles of secure system, including all necessary system changes, service configuration, network security, firewall, etc..</p>
<p><span id="more-1069"></span> <a href="http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf"></a></p>
<p>A must have thing for every admin. If you are Debian or Ubuntu admin it still worth reading, since principles stays the same and there is no much real difference in security between RHEL and Ubuntu.</p>
<p><a href="http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf">Link to RHEL5 secure guide NSA site</a> (<a href="http://a32.me/wp-content/uploads/2012/05/rhel5-guide-i731.pdf">local copy</a>)</p>
<p><a href="http://www.nsa.gov/ia/_files/factsheets/rhel5-pamphlet-i731.pdf">Quick one A4 page pamphlet </a> (<a href="http://a32.me/wp-content/uploads/2012/05/rhel5-pamphlet-i731.pdf">local copy</a>)</p>
<p>Besides RHEL, there are many guides for <a href="http://www.nsa.gov/ia/guidance/security_configuration_guides/operating_systems.shtml">other OSes</a> as well</p>
<ul>
<li><a href="http://www.nsa.gov/applications/links/notices.cfm?address=http://images.apple.com/support/security/guides/docs/SnowLeopard_Security_Config_v10.6.pdf">Secure configuration of Mac OS X 10.6 Snow Leopard</a> (October 2010)</li>
<li><a href="http://www.nsa.gov/applications/links/notices.cfm?address=http://images.apple.com/support/security/guides/docs/Leopard_Security_Config_2nd_Ed.pdf">Secure configuration of Mac OS X 10.5 Leopard</a> (March 2009)</li>
<li><a href="http://www.nsa.gov/ia/_files/os/win2k/Application_Whitelisting_Using_SRP.pdf">Using of Software Restriction Policies (SRP) in Windows</a> (March 2011)</li>
<li><a href="http://www.nsa.gov/ia/_files/os/win7/win7_security_highlights.pdf">Security highlights in Windows 7</a> (May 2011)</li>
<li><a href="http://www.nsa.gov/ia/_files/os/winvista/Windows%20Vista%20Security%20Guide.msi">Windows Vista security guide</a> (March 2009)</li>
</ul>
<p><strong>Additional:</strong></p>
<p><a href="http://www.securenetwork.it/ricerca/whitepaper/download/Debian-Ubuntu_hardening_guide.pdf">Debian and Ubuntu security guide</a> (<a href="http://a32.me/wp-content/uploads/2012/05/Debian-Ubuntu_hardening_guide.pdf">local copy</a>)</p>
<p>.</p>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2011/05/hardening-linux-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ping monitoring</title>
		<link>http://a32.me/2010/02/ping-monitoring/</link>
		<comments>http://a32.me/2010/02/ping-monitoring/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 09:50:13 +0000</pubDate>
		<dc:creator>Constantin Bosneaga</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://a32.me/?p=403</guid>
		<description><![CDATA[While searching for simple DSL line monitoring tool I found nothing really simple and decent. My goal is to hunt down internet connectivity instability. Since I have linux box inside, it is very easy to achieve. Put this script into cron to run at each hour and you will get history for your connection. #!/bin/sh [...]]]></description>
			<content:encoded><![CDATA[<p>While searching for simple DSL line monitoring tool I found nothing really simple and decent. My goal is to hunt down internet connectivity instability. Since I have linux box inside, it is very easy to achieve.</p>
<p><span id="more-403"></span>Put this script into cron to run at each hour and you will get history for your connection.</p>
<pre>#!/bin/sh

dir=/var/log/ping/`date +%Y.%m.%d`
fn=`date +%H.00`

mkdir -p $dir

# Ping gateway and google dns for 1 hour
ping -c 3601 -i 1 [GW_IP] &gt; $dir/$fn.gw&amp;
ping -c 3601 -i 1 8.8.8.8 &gt; $dir/$fn.gog&amp;

# Wait for pings to finish
wait

# Gzip final files
gzip $dir/$fn.gw
gzip $dir/$fn.gog

# Clean up old files for 3 month
find /var/log/ping/ -type f -mtime +90 -exec rm {} \;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://a32.me/2010/02/ping-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

