20.01.13

Использование portupgrade для обновления установленных из портов программ.



Сегодня я хочу рассказать о том, как же во FreeBSD правильно обновить установленные из портов программы. Механизм обновления программ со старой версии на новую прост и логичен. Благодаря его продуманности работать с ПО, которые установлены из системы портов очень легко даже новичкам. В деле обновления нам поможет программа по имени portupgrade.
Я работаю в FreeBSD 7.1
Первым дело нам нужно обновить порты.
Потом устанавливаем portupgrade
cd /usr/ports/ports-mgmt/portupgrade  && make install clean
??????????????????????????????????????????????????????????????????????
?                Options for portupgrade 2.4.6_2,2                   ?
? ?????????????????????????????????????????????????????????????????? ?
? ?           [X] BDB4  Use Berkeley DB >=2 as backend             ? ?
? ?           [ ] BDB1  Use Berkeley DB 1.85 as backend            ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
? ?                                                                ? ?
??????????????????????????????????????????????????????????????????????
?                       [  OK  ]       Cancel                        ?
??????????????????????????????????????????????????????????????????????
опции я оставил по умолчанию
Ставится на современной машине очень быстро.
после установки нам говорят в числе прочего и
Note also, portupgrade knows nothing how to handle ports with different
suffixes (E.g. -nox11). So you should explicitly define variables
(E.g. WITHOUT_X11=yes) for the ports in /etc/make.conf or pkgtools.conf
(MAKE_ARGS section) files.
Так что если вы работаете только с консолью, то добавляем
WITHOUT_X11=yes
в
/etc/make.conf
Если работаете в Х среде, это делать не нужно.
Теперь смотрим, какие порты нам можно обновить. Вот что у меня вышло.
pkg_version -v | grep "need"

apache-2.2.11_3                     <   needs updating (port has 2.2.11_4)
clamav-0.94.2                       <   needs updating (port has 0.95.1_1)
curl-7.19.2                         <   needs updating (port has 7.19.4)
freetype2-2.3.7                     <   needs updating (port has 2.3.9_1)
gamin-0.1.10                        <   needs updating (port has 0.1.10_1)
gio-fam-backend-2.18.4              <   needs updating (port has 2.20.1)
glib-2.18.4                         <   needs updating (port has 2.20.1)
havp-0.88_1                         <   needs updating (port has 0.90)
icu-3.8.1_1                         <   needs updating (port has 3.8.1_2)
libSM-1.1.0,1                       <   needs updating (port has 1.1.0_1,1)
libX11-1.1.3_1,1                    <   needs updating (port has 1.2.1,1)
libslang2-2.1.4                     <   needs updating (port has 2.1.4_1)
m4-1.4.11,1                         <   needs updating (port has 1.4.12,1)
openldap-client-2.4.13              <   needs updating (port has 2.4.16)
pcre-7.8                            <   needs updating (port has 7.9)
perl-5.8.9                          <   needs updating (port has 5.8.9_2)
php5-5.2.8                          <   needs updating (port has 5.2.9)
php5-session-5.2.8                  <   needs updating (port has 5.2.9)
php5-xml-5.2.8                      <   needs updating (port has 5.2.9)
php5-xmlrpc-5.2.8                   <   needs updating (port has 5.2.9)
png-1.2.34                          <   needs updating (port has 1.2.35)
python25-2.5.2_3                    <   needs updating (port has 2.5.4_1)
rtgui-0.2.2_2                       <   needs updating (port has 0.2.7)
rtorrent-devel-0.8.4                <   needs updating (port has 0.8.4_1)
ruby-1.8.6.287,1                    <   needs updating (port has 1.8.7.72_1,1)
ruby18-bdb-0.6.4                    <   needs updating (port has 0.6.5)
squid-3.0.13                        <   needs updating (port has 3.0.14)
trafd-3.0.1_2                       <   needs updating (port has 3.0.2.1)
xmlrpc-c-devel-1.11.00_3            <   needs updating (port has 1.18.00)
xproto-7.0.14                       <   needs updating (port has 7.0.15)
И когда только успел столько понаставить :) .
Обновлять программы просто. Пишем в консоли
portupgrade имя_обновляемого_порта
Важно помнить, что во время обновления сервис будет остановлен. Если это ваш домашний компьютер – как правило это допустимо, а если прокси сервер организации и вы задумаете обновить тот же squid – то лучше это делать в нерабочие часы, вдруг что-то пойдет не так, как вы хотели?
ВНИМАНИЕ! Сохраняйте конфигурационные файлы обновляемых программ. Причем это нужно делать перед каждым обновлением, а то рискуете в самый неподходящий момент их потерять.
Как более пароноидальный вариант – перед обновление сделайте пакеты из установленных программ. Откатиться будет еще проще, чем с одними голыми конфигами на руках.
Команда
portupgrade -arR
Позволяет обновить все порты.
-a значит применить ко всем.
-R проверит зависимости для установки
-r проверит приложения, которые зависят от порта.
Сочетание этих ключей предотвратит появление в вашей системе устаревших зависимостей и несовместимости программ.
Иногда во время использования portupgrade появляется предложение запустить pkgdb -F. Эта команда обновляет базу данных пакетов. Эта база данных находится в /var/db/pkg/pkgdb.db. Если вы увидели это сообщение, запустите о чем вас просит система.
pkgdb  -F
интерактивно исправляет базу данных пакетов, т.е. спрашивает вас как поступить. Если не хотите с этим связываться, можно позволить системе самой решать как лучше.
Это делается так
pkgdb -fu
Вот вроде бы и все про обновление программ, которые установлены из портов, при помощи portupgrade.

