<?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>Ivan Kuznetsov &#187; Linux</title>
	<atom:link href="http://www.ivankuznetsov.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ivankuznetsov.com</link>
	<description>Entrepreneur, Ruby on Rails and Ubuntu fanatic, consultant</description>
	<lastBuildDate>Tue, 18 May 2010 18:39:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Running Rails applications using Nginx with Passenger on Ubuntu Server</title>
		<link>http://www.ivankuznetsov.com/2010/05/running-rails-applications-using-nginx-with-passenger-on-ubuntu-server.html</link>
		<comments>http://www.ivankuznetsov.com/2010/05/running-rails-applications-using-nginx-with-passenger-on-ubuntu-server.html#comments</comments>
		<pubDate>Fri, 14 May 2010 10:40:50 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web/Tech]]></category>
		<category><![CDATA[mod_rails]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=279</guid>
		<description><![CDATA[If you&#8217;re planning to run Rails applications on Nginx using Phusion Passenger, and do it on Ubuntu Linux, here&#8217;s what needs to be done. Even though there&#8217;s Ubuntu nginx package available (which works perfectly when you&#8217;re running PHP apps using FCGI), if you want to take into use Phusion Passenger, you&#8217;ll need to recompile Nginx [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ivankuznetsov.com/wp-content/uploads/enterprise_logo.png"><img class="alignleft size-full wp-image-281" title="enterprise_logo" src="http://www.ivankuznetsov.com/wp-content/uploads/enterprise_logo.png" alt="" width="261" height="68" /></a>If you&#8217;re planning to run <a href="http://rubyonrails.org/" target="_blank">Rails</a> applications on <a href="http://www.nginx.org" target="_blank">Nginx</a> using <a href="http://www.modrails.com/" target="_blank">Phusion Passenger</a>, and do it on <a href="http://www.ubuntu.com" target="_blank">Ubuntu</a> Linux, here&#8217;s what needs to be done.</p>
<p>Even though there&#8217;s Ubuntu nginx package available (which works perfectly when you&#8217;re running <a href="http://www.ivankuznetsov.com/2010/05/moving-joomla-wordpress-and-other-phpfastcgi-apps-to-nginx.html">PHP apps using FCGI</a>), if you want to take into use Phusion Passenger, you&#8217;ll need to recompile Nginx from sources.</p>
<p>Instructions below were verified on Ubuntu 10.04 (Lucid Lynx) Server Edition.</p>
<p><span id="more-279"></span></p>
<p>If you already have Nginx ubuntu package installed, uninstall it (NOTE! purge will delete all configuration files &#8211; so if you changed them &#8211; make a backup for future reference):</p>
<pre>sudo aptitude purge nginx</pre>
<p>Assuming you already have Rails stack installed, install Passenger gem:</p>
<pre>sudo gem install passenger</pre>
<p>At the time of this writing the latest version of Passenger is 2.2.11</p>
<p>Let&#8217;s check dependencies that Ubuntu nginx package has and install them before compilation:</p>
<pre>aptitude show nginx | grep Depends</pre>
<div>You&#8217;ll see something like:</div>
<pre>Depends: libc6 (&gt;= 2.4), libpcre3 (&gt;= 7.7), libssl0.9.8 (&gt;= 0.9.8k-1), zlib1g</pre>
<div>Install build dependencies and start nginx module installation (it will offer you to recompile nginx)</div>
<pre>sudo apt-get install libc6 libpcre3 libssl0.9.8 zlib1g
sudo /usr/local/bin/passenger-install-nginx-module</pre>
<div>Choose option 1 (Yes: download, compile and install Nginx for me) unless you need special configuration parameters or need features not enabled by default (like SSL).</div>
<div>Further instructions assume that you also chose default installation directory /opt/nginx.</div>
<div>If you&#8217;ve purchased Passenger Enterprise Edition, don&#8217;t forget to register it:</div>
<pre>sudo /usr/local/bin/passenger-make-enterprisey</pre>
<div>Now add nginx init script (I just copied this from Ubuntu default nginx package):</div>
<pre>sudo vim /etc/init.d/nginx</pre>
<div>with the following content:</div>
<pre>#! /bin/sh

### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/nginx/sbin
DAEMON=/opt/nginx/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
        . /etc/default/nginx
fi

set -e

. /lib/lsb/init-functions

test_nginx_config() {
  if nginx -t $DAEMON_OPTS
  then
    return 0
  else
    return $?
  fi
}

case "$1" in
  start)
        echo -n "Starting $DESC: "
        test_nginx_config
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON -- $DAEMON_OPTS || true
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON || true
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile \
                /var/run/$NAME.pid --exec $DAEMON || true
        sleep 1
        test_nginx_config
        start-stop-daemon --start --quiet --pidfile \
                /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
        echo "$NAME."
        ;;
  reload)
        echo -n "Reloading $DESC configuration: "
        test_nginx_config
        start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid \
            --exec $DAEMON || true
        echo "$NAME."
        ;;
  configtest)
        echo -n "Testing $DESC configuration: "
        if test_nginx_config
        then
          echo "$NAME."
        else
          exit $?
        fi
        ;;
  status)
        status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx &amp;&amp; exit 0 || exit $?
        ;;
  *)
        echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest}" &gt;&amp;2
        exit 1
        ;;
esac

exit 0</pre>
<div>Now make this script executable add it to default run levels:</div>
<pre>sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults</pre>
<div>Edit  nginx.conf to look like this:</div>
<pre>user www-data;
worker_processes  4;

error_log  /opt/nginx/logs/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  8192;
    use epoll;
}

