Debian and Ubuntu server locale and encoding

I recently had «fun» supporting server installation of software that needed locale set properly.

In Debian, you can just use

dpkg-reconfigure locales

and the console GUI will pop up.

In Ubuntu server, you’ll more steps to make^

And make full use of UTF, please:

Migration off GMail as part of «spring cleaning».

As part of «spring cleaning», Google Reader was scheduled to be shut down.

FBI  is working with “members of intelligence community” to craft a proposal for new Internet spy powers as “a top priority this year.”

Well, I now have a perfect reason to draft my personal roadmap for this year and to list tools I’m going to use.

MySQL with Django on Debian

First, install MySQL driver for Python:

sudo apt-get install python-mysqldb

Next, modify your config of MySQL:

If you’ve already messed up the install, you can either drop/create database from scratch, or apply the following script to every table of your DB:


Alternative mirgation path:

Latex with ESKDX in Ubuntu

  1. install texlive
  2. install texlive-lang-cyrillic (this will install ukrhyph as well to avoid problems listed in
  3. download
    but it seems to me, that eskdx should already be in cyrillic
  4. copy cp -a eskdx-0.98/unpacked /usr/share/texmf-texlive/tex/latex/eskdx
  5. run sudo texhash
  6. install texlive-latex-extra for lastpage package (190 est.)
  7. install pscyr, as outlined in
  8. if you experience difficulties with pscyr, try installing scalable-cyrfonts-tex
  9. install texlive-science for algorithm2e
  10. open /etc/texmf/updmap.d/10texlive-lang-cyrillic.cfg and add line there:
  11. run updmap
  12. run updmap-sys
  13. install inkscape gnuplot

UPD 27.01.2014: now I need this installation again and I almost got lost even with this instruction, mainly because of pscyr issues. Now I’m trying to create meaningful instructions for its installation.

Еще я понял, что никому инструкция по установке пакета с кириллическими шрифтами на английском не нужна, поэтому дальше все будет на русском.

Итак, новая инструкция:

а) запустить команды:

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y texlive texlive-lang-cyrillic texlive-latex-extra scalable-cyrfonts-tex texlive-science inkscape gnuplot

б) запустить данный в директории, куда будут распакованы два архива pscyr:

Зачем менять sh на bash?

Installing Ruby & Ruby on Rails on Ubuntu box

Start by:
Dig deeper with:
If you install rvm as root and fall in bunch of problems, visit:

Symfony2 w/PHP5.3 on Ubuntu 11.04 / Nginx

sudo apt-get install php5
sudo apt-get install php5-suhosin


try_files $uri $uri/ /index.php;
location ~ \.php(/.*)?$ {
 fastcgi_split_path_info ^(.+\.php)(.*)$;
 fastcgi_pass   backend;
 fastcgi_index  index.php;
 fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
 include fastcgi_params;
 fastcgi_param  QUERY_STRING     $query_string;
 fastcgi_param  REQUEST_METHOD   $request_method;
 fastcgi_param  CONTENT_TYPE     $content_type;
 fastcgi_param  CONTENT_LENGTH   $content_length;
 fastcgi_intercept_errors        on;
 fastcgi_ignore_client_abort     off;
 fastcgi_connect_timeout 60;
 fastcgi_send_timeout 180;
 fastcgi_read_timeout 180;
 fastcgi_buffer_size 128k;
 fastcgi_buffers 4 256k;
 fastcgi_busy_buffers_size 256k;
 fastcgi_temp_file_write_size 256k;
 #error_page  404              /404.html;

 location /web/ {
 root /var/www/;
 allow all;

Restart Nginx

ps -ax | grep nginx
kill 1021
sudo /etc/init.d/nginx restart

Install PHP-FPM:

sudo apt-get install php5-fpm
sudo /etc/init.d/php5-fpm restart

Install SqLite:

sudo apt-get install php5-sqlite
sudo /etc/init.d/php5-fpm restart

Install internationalization tools:

sudo apt-get install php5-intl


sudo apt-get install php5-intl php-pear
sudo /etc/init.d/php5-fpm restart
sudo pecl install apc

Add date.datetime for your zone and turn shorthand tag mode off:

sudo vim php.ini

You’re done!

sudo /etc/init.d/php5-fpm restart

XeTex в Ubuntu 11.04


sudo apt-get install texlive scalable-cyrfonts-tex
sudo apt-get install texlive-xetex


\section{Unicode support}

All human beings are born free and equal in dignity and rights.

Hver ma?ur er borinn frj?ls og jafn ??rum a? vir?ingu og r?ttindum.

Все люди рождаются свободными и равными в своем достоинстве и

\subsection{Ti?ng Vi?t}
T?t c? m?i ng??i sinh ra ??u ???c t? do v? b?nh ??ng v? nh?n ph?m v?
quy?n l?i.

???? ?? ???????? ??????????? ????????? ??? ???? ???? ???????????
??? ?? ??????????.

\section{Legacy syntax}
When he goes—«Hello World!»\\
She replies—“Hello dear!”


xelatex xela.tex



Установка Munin и его настройка на nginx

Всегда приятно, когда обо всем знаешь. Даже когда тебе это ни к чему. В мире UNIX инструмент для этого — мониторинг. Реализован он, как правило, с помощью стандартного решения, которое испытано в непростых условиях.
Я выбрал Munin — приложение системного и сетевого мониторинга с веб-панелью.
Он присутствует во всех популярных репозиториях пакетов и не требует дополнительных зависимостей.
Моей целью был мониторинг Nginx. Для этого необходимо пересобрать с флагом —with-http_stub_status_module. Поэтому сначала сделаем это.

Читать далее

Installing MongoDB 1.8.1 on Ubuntu 11.04 and PyMongo

Install everything you need:

sudo apt-key adv --keyserver --recv 7F0CEB10
sudo nano /etc/apt/sources.list

Next, add a line to sources.list:

— on Ubuntu

deb dist 10gen

— on Debian

deb dist 10gen
sudo apt-get update
sudo apt-get install mongodb-10gen
sudo apt-get install python-setuptools
sudo easy_install pymongo

Next, test the connection:
Читать далее

Ruby on Rails 3 installation on Debian 6 Squeeze

apt-get install libsqlite3-dev curl git build-essential zlib1g-dev libssl-dev
bash << ( curl )
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
rvm install 1.9.2
rvm --default ruby-1.9.2
gem install rails
rails new testapp

в $HOME/.profile

export PATH=$PATH:/var/lib/gems/1.8/bin

comment out sqlite deps in Gemfile
then run rails server

UP 02.03.2012 obsolete replacement:

Package libreadline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libreadline-gplv2-dev lib64readline-gplv2-dev

Important note for Ubuntu:

gem install therubyracer
apt-get install libsqlite3-dev

Sun JAVA JDK 6 on Debian 6 Squeeze as default

Some software, as IDEs are demanding Sun JRE instead of any other implementation. That happens due to swing and performance problems unsolved in opensource editions.

On Debian, add non-free in sources.list like
deb testing main contrib non-free

next, after running apt-get update, install java:
apt-get install sun-java6-jdk sun-java6-jre libtcnative-1
Читать далее