19.01.13

G2M4 works with mplayer in MPUI


Success ! We were able to play gotomeeting files that use codec G2M4 in Mplayer and in MPUI (http://mpui.sourceforge.net/).
The following instructions describe three ways to the success. After finishing the installation, you may also want to make the movie seekable by running
mencoder.exe    -forceidx     InputFile.wmv   -o OutputFile.wmv    -oac copy -ovc copy

G2M4 works with Mplayer and Mencoder

1. Download MPlayer-p4-svn-34118.7z and unzip it (7z x MPlayer-p4-svn-34118.7z).
2. Modify codecs.conf as explained below (add G2M4 to the line with G2M2, G2M3)
3. Place the file G2M4.DLL from Citrix (see below) next to the mplayer.exe or to the codecs directory.
4. Use mplayer and mencoder. Make sure HOME variable is not defined (or place the codecs.conf and g2m.dll accordingly).

G2M4 works with MPUI.2011-06-09.Full-Package

1. Download and install MPUI.2011-06-09.Full-Package.exe. This is supposed to contain (as defined in Build.nsi,r=276)

!define BUILD_NO "91"
!define COMPILE_DATE "2011-06-09"
!define VER_MPLAYER "SVN-r33574 (2011-06-09)"
!define VER_SMPLAYER "v0.6.9 (SVN-r3607)"
!define VER_MPUI "v1.2-pre3 (Build 38)"
!define VER_NSIS "v2.46"
!define VER_CODECS "(2011-01-31)"


2. Modify one line in the codecs.conf file as follows:
videocodec gotomeeting
        info "GoToMeeting codec"
        status working
        fourcc G2M2,G2M3      <--------- Here, we have to add  ,G2M4
        driver dmo
        dll "G2M.dll"
        guid 0x23F891A4, 0x572B, 0x474A, 0x86, 0xDA, 0x66, 0xCD, 0xD3, 0xD1, 0xAC, 0x2E
        out BGR24,RGB24 flip

3. Delete g2m.dll installed with MPUI&Mplayer and replaced it by a current G2M.dll obtained from cytrix codec pack (cf. also http://gotomeeting.com/). After installation it can be found e.g. as follows
G2M.dll      C:\Users\<username>\AppData\Local\Citrix\GoToMeeting\723      7,87 MB  
G2M.dll      C:\Users\<username>\AppData\Local\Citrix\GoToMeeting\799      14,88 MB 

4. You can place your wmv file next to MPUI.exe if you want it playing immediately. Double click MPUI.exe.

G2M4 works with MPUI-1.2-pre3_with_MPlayer-SVN-r26251.zip

1. Download and unzip MPUI-1.2-pre3_with_MPlayer-SVN-r26251.zip (3.8 MB).
2. Start MPUI and observe the location where mplayer creates directory mplayer and file config. Normally it is just next to the MPUI.exe. (If started from cygwin, it is your in HOME directory.) The location of created file is mentioned in the mplaer's output (mplayer console) which is accessible from MPUI menu.
Obtain a valid codecs.conf with modification mentioned above and put it next to the config file. The following version of codecs.conf enables G2M4 but disable sound (and everything else).
;=============================================================================
;  Default codecs config file.
;  Before editing this file, please read DOCS/tech/codecs.conf.txt !
;=============================================================================

release 20100605
; this is not the correct release :-(

;=============================================================================
;                   VIDEO CODECS
;=============================================================================

videocodec gotomeeting
  info "GoToMeeting codec"
  status working
  fourcc G2M2,G2M3,G2M4
  driver dmo
  dll "G2M.dll"
  guid 0x23F891A4, 0x572B, 0x474A, 0x86, 0xDA, 0x66, 0xCD, 0xD3, 0xD1, 0xAC, 0x2E
  out BGR24,RGB24 flip

3. Next to MPUI.exe and mplayer.exe, put G2M.DLL obtained from Citrix (see above).
Note: G2M.dll creates G2MCodec.log (in \Users\<username>) which might be helpful sometimes.
Please, can anyone confirm the success? Does the same recipe work with a current version of mplayer?

 

G2M4 works with MENCODER

2011-10-02, Win7         (Jan Kolar)         kolar  a-t math  cas  cz

My current version of mplayer on cygwin crashes with test files. However mencoder produces output properly.
The result of the following two commands proves that G2M4 works with mencoder on cygwin, provided G2M.DLL form cytrix is placed in the current directory and /etc/mplayer/codecs.conf is modified as mentioned above.
mencoder.exe  work/RADEK_g2m4___TEST_patch__g2m4.wmv -ovc lavc  -o xxxx.wmv -nosound
     # stop by Ctrl-C after a few seconds
DISPLAY=:0 ffplay.exe xxxx.wmv
The commands are not what you need, but I see the video output. You need to specify output format according your needs.
If mencoder works, also mplayer should work, but I cannot test that since a recent mplayer on cygwin crashes for me.
Might be it crashes for any video file. (Might be, the crash is connected to ReadFile and/or WaitSignal ?)
        $ DISPLAY=:0 mplayer  work/g2m4.wmv
        MPlayer SVN-r32518-snapshot-4.5.1 (C) 2000-2010 MPlayer Team
        159 audio & 349 video codecs
        
        Playing work/RADEK_g2m4___TEST_patch__g2m4.wmv.
        ASF file format detected.
        [asfheader] Audio stream found, -aid 1
        [asfheader] Video stream found, -vid 3
        VIDEO:  [G2M4]  1280x1024  24bpp  1000.000 fps  27648.0 kbps (3375.0 kbyte/s)
        
        MPlayer interrupted by signal 11 in module: preinit_libvo
        - MPlayer crashed by bad usage of CPU/FPU/RAM.



dependency for    awn-extras-applets 


summary: cpufreq missing dependency?

later found another non-working machine but
the good news is i think it might just be a missing dependency:

  gnome-applets-1:3.2.1-2.fc16.x86_64

which i must have installed on the working machine but not the non-working ones
because when i happened to install it on the non-working machines the formerly frozen cpufreq icons started to dance (next time the machine power cycled)!

is it time to amend the dependency for
  awn-extras-applets
to require
  gnome-applets
soon before i forget how to fix this for the next time
or did i misread the tealeaves?   :')

17.01.13

Работа с видео в Linux

Оригинал http://zenux.ru/articles/33/


Автозагрузка виртуальной гостевой машины VirtualBox


Имеется VirtualBox на Ubuntu 11.10 на которой постоянно крутится гостевая Windows Server с рядом сервисов необходимых в  сети. Все настраивалось через стандартные графические инструменты но это накладывает одно неудобство, при перезагрузке необходимо вручную запускать заново виртуальную машину. А хочется что бы все запускалось автоматом и без графики.
Для запуска VirtualBox без графики, есть несколько параметров, мы воспользуемся следующим:

VBoxHeadless --startvm <uuid|name>
где <uuid|name> идентификатор или имя нашей гостевой ОС. 

13.01.13

Запуск собственных скриптов systemd


Через rc.local

Как и ранее, чтобы запустить какой-то скрипт при загрузке системы, вы можете поместить его в файл /etc/rc.d/rc.local. Однако стоит учесть специфику запуска этого скрипта в systemd.
service-файл отвечающего за него юнита выглядит следующим образом:
$ cat /lib/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.d/rc.local Compatibility
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
SysVStartPriority=99
Отсюда видно, во-первых, что файл /etc/rc.d/rc.local обязан быть исполняемым.
А во-вторых, видно, что сервис rc-local имеет зависимость только от цели network.target. Параметр SysVStartPriority=99 отвечает только за приоритет по сравнению с другими sysVinit-скриптами, которых в Fedora становится все меньше. С учетом параллельной загрузки это означает, что скрипт, который вы разместите в файле rc.local может быть запущен слишком рано, например, до старта нужных сервисов. Поэтому, если вы разместите в этом файле скрипты перезапуска апача, то, с большой вероятностью, они не сработают.
В версиях до Fedora 17, не было зависимости от network.target, так что, там этот скрипт запускался практически в самом начале.

С помощью systemd-юнита

Более естественный для systemd способ запускать скрипты - это создание своего собственного юнита.
Просто создайте файл /etc/systemd/system/my_stuff.service со следующим текстом:
[Unit]
Description=Run my stuff  
Requires=network.target   
After=network.target 
 
[Service]
Type=oneshot
RemainAfterExit=True
ExecStart=/some/script --with-some-parameters
ExecStart=/some/other/script
 
[Install]
WantedBy=multi-user.target
Здесь Requires - указывает цель, после которой необходимо запустить сервис, After означает, что сеть должна быть полностью запущена к моменту старта, WantedBy - цель, для которой запускается сервис. В ExecStart должен быть указан полный путь к скрипту или исполняемому файлу, поскольку переменная PATH не используется.
multi-user.target - это аналог init 3 в sysVinit. Подробнее о реализации runlevel-ов в systemd, можно прочесть по ссылке.
В такой конфигурации скрипты будут запускаться сразу после запуска сети и старта всех интерфейсов. Однако systemd позволяет гораздо более гибкую настройку. Например, для выполнения скриптов после запуска графического DM можно использовать After: systemd-user-sessions.service
Небольшой пример: После появления облачного хранилища Яндекс.Диск, захотелось автоматически монтировать его в файловую систему через davfs2 (с заранее положенными логином и паролем в /etc/davfs2/secrets). Прописывание в fstab не дало результатов, как и прописывание в rc.local, поскольку в Fedora 16 оба они обрабатывались ещё до поднятия сети. А вот создание модуля по вышеприведённому образцу решило проблему.

Дополнительно

Для диагностики сервиса используйте команду
systemctl status rc-local.service
или загляните в файл /var/log/boot.log (он появится если в параметрах загрузки убрать quiet, см. Grub2).

Грамотная очистка /var/cache/pacman/pkg


Selectively clean cache

  • Use paccache from pacman-contrib to clean the /var/cache/pacman/pkg directory while allowing to specify how many package versions should be retained (default is 3):
paccache -rv
To list all the options:
paccache -h
  • Because paccache does not remove the cache of uninstalled packages, you can display them with diff from diffutils and then optionally delete each package in the /var/cache/pacman/pkg directory:
pacman -S diff
diff -y <(pacman -Qq) <(ls /var/cache/pacman/pkg/ | sed 's/^\(.*\)-[^-]*-[^-]*-[^-]*$/\1/' | sort -u)
If you want to display the output with colors install colordiff:
pacman -S colordiff
colordiff -y <(pacman -Qq) <(ls /var/cache/pacman/pkg/ | sed 's/^\(.*\)-[^-]*-[^-]*-[^-]*$/\1/' | sort -u)


cacheclean — это скрипт на python для отчистки /var/cache/pacman/pkg работающий по аналогии с pacman -Sc, но имеющий одну важную особенность — он позволяет указать количество сохраняемых версий пакетов и, так же как repo-clean, упомянутый в Arch FAQ & Tips, не удаляет пакеты не установленные в данный момент. 
Т.е. repo-clean удаляет все файлы пакетов акромя последней версии, а cacheclean позволяет указать сколько последних версий сохранять… 

pkgcacheclean — аналог cacheclean, но уже написан на сях и удаляет все неиспользуемые пакеты, грубо говоря это pacman -Sc && cacheclean 2 (2, ибо pkgcacheclean по умолчанию оставляет две последнии версии пакета, хотя количество оставляемых версий можно изменить). 

Обе утилитки имеются в AUR 

Ну и не забываем о опции CleanMethod = KeepCurrent в pacman.conf позволяющей 
оставлять не установленные пакеты с помощью pacman -Sc

Ситуация, когда в кэше накапливается несколько гигабайт пакетов, думаю, известна многим. Так же как и стандартное решение — удаление неустановленных пакетов
$ pacman -Sc
или полная очистка кэша
$ pacman -Scс

Однако, зачастую необходимо удалить лишь устаревшие пакеты, не трогая при этом все остальные. 

Когда я столкнулся с этой проблемой, то тут же написал небольшой скрипт на bash'е:
#!/bin/bash
// переходим в нужную нам директорию
cd "/var/cache/pacman/pkg/";
// забираем список пакетов
files=(`ls | grep pkg.tar.gz`)
// делаем список имен пакетов (которые могут повторяться)
pkgs=(`ls | grep pkg.tar.gz | sed 's/-[0-9].*//'`);
// вычисляем длину массивов
filesLen=${#files[@]}
// перебираем элементы массива pkgs в поисках повторов
for (( i=0; i<$filesLen-1; i++ ));
do
        echo "cheking ${pkgs[$i]} package...";
        for (( j=$i+1; j<${filesLen}; j++ ));
        do
                // если находим повтор
                if [ ${pkgs[$i]} = ${pkgs[$j]} ]; then
                        // сравниваем файлы по дате создания
                        // чтобы удалить старый из двух имеющихся
                        if [ ${files[$i]} -ot ${files[$j]} ]; then
                                echo "found ${files[$j]}";
                                echo "removed ${files[$i]}";
                                rm -Rf ${files[$i]};
                                break;
                        else
                                echo "found ${files[$i]}";
                                echo "removed ${files[$j]}";
                                rm -Rf ${files[$j]};
                        fi
                fi
        done
done

Скрипт ищет повторяющиеся пакеты и удаляет все, кроме того, у которого дата создания позднее.

Однако, как оказалось, данную проблему уже решил человек с ником smirnoffjr, написав программу на С++ под названием repo-clean, которая доступна в AUR'е
yaourt -S repo-clean


Программа умеет перемещать в другую директорию (режим move) и удалять старые версии пакетов (режим clean), или просто выдавать список тех, которые имеют больше одной версии в кэше (режим dry-run). А также поддерживает исключения для указанных пакетов, для этого нужно создать файл ~/.repocleanrc и определить параметр ignore, например, так:
ignore=kernel26rt,mesa


Так же существует неплохой скрипт на python'е, который приведен в вики на официальном сайте, но уступает программе repo-clean по функциональности, т.к. основная опция — это количество версий, которые нужно оставить в сохранности.

Как отключить X сервер Ubuntu


Есть много причин, по которым может понадобиться отключить X сервер — к примеру, если нужносделать свой рабочий компьютер сервером (хотя бы и временно), или решить какие-либо проблемы с видеокартой… К примеру, я предпочитаю запускать X с помощью команды «startx» в тот момент, когда я полностью готов к его запуску. Мало приятного наблюдать пустой черный экран, когда новый драйвер для встроенной видеокарточки Intel не хочет работать — в старые времена, я бы нажал комбинацию Ctrl+Alt+Backspace и починил бы его. В Ubuntu это происходит немного иначе.

В Ubuntu используется система инициализации под названием «Upstart». Если вы пробовали связываться с update-rc и замечали, что выключение /etc/init.d/gdm не работает, то теперь вы поймете почему. Конечно, можно выполнить:

/etc/init.d/gdm stop

Однако это лишь временное решение, тем более которое работает когда у вас и так все работает. К примеру, у меня если видеодрайвер не заработал, то моя консоль не восстанавливается, а я просто получаю пустой экран.
Чтобы X сервер полностью перестал запускаться, нужно правильно работать с upstart. Upstart-определения хранятся в каталоге /etc/init (не-не, только не /etc/init.d). В них описан процесс запуска компьютера в стиле init.d скриптов Gentoo — вы можете определять зависимости, события, фазы и т.п. Итак, заглянем в /etc/init/gdm.conf:
    # gdm - GNOME Display Manager
    #
    # The display manager service manages the X servers running on the
    # system, providing login and auto-login services

    description     "GNOME Display Manager"
    author          "William Jon McCann "

    # Нужно закомментировать следующее:
    #start on (filesystem
    #         and started hal
    #         and tty-device-added KERNEL=tty7
    #         and (graphics-device-added or stopped udevtrigger))
    #stop on runlevel [016]

    emits starting-dm

    respawn

    script
        [ ! -f /etc/X11/default-display-manager -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/gdm" ]

        # Check kernel command-line for inhibitors
        for ARG in $(cat /proc/cmdline)
        do
            case "${ARG}" in
                text|-s|s|S|single)
                    exit 0
                    ;;
            esac
        done

        if [ -r /etc/default/locale ]; then
            . /etc/default/locale
            export LANG LANGUAGE
        elif [ -r /etc/environment ]; then
            . /etc/environment
            export LANG LANGUAGE
        fi

        initctl emit starting-dm DM=gdm

        exec gdm-binary $CONFIG_FILE
    end script
Обратите внимание, что я закомментировал строки start on и stop on. Теперь вы сможете запускать X-сервер и графический менеджер с помощью /etc/init.d/gdm start (даже более правильно — initctl start gdm), но автоматически при запуске компьютера он стартовать не будет.
По материалам сайта http://tech.akom.net/

05.01.13

Настройка Rutorrent для работы с Nginx


После долгого использования rtorrent в консольном режиме решил наконец прикрутить к нему rutorrent Почему именно rutorrent? Потому что насколько я понял морда wtorrent с nginx не дружит совсем. Итак, я не буду рассказывать сейчас как настраивать rtorrent, тот кто читает наверняка уже его использует давно,а расскажу конкретно как к rtorrent прикрутить веб морду. Везде где я читал rutorrent слушал порт по протоколу TCP/IP, но я считаю использование unix socket будет и безопаснее как то правильнее чтоли. Приступим: Для начала нам нужно иметь хотя бы рабочий nginx, rtorrent собранный

--with-xmlrpc
и собственно сам rutorrent с плагином RPC Скачиваем по этим двум ссылкам и расспаковываем:
cd /srv/http sudo tar -xvzpf /path/to/rutorrent-3.1.tar.gz
После чего переходим в директорию plugins:
cd /srv/http/rutorrent/plugins  sudo tar -xvzpf /path/to/rpc-3.1.tar.gz
Меняем владельца директории rutorrent на того от которого запущен nginx,например http
sudo chown -R http:http /srv/http/rutorrent/
Затем открываем вашим любимым текстовым редактором конфигурационный файл rutorrent
nano -w /srv/http/rutorrent/conf/config.php
и прописываем порт и хост для прослушки:
$scgi_port = 0; $scgi_host = "unix:///tmp/ru.sock";
Далее открываем конфиг rtorrent'a
nano ~/.rtorrent.rc
и прописываем адрес сокета который будет создавать rtorrent при старте.
scgi_local = /tmp/ru.sock
Единственная загвоздка в том что запуск rtorrent у меня происходит от другого пользователя нежели запуск nginx. Проблема эта решается путем добавления в init скрипт rtorrentd нужного umask. Прямо в скрипте прописываем:
umask 111
Теперь займемся nginx'ом: Создадим новый локэйшен для этого:
location /rutorrent {
root /srv/http/; 
auth_basic "You need the password";
auth_basic_user_file /etc/nginx/conf/torrent; 

} location ~* \.php$ { index index.html; fastcgi_pass unix:/tmp/ru.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/http$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; }
Теперь при обращении www.yourdomain.ru/rutorrent будет открываться веб морда rutorrent. Хочу заметить что ее надо скрыть от посторонних глаз. Так как сам rutorrent не обладает никакими собственными методами аутенфикации мы сделали ее средствами nginx и прописали выше:

auth_basic "You need the password";  auth_basic_user_file /etc/nginx/conf/torrent
Теперь создадим с помощью httpasswd (утилита Apache) зашифрованный пароль и запишем его хеш в /etc/nginx/conf/torrent.

sudo htpasswd -b /etc/nginx/conf/torrent your_login your_password
Собственно все, теперь перезапускаем nginx и rtorrent и открываем в браузере http://127.0.0.1/rutorrent. Выдастся запрос на авторизацию после ввода которого вы можете рулить закачками на сервере хоть с дивана, хоть с работы.

02.01.13

настройки для zsh под разными терминалами


case "${TERM}" in
linux)
     bindkey "^[[2~" yank
     bindkey "^[[3~" delete-char
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[1~" beginning-of-line
     bindkey "^[[4~" end-of-line
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
;;

cons*)
     bindkey "^[[H" beginning-of-line
     bindkey "^[[F" end-of-line
     bindkey "^?" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;

xterm*)
     bindkey "^[OH" beginning-of-line
     bindkey "^[OF" end-of-line
     bindkey "^[[3~" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;
   
rxvt)
     bindkey "^[[7~" beginning-of-line
     bindkey "^[[8~" end-of-line
     bindkey "^[[3~" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;
screen*)
     bindkey "^[[1~" beginning-of-line
     bindkey "^[[4~" end-of-line
     bindkey "^[[3~" delete-char
     bindkey "^[[2~" overwrite-mode
   
     bindkey "^[[5~" up-line-or-history
     bindkey "^[[6~" down-line-or-history
     bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
     bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
     bindkey " " magic-space ## do history expansion on space
     bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