http {
    passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11;
    passenger_ruby /usr/local/bin/ruby;

    include       /opt/nginx/conf/mime.types;

    # set a default type for the rare situation that
    # nothing matches from the mimie-type include
    default_type application/octet-stream;

    # This log format is compatible with any tool like awstats
    # that can parse standard apache logs.
    log_format main '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"' ;

    access_log  /opt/nginx/logs/access.log;

    sendfile        on;
    tcp_nopush     on;

    keepalive_timeout  0;
    tcp_nodelay        on;

    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    include /opt/nginx/conf/sites-enabled/*;
}</pre>
<div>Now create virtual hosts structure (so that it looks like the structure created by Ubuntu original nginx package):</div>
<div>
<pre>sudo mkdir /opt/nginx/conf/sites-available
sudo mkdir /opt/nginx/conf/sites-enabled</pre>
</div>
<div>Now it is time to configure your first rails site. Create virtual host configuration in sites-available.</div>
<pre>sudo vim /opt/nginx/conf/sites-available/mysite.com</pre>
<div>Content can be something like:</div>
<pre>server {
        listen   80;
        server_name  www.mysite.com;

        access_log  /home/user/logs/www.mysite.com/access.log;
        root   /home/user/www.mysite.com/public;

        # serve static content directly
        location ~* \.(ico|jpg|gif|png|css|js|swf|html)$ {
          if (-f $request_filename) {
            expires max;
            break;
          }
        }

        passenger_enabled on;

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
          deny  all;
        }
}</pre>
<div>Make a symlink in sites-enabled directory and restart nginx.</div>
<pre>sudo ln -s /opt/nginx/conf/sites-available/mysite.com /opt/nginx/conf/sites-enabled/mysite.com
sudo /etc/init.d/nginx restart</pre>
<div>Now open the browser and check that your site is working.</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2010%2F05%2Frunning-rails-applications-using-nginx-with-passenger-on-ubuntu-server.html&amp;linkname=Running%20Rails%20applications%20using%20Nginx%20with%20Passenger%20on%20Ubuntu%20Server"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2010/05/running-rails-applications-using-nginx-with-passenger-on-ubuntu-server.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving Joomla, WordPress and other PHP/FastCGI apps to Nginx</title>
		<link>http://www.ivankuznetsov.com/2010/05/moving-joomla-wordpress-and-other-phpfastcgi-apps-to-nginx.html</link>
		<comments>http://www.ivankuznetsov.com/2010/05/moving-joomla-wordpress-and-other-phpfastcgi-apps-to-nginx.html#comments</comments>
		<pubDate>Fri, 14 May 2010 07:01:50 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web/Tech]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[fast-cgi]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=272</guid>
		<description><![CDATA[Have you moved your site from Apache to Nginx and now your FastCGI (php-cgi/spawn-fcgi) processes die/hang/crash periodically and your users see &#8220;HTTP 502 Bad gateway&#8221; or &#8220;HTTP 504 Gateway timeout&#8221; instead of a website? I have faced this problem and found a relatively simple and robust solution. Here&#8217;s how I did it on Ubuntu 9.10 (Karmic [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ivankuznetsov.com/wp-content/uploads/nginx-logo.png"><img class="alignleft size-full wp-image-273" title="nginx-logo" src="http://www.ivankuznetsov.com/wp-content/uploads/nginx-logo.png" alt="" width="350" height="90" /></a>Have you moved your site from <a href="http://apache.org/" target="_blank">Apache</a> to <a href="http://nginx.org/" target="_blank">Nginx</a> and now your FastCGI (php-cgi/spawn-fcgi) processes die/hang/crash periodically and your users see &#8220;HTTP 502 Bad gateway&#8221; or &#8220;HTTP 504 Gateway timeout&#8221; instead of a website?</p>
<p>I have faced this problem and found a relatively simple and robust solution. Here&#8217;s how I did it on Ubuntu 9.10 (Karmic Koala) and 10.04 (Lucid Lynx) server edition.</p>
<p><span id="more-272"></span>Solution was to replace default FastCGI implementation with <a href="http://php-fpm.org/" target="_blank">PHP-FPM</a> (FastCGI Process Manager). PHP-FPM is not supported in PHP out of the box &#8211; so if you use PHP 5.2.*, you&#8217;ll need to apply a patch and recompile PHP, and if you&#8217;re using PHP 5.3.* (at least in 5.3.2 PHP-FPM is not yet in the core) &#8211; you&#8217;ll need to check out PHP-FPM from PHP SVN.</p>
<p>Let&#8217;s start with uninstalling default Ubuntu php packages:</p>
<pre>sudo apt-get remove php5*</pre>
<p>Now we need to install dependencies. Note, that Ubuntu comes with a new autoconf tool version, which is <a href="https://bugs.launchpad.net/ubuntu/+source/php5/+bug/411890" target="_blank">not compatible</a> with PHP, that&#8217;s why for successful compilation you need to temporarily install autoconf2.13 package.</p>
<pre>sudo apt-get install libcurl4-openssl-dev libmcrypt-dev libxml2-dev libpng-dev 
autoconf2.13 libevent-dev libltdl-dev</pre>
<p>Download latest stable PHP 5.2.13, Suhosin patch, PHP-FPM patch</p>
<pre>cd ~/tmp
wget <a href="http://pl2.php.net/get/php-5.2.13.tar.gz/from/pl.php.net/mirror">http://pl2.php.net/get/php-5.2.13.tar.gz/from/pl.php.net/mirror</a>
wget <a href="http://download.suhosin.org/suhosin-patch-5.2.13-0.9.7.patch.gz">http://download.suhosin.org/suhosin-patch-5.2.13-0.9.7.patch.gz</a>
wget <a href="http://php-fpm.org/downloads/php-5.2.13-fpm-0.5.13.diff.gz">http://php-fpm.org/downloads/php-5.2.13-fpm-0.5.13.diff.gz</a>
tar xvzf php-5.2.13.tar.gz
gunzip suhosin-patch-5.2.13-0.9.7.patch.gz
gunzip php-5.2.13-fpm-0.5.13.diff.gz
cd php-5.2.13
patch -p 1 -i ../php-5.2.13-fpm-0.5.13.diff
patch -p 1 -i ../suhosin-patch-5.2.13-0.9.7.patch
./buildconf --force
./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --with-openssl
--with-mysql --with-mysql-sock --with-gd --without-sqlite --disable-pdo
make
make test
sudo make install</pre>
<p>Alternatively you can download latest stable PHP 5.3.2, Suhosin patch, apply PHP-FPM patch. Note, that not all PHP based projects and plugins work correctly with new PHP 5.3 &#8211; it is not backwards compatible with PHP 5.2. I had troubles at least with some Joomla plugins and ZenCart.</p>
<pre>cd ~/tmp
<a href="http://fi.php.net/get/php-5.3.2.tar.gz/from/this/mirror">http://fi.php.net/get/php-5.3.2.tar.gz/from/this/mirror</a>
wget <a href="http://download.suhosin.org/suhosin-patch-5.3.2-0.9.9.1.patch.gz">http://download.suhosin.org/suhosin-patch-5.3.2-0.9.9.1.patch.gz</a>
tar xvzf php-5.3.2.tar.gz
gunzip suhosin-patch-5.3.2-0.9.9.1.patch.gz
cd php-5.3.2
patch -p 1 -i ../suhosin-patch-5.3.2-0.9.9.1.patch
svn co <a href="http://svn.php.net/repository/php/php-src/trunk/sapi/fpm">http://svn.php.net/repository/php/php-src/trunk/sapi/fpm</a> sapi/fpm
./buildconf --force
./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --with-openssl
--with-mysql --with-mysql-sock --with-gd --without-sqlite --disable-pdo --disable-reflection
make
make test
sudo make install</pre>
<p>Uninstall autoconf2.13 after compilation.</p>
<pre>sudo apt-get remove autoconf2.13</pre>
<p>Change user and group of php-fpm processes to user and group of your choice (e.g. www-data and www-data) &#8211; lines 63 and 66</p>
<pre>sudo vim /usr/local/etc/php-fpm.conf</pre>
<p>Edit PHP settings</p>
<pre>sudo vim /etc/php5/cgi/php.ini (in Ubuntu 9.xx)</pre>
<pre>sudo vim /etc/php5/apache2/php.ini (in Ubuntu 10.04)</pre>
<p>Set:</p>
<pre>max_execution_time = 30
memory_limit = 128M
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
register_globals = Off</pre>
<p>Now if you haven&#8217;t done so yet, install Nginx. Ubuntu 10.04 comes with the latest stable Nginx 0.7.65, so just do:</p>
<pre>sudo apt-get install nginx</pre>
<p>Now you can congifure your sites, e.g. for WordPress Nginx configuration can look like this:</p>
<pre>server {
        listen   80;
        server_name  blog.mysite.com;

        access_log  /home/user/logs/blog.mysite.com/access.log;

        location / {
          root   /home/user/blog.mysite.com;
          index  index.php index.html index.htm;

          # this serves static files that exist without running other rewrite tests
          if (-f $request_filename) {
              expires 30d;
              break;
          }

          # this sends all non-existing file or directory requests to index.php
          if (!-e $request_filename) {
              rewrite ^(.+)$ /index.php?q=$1 last;
          }

        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
          include /etc/nginx/fastcgi_params;
          fastcgi_pass  127.0.0.1:9000;
          fastcgi_index index.php;
          fastcgi_param  SCRIPT_FILENAME  /home/user/blog.mysite.com/$fastcgi_script_name;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
          deny  all;
        }
}</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2010%2F05%2Fmoving-joomla-wordpress-and-other-phpfastcgi-apps-to-nginx.html&amp;linkname=Moving%20Joomla%2C%20WordPress%20and%20other%20PHP%2FFastCGI%20apps%20to%20Nginx"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2010/05/moving-joomla-wordpress-and-other-phpfastcgi-apps-to-nginx.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting up your own git server on Ubuntu</title>
		<link>http://www.ivankuznetsov.com/2010/05/setting-up-your-own-git-server-on-ubuntu.html</link>
		<comments>http://www.ivankuznetsov.com/2010/05/setting-up-your-own-git-server-on-ubuntu.html#comments</comments>
		<pubDate>Thu, 13 May 2010 12:39:00 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[gitosis]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=262</guid>
		<description><![CDATA[This will create a new user &#8216;gitosis&#8217; and prepare a structure for repositories in /srv/gitosis. Now let&#8217;s initialize a gitosis-admin repo &#8211; it is used for managing repositories and access Of course there&#8217;s always an option to use github. And if you&#8217;re working on an open source project, or want to concentrate on coding and [...]]]></description>
			<content:encoded><![CDATA[<p>This will create a new user &#8216;gitosis&#8217; and prepare a structure for repositories in /srv/gitosis. Now let&#8217;s initialize a gitosis-admin repo &#8211; it is used for managing repositories and access<img class="alignleft size-full wp-image-261" title="git-logo" src="http://www.ivankuznetsov.com/wp-content/uploads/git-logo.png" alt="" width="97" height="188" /></p>
<p>Of course there&#8217;s always an option to use <a href="http://www.github.com" target="_blank">github</a>. And if you&#8217;re working on an open source project, or want to concentrate on coding and not system administration, github is a lot better option than setting up and managing your own git server (I&#8217;ve been so impressed by <a href="http://twitter.com/defunkt" target="_blank">@defunkt</a>&#8216;s presentation on <a href="http://www.frozenrails.eu" target="_blank">#frozenrails</a>, that started recommending github to everyone <img src='http://www.ivankuznetsov.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But if you already pay for a virtual machine somewhere (like <a href="http://www.linode.com" target="_blank">Linode</a>), then setting up your own git server might be a viable option, especially that it is sooo easy.</p>
<p>The following instructions have been verified on Ubuntu 10.04 Lucid Lynx, but should work at least on Ubuntu 9.04 and 9.10 just as well.</p>
<p><span id="more-262"></span></p>
<p>Let&#8217;s start with installing gitosis itself. Issue the following command on the server:</p>
<pre>sudo apt-get install gitosis</pre>
<p>This will create a new user &#8216;gitosis&#8217; and prepare a structure for repositories in /srv/gitosis. Now let&#8217;s initialize a gitosis-admin repo &#8211; it is used for managing repositories and access rights.</p>
<pre>sudo -H -u gitosis gitosis-init &lt; ~/tmp/my_public.key</pre>
<p>You need to have a public key for accessing it. If you don&#8217;t have one yet, you can use</p>
<pre><code>ssh-keygen -t rsa</code></pre>
<p>command on your local machine to generate public/private key pair. Copy public key to the server before initializing gitosis-admin repository.</p>
<p>Now with gitosis-admin repo initialized on the server &#8211; let&#8217;s clone it to the local computer.</p>
<pre>git clone gitosis@myserver.com:gitosis-admin.git</pre>
<p>If you see an error like:</p>
<pre>Permission denied (publickey).
fatal: The remote end hung up unexpectedly</pre>
<p>That is most likely because you restricted access to you server via ssh to only certain users, and gitosis is not one of them. Edit /etc/ssh/sshd_config, find AllowUsers line and add gitosis to the list.</p>
<p>Now that you have successfully cloned gitosis-admin repo to your local computer, you can add  new users and new repositories.</p>
<p>To add new repository, edit gitosis.conf and add lines like:</p>
<pre>[group myrepo]
writable = myrepo
members = user@computer</pre>
<p>After that commit and push the changes to gitosis-admin project:</p>
<pre>git commit -a -m "Added myrepo repository"</pre>
<p>Now you can clone this new repository to your local machine (note .git added to the name of the repository):</p>
<pre>git clone gitosis@mygitserver.com:myrepo.git</pre>
<p>To allow new user to access your repository, get this user&#8217;s public key, copy it to gitosis-admin/keydir as newuser@computer.pub, then edit gitosis.conf and add newuser@computer (without .pub) to the list of members:</p>
<pre>[group myrepo]
writable = myrepo
members = user@computer newuser@computer</pre>
<p>Now add new files and commit and push changes to git server (make sure you really add all files and don&#8217;t forget to push &#8211; these are quite common mistakes when adding new users).</p>
<pre>git add .
git commit -m "Added user newuser"
git push</pre>
<p>With a freshly cloned empty repository you&#8217;ll need to add you first files, do a commit and push origin master:</p>
<pre>vim README.txt
git commit -a -m "Added readme"
git push origin master</pre>
<p>Now you can git pull and git push as much as you like.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2010%2F05%2Fsetting-up-your-own-git-server-on-ubuntu.html&amp;linkname=Setting%20up%20your%20own%20git%20server%20on%20Ubuntu"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2010/05/setting-up-your-own-git-server-on-ubuntu.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>No space left on device &#8211; running out of Inodes</title>
		<link>http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html</link>
		<comments>http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:12:56 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[file system]]></category>
		<category><![CDATA[Inode]]></category>
		<category><![CDATA[no space left]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=238</guid>
		<description><![CDATA[One of our development servers went down today. Problems started with deployment script that claimed that claimed &#8220;No space left on device&#8221;, although partition was not nearly full. If you ever run into such trouble &#8211; most likely you have too many small or 0-sized files on your disk, and while you have enough disk [...]]]></description>
			<content:encoded><![CDATA[<p>One of our development servers went down today. Problems started with deployment script that claimed that claimed &#8220;No space left on device&#8221;, although partition was not nearly full. If you ever run into such trouble &#8211; most likely you have too many small or 0-sized files on your disk, and while you have enough disk space, you have exhausted all available <a href="http://www.linfo.org/inode.html" target="_blank">Inodes</a>. Below is the solution for this problem.</p>
<p><span id="more-238"></span></p>
<p>1. check available disk space to ensure that you still have some</p>
<pre style="padding-left: 30px;">$ df

<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">Filesystem           1K-blocks      Used Available Use% Mounted on</span>
/dev/xvda             33030016  10407780  22622236  32% /
tmpfs                   368748         0    368748   0% /lib/init/rw
varrun                  368748        56    368692   1% /var/run
varlock                 368748         0    368748   0% /var/lock
udev                    368748       108    368640   1% /dev
tmpfs                   368748         0    368748   0% /dev/shm</pre>
<p>2. check available Inodes</p>
<pre style="padding-left: 30px;">$ df -i

<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">Filesystem            Inodes   IUsed   IFree IUse% Mounted on</span>
/dev/xvda            2080768 2080768       0  100% /
tmpfs                  92187       3   92184    1% /lib/init/rw
varrun                 92187      38   92149    1% /var/run
varlock                92187       4   92183    1% /var/lock
udev                   92187    4404   87783    5% /dev
tmpfs                  92187       1   92186    1% /dev/shm</pre>
<div>If you have IUse% at 100 or near, then huge number of small files is the reason for &#8220;No space left on device&#8221; errors.</div>
<p>3. find those little bastards</p>
<pre style="padding-left: 30px;">$ for i in /*; do echo $i; find $i |wc -l; done</pre>
<p>This command will list directories and number of files in them. Once you see a directory with unusually high number of files (or command just hangs over calculation for a long time), repeat the command for that directory to see where exactly the small files are.</p>
<pre style="padding-left: 30px;">$ for i in /home/*; do echo $i; find $i |wc -l; done</pre>
<p>4. once you found the suspect &#8211; just delete the files</p>
<pre style="padding-left: 30px;">$ sudo rm -rf /home/bad_user/directory_with_lots_of_empty_files</pre>
<p>You&#8217;re done. Check the results with df -i command again. You should see something like this:</p>
<pre style="padding-left: 30px;">Filesystem            Inodes   IUsed   IFree IUse% Mounted on

/dev/xvda            2080768  284431 1796337   14% /
tmpfs                  92187       3   92184    1% /lib/init/rw
varrun                 92187      38   92149    1% /var/run
varlock                92187       4   92183    1% /var/lock
udev                   92187    4404   87783    5% /dev
tmpfs                  92187       1   92186    1% /dev/shm</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2010%2F02%2Fno-space-left-on-device-running-out-of-inodes.html&amp;linkname=No%20space%20left%20on%20device%20%26%238211%3B%20running%20out%20of%20Inodes"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrading iPhone firmware using VMWare and Ubuntu 9.04</title>
		<link>http://www.ivankuznetsov.com/2009/10/upgrading-iphone-firmware-using-vmware-and-ubuntu-9-04.html</link>
		<comments>http://www.ivankuznetsov.com/2009/10/upgrading-iphone-firmware-using-vmware-and-ubuntu-9-04.html#comments</comments>
		<pubDate>Wed, 14 Oct 2009 07:35:10 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=210</guid>
		<description><![CDATA[This was the second time I upgrade firmware on my iPhone, and second time I ran into the same problem.  In the middle of the update iTunes reports &#8220;Unknown error&#8221; and iPhone dies (well, goes into recovery mode, but it is not much help). If that happened to you, don&#8217;t panic! To make this geeky [...]]]></description>
			<content:encoded><![CDATA[<p>This was the second time I upgrade firmware on my iPhone, and second time I ran into the same problem.  In the middle of the update iTunes reports &#8220;Unknown error&#8221; and iPhone dies (well, goes into recovery mode, but it is not much help). If that happened to you, don&#8217;t panic! To make this geeky combination (Ubuntu 9.04, VMware, iTunes and iPhone software update) work, there&#8217;s a little trick you need to do.<span id="more-210"></span>My setup:</p>
<p>- iPhone 3G 8Gb Sonera<br />
- Ubuntu Linux 9.04 (Jaunty) on Lenovo T61 laptop, kernel 2.6.28-15<br />
- VMware player 2.5.3<br />
- guest OS: WinXP Home SP3 with iTunes 9.0.1.8</p>
<p>goal: upgrading firmware to 3.1.2</p>
<p>I used instructions on <a href="http://freshfoo.com/blog/iphone_upgrade_with_vmware" target="_blank">Menno Smits&#8217; blog</a>. Here&#8217;s the summary:</p>
<p>1. Create a file /etc/modprobe.d/blacklist-usb</p>
<blockquote><p>sudo vim /etc/modprobe.d/blacklist-usb</p></blockquote>
<p>2. Add usb modules not to be loaded into that file</p>
<blockquote><p>blacklist snd_usb_audio<br />
blacklist usbhid</p></blockquote>
<p>I didn&#8217;t list ehci_hcd, and it still worked. By the way, USB HID stands for USB Human Interface Device, and blacklisting it might disable your USB mouse and keyboard as well. See a link in the end of the post how to work around it.</p>
<p>3. Unload blacklisted modules manually, in case if they have been loaded already</p>
<blockquote><p>sudo /sbin/modprobe -r snd_usb_audio<br />
sudo /sbin/modprobe -r usbhid</p></blockquote>
<p>4. Reload kernel event manager for the changes to take effect</p>
<blockquote><p>sudo /etc/init.t/udev reload</p></blockquote>
<p>5. Restart VMware and make sure you also restart Windows in VMware (it took me seveal attempts to figure that this was the problem)</p>
<p>6. Now start iPhone software update in iTunes or &#8220;restore and update&#8221;, if you already tried without disabling usbhid and got your iPhone into recovery mode.</p>
<p>7. After update is complete, remove the blacklist file and restart kernel event manager again</p>
<blockquote><p>sudo rm /etc/modprobe.d/blacklist-usb<br />
sudo /etc/init.t/udev reload</p></blockquote>
<p>If iTunes in WMware do not see iPhone, make sure that it is connected in VMware removable devices menu. Note that during firmware update iPhone might get disconnected &#8211; just connect it again using VMware removable devices menu.</p>
<p>I tried to verify suggestion from <a href="http://teknofire.net/articles/2009/01/08/using-linux-and-vmware-to-update-iphone-firmware/" target="_blank">Will</a> to disable only iPhone in ubuntu, using its USB ID, but don&#8217;t actually know if it worked, because I didn&#8217;t restart Windows in WMware and restore and update failed. Here&#8217;s what I did:</p>
<p>- connected iPhone and checked its USB ID:</p>
<blockquote><p>$ lsusb</p>
<p>Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 024: ID 05ac:1292 Apple, Inc.<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 004: ID 0a5c:2110 Broadcom Corp. Bluetooth Controller<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</p></blockquote>
<p>- created a file /etc/modprobe.d/usbhid</p>
<blockquote><p>sudo vim /etc/modprobe.d/usbhid</p></blockquote>
<p>with the following content</p>
<blockquote><p>options usbhid quirks=0×05ac:0×1292:0×04</p></blockquote>
<p>where 0&#215;1292 is the USB ID displayed by lsusb command, and 0&#215;04 is the instruction to ignore device with specified USB ID.</p>
<p>- did everything as isteps 1-7 except that I didn&#8217;t blacklist usbhid and didn&#8217;t unload it manually.</p>
<p>It would be interesting to know if anyone succeeds with iPhone firmware update on Ubuntu without blacklisting usbhid module completely.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2009%2F10%2Fupgrading-iphone-firmware-using-vmware-and-ubuntu-9-04.html&amp;linkname=Upgrading%20iPhone%20firmware%20using%20VMWare%20and%20Ubuntu%209.04"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2009/10/upgrading-iphone-firmware-using-vmware-and-ubuntu-9-04.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up Ruby, Rails, Git and Redmine on Dreamhost</title>
		<link>http://www.ivankuznetsov.com/2009/07/setting-up-ruby-rails-git-and-redmine-on-dreamhost.html</link>
		<comments>http://www.ivankuznetsov.com/2009/07/setting-up-ruby-rails-git-and-redmine-on-dreamhost.html#comments</comments>
		<pubDate>Thu, 30 Jul 2009 14:58:27 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web/Tech]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=195</guid>
		<description><![CDATA[The task is to have: - Redmine installation on redmine.mydomain.com - Several Git repositories on git.mydomain.com with different access rights to each one This proved to be a non-trivial task. There is a number of tutorials on the net, but none of them described the full solution. So after getting it all to work, I [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-196" title="Git, RedMine, Ruby, Rails on Dreamhost" src="http://www.ivankuznetsov.com/wp-content/uploads/git.png" alt="Git, RedMine, Ruby, Rails on Dreamhost" width="200" height="150" />The task is to have:<br />
- Redmine installation on redmine.mydomain.com<br />
- Several Git repositories on git.mydomain.com with different access rights to each one</p>
<p>This proved to be a non-trivial task. There is a number of tutorials on the net, but none of them described the full solution. So after getting it all to work, I decided to share all the tips and tricks. Feel free to comment, if you will find problems with the following set of instructions.<br />
<span id="more-195"></span>SSH to redmine.mydomain.com as a user that will be running Redmine (in the following examples it will be &#8216;redmine_user&#8217;).<br />
First, you need to compile openssl &#8211; it will be required for curl, git and redmine.</p>
<pre>mkdir ~/tmp
cd ~/tmp
wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz
tar xzvf openssl-0.9.8k.tar.gz
cd openssl-0.9.8k
./config shared zlib --prefix=$HOME/.packages
make
make install</pre>
<p>Let&#8217;s tell the world that we keep binaries and libraries also in the local directory. Edit ~/.bashrc (it is used by all non-login shells):</p>
<pre>export TZ='Europe/Helsinki'
export PATH="$HOME/.packages/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.packages/lib"
export GEM_HOME="$HOME/.gems"
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
export PATH="$HOME/.packages/bin:$HOME/.gems/bin:$PATH"
export RUBYLIB="$HOME/.packages/lib:$RUBYLIB"
export LD_LIBRARY_PATH="$HOME/.packages/lib"

# this ensures our gem install processes don't get killed by the DreamHost police
alias gem="nice -n19 ~/.packages/bin/gem"</pre>
<p>(You can skip TZ &#8211; it is just usefule to have correct time set for your environment. Use tzselect to find out correct TZ string for your region)</p>
<p>And edit ~/.bash_profile (it is used by login shells):</p>
<pre>umask 002
PS1='[\h:$PWD]$ '
alias ll="ls -l"
EDITOR="/usr/bin/vim"
. .bashrc</pre>
<p>Now let&#8217;s apply the changes in active shell:</p>
<pre>cd ~ : . .bash_profile</pre>
<p>Then you need to compile curl, to be able to compile git with curl and execute clone commands on your server.</p>
<pre>cd ~/tmp
wget http://curl.haxx.se/download/curl-7.19.5.tar.gz
tar xzvf curl-7.19.5.tar.gz
cd curl-7.19.5
./configure --prefix=$HOME/.packages --with-ssl=$HOME/.packages
make
make install</pre>
<p>Now get and compile Git. If you are not using Dreamhost PS, you might want to compile it with NO_MMPAP=1, to reduce<br />
probability of git process getting killed by Dreamhost police robots due to extensive memory</p>
<pre>cd ~/tmp
wget http://www.kernel.org/pub/software/scm/git/git-1.6.4.tar.gz
tar xzvf git-1.6.4.tar.gz
cd git-1.6.4
./configure --prefix=$HOME/.packages --with-curl=$HOME/.packages
make
make install</pre>
<p>Let&#8217;s start with ruby and rails related stuff. First readline library is needed, for script/console to work.</p>
<pre>cd ~/tmp
wget http://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
tar xzvf readline-5.2.tar.gz
cd readline-5.2
./configure --prefix=$HOME/.packages
make
make install</pre>
<p>Install ruby:</p>
<pre>cd ~/tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
tar zxvf ruby-1.8.7-p72.tar.gz
cd ruby-1.8.7-p72
./configure --prefix=$HOME/.packages --with-openssl-dir=$HOME/.packages --with-readline-dir=$HOME/.packages
make
make install</pre>
<p>Install rubygems:</p>
<pre>cd ~/tmp
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar zxvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb config --prefix=$HOME/.packages
ruby setup.rb setup
ruby setup.rb install</pre>
<p>Now you can install all required gems and freeze them if necessary.</p>
<p><strong>Installing RedMine</strong></p>
<p>Refer to <a href="http://wiki.dreamhost.com/Redmine" target="_blank">http://wiki.dreamhost.com/Redmine</a> for details.</p>
<p>But there&#8217;s one trick &#8211; if you want RedMine to use just compiled version of Git &#8211; edit in lib/redmine/scm/adapters/git_adapter.rb:</p>
<pre># Git executable name
GIT_BIN = "/home/username/.packages/bin/git"</pre>
<p>If this is not done, default Dreamhost git will be used (which is too old at the moment 1.4.4.4) and Git repository browsing will not work in RedMine<br />
(see <a href="http://groups.google.com/group/phusion-passenger/browse_thread/thread/5080d7c7cfbcf20e" target="_blank">http://groups.google.com/group/phusion-passenger/browse_thread/thread/5080d7c7cfbcf20e</a>).</p>
<p><strong>Setting up Git repository</strong></p>
<p>Refer to <a href="http://wiki.dreamhost.com/Git" target="_blank">http://wiki.dreamhost.com/Git</a> for details.</p>
<p>Couple of tricks here. There are bugs in WebDAV functionality in Ubuntu &#8211; so if you&#8217;re using it &#8211; launch Nautilus, use &#8220;File-&gt;Connect to server&#8230;&#8221; menu from there (not from the system menu), don&#8217;t enter user name in the dialog &#8211; leave it empty and enter it when you&#8217;re requested username and password in the next dialog.</p>
<p>When setting up WebDAV access rights, give access to user &#8220;redmine&#8221;.</p>
<p><strong>Setting Git repository copy for Redmine</strong></p>
<p>Create ~/.netrc for your redmine user on Dreamhost</p>
<p>Insert the following line in that file</p>
<pre>machine git.mydomain.com login redmine password [redmine_password]</pre>
<p>where redmine_password is the password you gave to user redmine in the previous step.<br />
.netrc will ensure that password is not asked when git is accessing the repository.<br />
You don&#8217;t need to bother about creating .netrc if you have a public repository (or at least available for cloning without password).</p>
<p><strong>Create a local copy of the repository</strong></p>
<p>For RedMine to be able to display Git repository, it needs to have a local clone of the repository.</p>
<pre>mkdir ~/git_project_clones
cd git_project_clones
git clone http://git.mydomain.com/repository_name</pre>
<p>Now you should have a local copy that can be used from RedMine.<br />
All you have left to do is to set up regular pulls from the master repository to this local copy. Use command</p>
<pre>crontab -e</pre>
<p>Add the following line to pull latest change into local copy every 5 minutes:</p>
<pre>*/5 * * * * cd /home/redmine_user/git_project_clones/repository_name &amp;&amp; /home/redmine_user/.packages/bin/git pull</pre>
<p>Make sure that you specify full path to git &#8211; otherwise it will execute Dreamhost default git 1.4.4.4 and command will fail with &#8220;refusing to create funny ref &#8216;remotes/origin/*&#8217; locally&#8221; error.</p>
<p>Save and exit cron editor.</p>
<p>(You might also want to check Redmine own wiki: <a href="http://www.redmine.org/wiki/redmine/HowTo_keep_in_sync_your_git_repository_for_redmine" target="_blank">http://www.redmine.org/wiki/redmine/HowTo_keep_in_sync_your_git_repository_for_redmine</a>)</p>
<p>Set repository in the settings of your project in RedMine: /home/redmine_user/git_project_clones/repository_name/.git</p>
<p>Now you need to manually update Git repository changesets in RedMine:</p>
<pre>cd ~/mydomain.com
script/runner "Repository.fetch_changesets" -e production</pre>
<p>And set a hook to your repository to do this every time repository is updated &#8211; edit ~/git_project_clones/repository_name/.git/hooks/post-update file and add the following command ther:</p>
<pre>cd /home/redmine_user/mydomain.com &amp;&amp; script/runner "Repository.fetch_changesets" -e production</pre>
<p>When writing this blogpost I found a lot of useful information on Dreamhost own wiki as well on these blog posts:<br />
<a href="http://www.wavethenavel.com/2008/09/08/bootstrapping-a-dreamhost-account-for-rails-and-git/" target="_blank"> http://www.wavethenavel.com/2008/09/08/bootstrapping-a-dreamhost-account-for-rails-and-git/</a><br />
<a href="http://juliobiason.net/2008/05/19/git-repositories-on-dreamhost-via-ssh/" target="_blank"> http://juliobiason.net/2008/05/19/git-repositories-on-dreamhost-via-ssh/</a><br />
<a href="http://www.simonecarletti.com/blog/2009/07/configuring-git-repository-with-redmine/" target="_blank"> http://www.simonecarletti.com/blog/2009/07/configuring-git-repository-with-redmine/</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2009%2F07%2Fsetting-up-ruby-rails-git-and-redmine-on-dreamhost.html&amp;linkname=Setting%20up%20Ruby%2C%20Rails%2C%20Git%20and%20Redmine%20on%20Dreamhost"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2009/07/setting-up-ruby-rails-git-and-redmine-on-dreamhost.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Migrating domain emails to Google Apps mail</title>
		<link>http://www.ivankuznetsov.com/2009/07/migrating-domain-emails-to-google-apps-mail.html</link>
		<comments>http://www.ivankuznetsov.com/2009/07/migrating-domain-emails-to-google-apps-mail.html#comments</comments>
		<pubDate>Sat, 04 Jul 2009 10:52:53 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=188</guid>
		<description><![CDATA[While performing some administrative tasks on one of the domains I maintain, I decided that the time has come to switch to a modern and reliable solution &#8211; Google Mail. If you have an IMAP mailbox hosted somewhere and you want to move it to Google, then do the following (example is set for migrating [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-193" title="logo" src="http://www.ivankuznetsov.com/wp-content/uploads/logo.gif" alt="logo" width="143" height="59" /> While performing some administrative tasks on one of the domains I maintain, I decided that the time has come to switch to a modern and reliable solution &#8211; Google Mail.</p>
<p>If you have an IMAP mailbox hosted somewhere and you want to move it to Google, then do the following (example is set for migrating from Dreamhost, but can be used on any other IMAP mailbox):</p>
<p>1. <a href="http://www.google.com/a/cpanel/domain/new">Register at Google Apps for your domain</a></p>
<p>2. <a href="https://www.google.com/a/cpanel/vse.fi/CreateUser">Re-create your email accounts</a></p>
<p>3. Log in to  shell on your hosting and execute the following command:</p>
<blockquote>
<pre> mailutil transfer -verbose -merge append \
   '{a1.balanced.&lt;your-dreamhost-mail-server&gt;.mail.dreamhost.com\
   /imap/ssl/novalidate-cert/user=&lt;your-dreamhost-username&gt;}' \
   '{imap.gmail.com/ssl/user=&lt;your-gmail-username&gt;}'</pre>
</blockquote>
<p><em>&lt;your-dreamhost-username&gt;</em> is the name you use for logging into your existing IMAP mailbox &#8211; e.g. info@mydomain.com<br />
<em> &lt;your-dreamhost-username&gt;</em> is the name you use for logging into your Gmail account (just username if you&#8217;re migrating to @gmail account or username@domain.com if you&#8217;re migrating to Google Apps account</p>
<p>4. Enter first password to your existing IMAP account, then password to your Gmail account</p>
<p>5. Voilà &#8211; prepare that this can be a long running operation, especially if you have a lot of mails.</p>
<p><em>(Thanks to <a href="http://forum.dreamhosters.com/troubleshooting/104513-migrating-email-to-Gmail.htm">joyjit</a> for advice)</em></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2009%2F07%2Fmigrating-domain-emails-to-google-apps-mail.html&amp;linkname=Migrating%20domain%20emails%20to%20Google%20Apps%20mail"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2009/07/migrating-domain-emails-to-google-apps-mail.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s new in Ubuntu 9.04 Jaunty Jakalope</title>
		<link>http://www.ivankuznetsov.com/2009/04/whats-new-in-ubuntu-904-jaunty-jakalope.html</link>
		<comments>http://www.ivankuznetsov.com/2009/04/whats-new-in-ubuntu-904-jaunty-jakalope.html#comments</comments>
		<pubDate>Mon, 27 Apr 2009 15:49:36 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=124</guid>
		<description><![CDATA[It was a fun weekend. I upgraded from Ubuntu 8.10 to 9.04 on my Lenovo T61 and installed it instead of Windows Vista on my wife&#8217;s new Dell Vostro 1510. Both upgrade and installation on both machines went without a single hickup, which was a positive surprise after my last experience with Ubuntu upgrade. Bluetooth, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-127 alignleft" style="margin: 5px;" title="ubuntu-904-jaunty-jackalope-new-wallpaper-1" src="http://www.ivankuznetsov.com/wp-content/uploads/ubuntu-904-jaunty-jackalope-new-wallpaper-1.jpg" alt="Jaunty Jackalope" width="250" height="150" /> It was a fun weekend. I upgraded from Ubuntu 8.10 to 9.04 on my Lenovo T61 and installed it instead of Windows Vista on my wife&#8217;s new Dell Vostro 1510.</p>
<p>Both upgrade and installation on both machines went without a single hickup, which was a positive surprise after my <a href="http://www.ivankuznetsov.com/2008/06/upgrading-to-ubuntu-804-hardy-heron-or-ubuntu-sucks-get-a-mac.html">last experience with Ubuntu upgrade</a>.</p>
<p><span id="more-124"></span>Bluetooth, wireless, display drivers, sound &#8211; everything was working from the first start. The only manual configuration I had to make was because of Intel integrated video <a href="https://bugs.launchpad.net/bugs/363821" target="_blank">blacklisted by Compiz</a>. There are two ways to enable Visual Effects on Intel 965.</p>
<p>1.Skipping check for blacklisted cards</p>
<ul>
<li>Create ~/.config/compiz/compiz-manager (for local user) or (/etc/xdg/compiz/compiz-manager)</li>
<li>Add SKIP_CHECKS=yes</li>
<li>Go to System-&gt;Preferences-&gt;Appearence-&gt;Visual Effects and select Normal</li>
</ul>
<p>2. Removing the card from black list</p>
<ul>
<li>sudo gedit /usr/bin/compiz</li>
<li>find a line T=&#8221;$T 8086:2982 8086:2992 8086:29a2 8086:2a02 8086:2a12&#8243; # intel 965</li>
<li>comment it out by placing # in the front</li>
<li>save the file</li>
<li>Go to System-&gt;Preferences-&gt;Appearence-&gt;Visual Effects and select Normal</li>
</ul>
<p>Purely from end-user perspective there are not that many revolutionary changes (you can read the technical details on a number of ubuntu related sites). What I personally liked about 9.04 release is:</p>
<ul>
<li>Open Office 3.0<br />
A number of <a href="http://www.openoffice.org/dev_docs/features/3.0/" target="_blank">improvements and new features</a> here. Native tables in Impress, import of DOCX, PPTX, XLSX, Solver component, improved charts. Being an active Open Office user, and having to interact a lot with users of MS Office &#8211; these are really great improvements.</li>
<li><a href="http://www.netbeans.org/community/releases/65/relnotes.html" target="_blank">NetBeans 6.5</a></li>
<li>New notifications system<br />
Looks very good &#8211; gives you a warm and fuzzy feeling every time you receive a new instant message or connect to network. Mark Shuttleworth <a href="http://www.markshuttleworth.com/archives/265" target="_blank">blogged about it</a>.</li>
<li>A really small, but nonetheless important change &#8211; Session manager is finally renamed to Startup Applications. At least now I don&#8217;t need to think every time I want to add application to autostart list.</li>
<li>Computer Janitor. A very nice application, helps you to get rid of all unused stuff on your computer, but you have to be careful with it &#8211; it offered me to delete skype and xmind amongst all other DEB packages.</li>
</ul>
<p>Other new things that I read about, but didn&#8217;t yet try:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Ext4" target="_blank">ext4 filesystem</a> support (thanks to 2.6.28 kernel) &#8211; although it reportedly <a href="http://news.softpedia.com/news/Ubuntu-9-04-Boots-in-21-4-Seconds-101885.shtml" target="_blank">improves booting time</a>, i didn&#8217;t yet dare to switch to it, better to wait till potential <a href="https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/317781" target="_blank">data loss fixes</a> are verified by long-term use</li>
<li>New, <a href="http://projects.gnome.org/evolution/" target="_blank">better Evolution</a> (thanks to Gnome 2.26), that is able to to read Microsoft Outlook Personal Folders or PST files and communicate with existing Microsoft Exchange servers via MAPI &#8211; need to try that on my work laptop.</li>
</ul>
<p>Overall, after going through installation and using it for a couple of days &#8211; I am really happy with the new release. Ubuntu continues strong and steady development and becomes a more serious competitor to Windows with every new release.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2009%2F04%2Fwhats-new-in-ubuntu-904-jaunty-jakalope.html&amp;linkname=What%26%238217%3Bs%20new%20in%20Ubuntu%209.04%20Jaunty%20Jakalope"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2009/04/whats-new-in-ubuntu-904-jaunty-jakalope.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Introducing Moozement</title>
		<link>http://www.ivankuznetsov.com/2009/03/introducing-moozement.html</link>
		<comments>http://www.ivankuznetsov.com/2009/03/introducing-moozement.html#comments</comments>
		<pubDate>Wed, 04 Mar 2009 22:10:25 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[HeiaHeia]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web/Tech]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=108</guid>
		<description><![CDATA[Last year I got involved in the development of a new social network &#8211; Moozement. There are plenty of social networks out there, there are even white label social networks. So why create another one? Jyri Engeström wrote some time ago about the case for object-centered sociality: &#8220;&#8216;social networking&#8217; makes little sense if we leave [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-112" title="moozement" src="http://www.ivankuznetsov.com/wp-content/uploads/moozement.jpg" alt="moozement" width="314" height="96" />Last year I got involved in the development of a new social network &#8211; <a href="http://www.moozement.com" target="_blank">Moozement</a>. There are <a href="http://en.wikipedia.org/wiki/List_of_social_networking_websites" target="_blank">plenty of social networks</a> out there, there are even <a href="http://www.ning.com" target="_blank">white label social networks</a>. So why create another one?</p>
<p><a href="http://www.zengestrom.com" target="_blank">Jyri Engeström</a> wrote some time ago about <a href="http://www.zengestrom.com/blog/2005/04/why_some_social.html" target="_blank">the case for object-centered sociality</a>: <em>&#8220;&#8216;social networking&#8217; makes little sense if we leave out the objects that mediate the ties between people&#8221;</em>. I could not agree with him more. The glue of each community is something that unites them &#8211; common interest, social object. When you join new social network, you typically start by building your social graph &#8211; re-establishing links to the real people you know, checking if they have already registered, inviting those whom you would like to see in the new environment. But there must be something beyond the initial phase of building the social graph. And this is the problem that haunts giants like Facebook and MySpace. You cannot possibly have common interest with everyone, and you don&#8217;t want to share the same things with everyone.</p>
<p><span id="more-108"></span>While Facebook is still growing strongly, it&#8217;s morphing into some sort of a generic social utility. Thanks to the <a href="http://developers.facebook.com/" target="_blank">Platform API</a> there are all kinds of applications available on <a href="http://www.facebook.com/apps/">Facebook</a>, some of them creating social objects (like <a href="http://www.facebook.com/apps/application.php?id=8278986302">Circle of Moms</a> or <a href="http://www.facebook.com/apps/application.php?id=2219089314">Cities I&#8217;ve Visited</a>), but it feels like true passions of people are quite rare in generic networks. When it comes to your most important hobbies, you might want to share your thoughts and data with other likeminded people and not necessarily with all aquaintances on Facebook. This is one of the reasons why specialized social networks are thriving. <a href="http://www.dogster.com" target="_blank">Dogster.com</a> and <a href="http://www.catster.com" target="_blank">catster.com</a> <a href="http://www.catster.com/" target="_blank"></a>are two perfect examples of such networks with very strong social objects. <a href="http://blog.pmarca.com/" target="_blank">Mark Andreesen</a>&#8216;s creation <a href="http://www.ning.com" target="_blank">Ning</a> &#8211; a place where everyone can build own social network &#8211; already has hundreds of thousands of networks.</p>
<div>Online sports services can be divided into at least three major categories:</div>
<div>
<div><strong>Well-being services</strong></p>
<p>There are plenty of online training log services promoting weight management, wellness, healthy lifestyle, sport and exercise. There are many good and innovative services in this segment, but they&#8217;re all somewhat serious by definition (in a good way) &#8211; you need to be on a program to make perfect use of them.</p></div>
<div class="im"><strong>Advanced sports services</strong></p>
<p>There are also some useful advanced sports services, provided by giants like <a href="http://nikeplus.nike.com" target="_blank">Nike</a><a href="http://nikeplus.nike.com/" target="_blank"></a>, <a href="https://www.polarpersonaltrainer.com/" target="_blank">Polar</a> and <a href="http://sportstracker.nokia.com" target="_blank">Nokia</a>. These services are great for automatically collecting data about your exercises and utilizing it in various ways. They are targeting enthusiasts, who typically use heart rate monitors, GPS devices, altimeters and other equipment to monitor their progress.</p>
<p><strong>Casual sports services</strong></p>
<p><strong></strong>I believe <a href="http://www.moozement.com">Moozement</a> established and defined this category &#8211; by combining social networking and online training logs in a casual way. It is so simple that anybody doing any kind of sports can use it and benefit from it. Simplicity and wide set of available sports sets it apart from all existing solutions. Moozement entry barrier is so low that you can literally connect to all your sporty friends. Moozement concentrates on the social aspect of physical activity, gives an opportunity to brag about your achievements, yet not taking it very seriously. You can log cycling 10km to work, or skiing 3km on Saturday afternoon, or even that you walked 50 stairs up the metro escalator. Every bit counts.</div>
<div>Moozement is targeting casual and amateur sportsmen and has already proven to be an excellent way to motivate people to exercise more because of the peer pressure. The buddy log on Moozement gives you an excellent overview on how you are doing compared to your friends this week (or month, or year). Sometimes it might look like comparing apples and oranges, but it is just for fun anyway. If you want to take it more seriously, it is possible to create a group &#8211; e.g. just for your friends who are into rollerblading &#8211; and compare results only in the group log.</p>
<div class="im">There are a lot of other nice features. E.g. <a href="http://apps.facebook.com/moozement/" target="_blank">Moozement Facebook application</a> allows you to put your ranking among your friends to your Facebook profile and put your exercises into your Facebook feed &#8211; to widen the circle of your bragging &#8211; while Facebook might be lacking passion, it sure has the numbers ; )</p>
<p>Let&#8217;s see where Moozement&#8217;s development curve will take it. For me it is a hobby project, but I can see a bright future in it.</p>
<p>Now I would encourage you to go to <a href="http://www.moozement.com/" target="_blank">http://www.moozement.com</a> and check it out for yourself. All feedback is welcome &#8211; I will make sure that it reaches developers.</div>
</div>
</div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2009%2F03%2Fintroducing-moozement.html&amp;linkname=Introducing%20Moozement"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2009/03/introducing-moozement.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgrading to Ubuntu 8.04 Hardy Heron or &#8220;Ubuntu sucks&#8230; get a Mac&#8221;</title>
		<link>http://www.ivankuznetsov.com/2008/06/upgrading-to-ubuntu-804-hardy-heron-or-ubuntu-sucks-get-a-mac.html</link>
		<comments>http://www.ivankuznetsov.com/2008/06/upgrading-to-ubuntu-804-hardy-heron-or-ubuntu-sucks-get-a-mac.html#comments</comments>
		<pubDate>Fri, 13 Jun 2008 12:26:47 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu sucks]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=104</guid>
		<description><![CDATA[I should admit &#8211; I shamelessly borrowed part of the title for this post from Tyler. I had exactly same feeling after upgrading from Ubuntu 7.10 to 8.04. I&#8217;ve been meaning to write about this upgrade for almost two months now. Right after Ubuntu 8.04 was released I upgraded two of my laptops from Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-105" title="ubuntu" src="http://www.ivankuznetsov.com/wp-content/uploads/ubuntu.jpg" alt="" width="300" height="79" />I should admit &#8211; I shamelessly borrowed part of the title for this post <a href="http://awesomerails.wordpress.com/2008/05/03/ubuntu-sucksget-a-mac/">from Tyler</a>.<br />
I had exactly same feeling after upgrading from Ubuntu 7.10 to 8.04.</p>
<p>I&#8217;ve been meaning to write about this upgrade for almost two months now. Right after Ubuntu 8.04 was released I upgraded two of my laptops from Ubuntu 7.10 to 8.04. I know, I know, never download software on the release date, wait for a couple of months before all major bugs are fixed and it starts working somehow. But anyway&#8230;</p>
<p><span id="more-104"></span></p>
<p>On Lenovo T61 everything went mostly fine. After upgrade crash report tool complained about nautilus crash. Then more serious issues started popping up:</p>
<ul>
<li><a href="http://www.parallels.com">Parallels</a> stopped working. I use this tool quite a lot to debug web pages in different browsers in different operating systems. Apparently there was no support for Ubuntu 8.10 Hardy Heron from Parallels team yet, and the older version that worked in Ubuntu 7.10 didn&#8217;t work anymore because of compatibility issues in newer 2.6.24 kernel.A temporary solution (<a href="http://forum.parallels.com/pda/index.php/t-20323.html">Parallels build 2.2.2226</a>) was provided at a time, and now a new official compatible Parallels release is available for Ubuntu 8.04.</li>
</ul>
<ul>
<li>Samsung SCX-4521F printer refused to work even after proprietory drivers reinstallation. Fortunately <a href="http://ubuntuforums.org/showpost.php?p=4776310&amp;postcount=114">solution to this problem</a> was quickly found by one of Ubuntu community members.</li>
</ul>
<p>On Sony Vaio there were more troubles.</p>
<ul>
<li>Since kernel version changed after upgrade to Ubuntu 8.10, I had to download and reinstall proprietory drivers for Nvidia 8400M graphics card. Kernel changed a couple of times after that as a part of standard package update procedure in 8.10, and each time after that I have to reinstall drivers from NVidia site.</li>
</ul>
<ul>
<li>Vaio integrated camera driver is not included in Ubuntu distribution, but <a href="https://bugs.launchpad.net/ubuntu/+bug/120434/comments/8">Patrick Niklaus built a package</a> for 2.6.24-16-generic kernel.</li>
</ul>
<ul>
<li>Network Manager applet (nm-applett) <a href="https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/125075">tries to access keyring</a> all the time <a href="https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/223076">to connect to wireless </a>network with WPA</li>
</ul>
<ul>
<li>keyboard <a href="https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/196277">layouts switching is not working</a> after autologin (there is a workaround though)</li>
</ul>
<ul>
<li>sleep/hibernate on Vaio still doesn&#8217;t work</li>
</ul>
<p>Now to the good things:</p>
<ul>
<li>No more proprietory drivers for Intel wireless card (iwl3945 driver)</li>
</ul>
<ul>
<li>Firefox 3. My first reaction &#8211; it is a beauty. (Although after using it for a couple of months, I experienced all beauties of a beta version &#8211; random crashes, some sites are not rendered properly, etc.)</li>
</ul>
<ul>
<li>CPU scaling is finally working out of the box and Sony Vaio laptop is not overheating anymore</li>
</ul>
<p>As I already said, my initial feeling after upgrading to 8.10 was &#8220;Ubuntu sucks&#8230; get a Mac&#8221;. A major upgrade to the next long-term support version was not exactly what I expected. Small, but very annoying bugs in basic functionality undermined success of otherwise very good release. Recently Nokia started supporting Ubuntu for work computers and I immediately changed RedHat on my work laptop to Ubuntu. However I decided to go for Ubuntu 7.10, not 8.04. It works perfectly, even if OpenOffice version is just v2.3 and Firefox &#8211; 2.0.</p>
<p>As Tyler put it &#8220;<a href="http://awesomerails.wordpress.com/2008/05/03/ubuntu-sucksget-a-mac/">[...] get a Mac. Why? Because for the most part, shit works when you plug it in</a>&#8220;. I couldn&#8217;t agree more. I still stay with Ubuntu, but this last release made me think about moving to Mac again.</p>
<p><strong>Update 2009-05-23: </strong>To do justice to Ubuntu &#8211; I have not purchased Mac, but <a href="http://www.ivankuznetsov.com/2009/04/whats-new-in-ubuntu-904-jaunty-jakalope.html">upgraded to 9.04</a> and been generally happy with it.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.ivankuznetsov.com%2F2008%2F06%2Fupgrading-to-ubuntu-804-hardy-heron-or-ubuntu-sucks-get-a-mac.html&amp;linkname=Upgrading%20to%20Ubuntu%208.04%20Hardy%20Heron%20or%20%26%238220%3BUbuntu%20sucks%26%238230%3B%20get%20a%20Mac%26%238221%3B"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2008/06/upgrading-to-ubuntu-804-hardy-heron-or-ubuntu-sucks-get-a-mac.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