;;

esac

freebsd 9.1-RELEASE


The first release candidate of the 9.1-RELEASE release cycle is now
available on the FTP servers for amd64, i386, and powerpc64.  The
MD5/SHA256 checksums are at the bottom of this message.  The ISO images
and, for architectures that support it, the memory stick images are
available here:

  ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.1/

(or any of the FreeBSD mirror sites).

Current plans are for there to be one more RC build, followed by the
release itself.  The current target schedule is here:

  http://www.freebsd.org/releases/9.1R/schedule.html

If you notice any problems you can report them through the normal Gnats
PR system or here on the -stable mailing list.

With both the doc and ports repositories now moved to SVN it has been
decided to not export the 9.1 release branch activity to CVS.  So
csup/cvsup update mechanisms are not available for updating to 9.1-RC1.
If you would like to use SVN the branch to use is releng/9.1.

The freebsd-update(8) utility supports binary upgrades of i386 and amd64 
systems running earlier FreeBSD releases.  Systems running 9.0-RELEASE
can upgrade as follows:

# freebsd-update upgrade -r 9.1-RC1

During this process, FreeBSD Update may ask the user to help by merging 
some configuration files or by confirming that the automatically performed
merging was done correctly.

# freebsd-update install

The system must be rebooted with the newly installed kernel before 
continuing.

# shutdown -r now

After rebooting, freebsd-update needs to be run again to install the new 
userland components, and the system needs to be rebooted again:

# freebsd-update install
# shutdown -r now

Users of earlier FreeBSD releases (FreeBSD 7.X, 8.X) can also use
freebsd-update to upgrade to FreeBSD 9.1-RC1, but will be prompted to
rebuild all third-party applications (e.g., anything installed from the
ports tree) after the second invocation of "freebsd-update install", in
order to handle differences in the system libraries between FreeBSD 7.X
or FreeBSD 8.X and FreeBSD 9.X.

PACKAGESITE 9.1 freebsd


-RELEASE is a snapshot of -STABLE, basically. Packages are built for -RELEASE once its out and no more. On the other hand they are rebuilt every two, three weeks for packages on -STABLE.

You don't have to use -STABLE to get packages from -STABLE version. Just set PACKAGESITE env like so:

setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/