ноября 23, 2009
октября 28, 2009
октября 18, 2009
Putty autologin shortcuts
"C:\Program Files\PuTTY\putty.exe" -v -ssh -2 -P 22 -C -A -l USERNAME -pw VERYSECRETPASSWORD VERY.SECRET.HOST
августа 16, 2009
Freebsd in Vmware Server
in /boot/device.hints
hint.acpi.0.disabled="1"
in /boot/loader.conf
kern.hz=100
nt.apic.0.disabled=1
beastie_disable="NO"
loader_color="YES"
августа 04, 2009
Проблема с клавиатурой при установке гостевой FreeBSD в VmWare (freebsd vmware keyboard problem)
Не работает клавиатура в гостевой FreeBSD. Даже невозможно установить ОС.
Рецепт простой:
echo "xkeymap.nokeycodeMap = true" >> /etc/vmware/config
echo "xkeymap.nokeycodeMap = true" >> ~/.vmware/config
июля 13, 2009
Downloading and building the H264 Streaming Module for Lighttpd (version 2) in Ubuntu Server 8.04
Вот листинг. На сервере заранее настроен pgp с моими ключами. Будет время - дополню комментариями.
Downloading and building the H264 Streaming Module for Lighttpd (version 2) in Ubuntu Server 8.04.2
based on http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Lighttpd-Version2
sergey@vm-4-build:~/$ mkdir ~/debs
sergey@vm-4-build:~/$ cd debs
sergey@vm-4-build:~/debs$ sudo apt-get install subversion automake devscripts fakeroot autogen libtool build-essential
sergey@vm-4-build:~/debs$ sudo apt-get build-dep lighttpd
sergey@vm-4-build:~/debs$ apt-get source lighttpd
sergey@vm-4-build:~/debs$ ls
lighttpd-1.4.19 lighttpd_1.4.19-5ubuntu7.dsc lighttpd_1.4.19-5ubuntu7.diff.gz lighttpd_1.4.19.orig.tar.gz
sergey@vm-4-build:~/debs$ svn export http://h264.code-shop.com/svn/h264/tags/mod_h264_streaming-2.0/lighttpd-1.4.18 lighttpd-1.4.18
sergey@vm-4-build:~/debs$ svn export --force http://h264.code-shop.com/svn/h264/tags/mod_h264_streaming-2.0/mp4split lighttpd-1.4.18/src
sergey@vm-4-build:~/debs$ ls
lighttpd-1.4.19 lighttpd_1.4.19-5ubuntu7.dsc lighttpd-1.4.18 lighttpd_1.4.19-5ubuntu7.diff.gz lighttpd_1.4.19.orig.tar.gz
sergey@vm-4-build:~/debs$ cp lighttpd-1.4.18/src/moov.* lighttpd-1.4.19/src/
sergey@vm-4-build:~/debs$ cp lighttpd-1.4.18/src/mod_h264_streaming.c lighttpd-1.4.19/src/
sergey@vm-4-build:~/debs$ vi lighttpd-1.4.19/src/Makefile.am
например после mod_flv_streaming.la добавляем:
lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c moov.c
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = $(common_libadd)
sergey@vm-4-build:~/debs$ vi lighttpd-1.4.19/debian/rules
в конце секции DEB_CONFIGURE_EXTRA_FLAGS +=
добавляем:
--with-mod-h264-streaming --with-mod-secure-download --with-mod-flv-streaming
sergey@vm-4-build:~/$ cd lighttpd-1.4.19
sergey@vm-4-build:~/debs/lighttpd-1.4.19$ ./autogen.sh
sergey@vm-4-build:~/debs/lighttpd-1.4.19$ export EMAIL=MY-EMAIL@gmail.com
sergey@vm-4-build:~/debs/lighttpd-1.4.19$ export DEBFULLNAME="MY-NAME"
sergey@vm-4-build:~/debs/lighttpd-1.4.19$ export DEBEMAIL=MY-EMAIL@gmail.com
sergey@vm-4-build:~/$ dch -i
sergey@vm-4-build:~/debs/lighttpd-1.4.19$ dpkg-buildpackage -rfakeroot
sergey@vm-4-build:~/debs/lighttpd-1.4.19$ cd ../ && la -la | grep deb
lighttpd_1.4.19-5ubuntu7_i386.deb
lighttpd-doc_1.4.19-5ubuntu7_all.deb
lighttpd-mod-cml_1.4.19-5ubuntu7_i386.deb
lighttpd-mod-magnet_1.4.19-5ubuntu7_i386.deb
lighttpd-mod-mysql-vhost_1.4.19-5ubuntu7_i386.deb
lighttpd-mod-trigger-b4-dl_1.4.19-5ubuntu7_i386.deb
lighttpd-mod-webdav_1.4.19-5ubuntu7_i386.deb
sergey@vm-4-build:~/$ вуаля!
Vmware Server 2. "RuntimeFault: Database temporarily unavailable or has network problems" при добавлении Permission.
/etc/init.d/vmware-mgmt stop
vim /etc/vmware/hostd/authorization.xml
параметр <NextAceId> меняем на 50.
/etc/init.d/vmware-mgmt start
и все.
июля 01, 2009
Openfire encoding offline messages & rosters in UTF8
С какой-то версии у популярного Jabber сервера Openfire (бывший Wildfire) появились проблемы с хранением в базе данных оффлайн сообщений и ростеров в симолах, отличных от латиницы. Не пишу, что проблема с конкретной кодировкой, потому что с проблемой столкнулись все пользователи - не только пользователи с кирилллицей.
Проблема решается следующим образом:
1. базу данных для Openfire необходимо создать с указанием кодировок
CREATE DATABASE `openfire` CHARACTER SET utf8 COLLATE utf8_general_ci;
2. в настройка openfire.xml в описании подключения к mysql необходимо добавить строки:
<database>
<defaultProvider>
<driver>com.mysql.jdbc.Driver</driver>
.................
.................
<mysql>
<useUnicode>true</useUnicode>
</mysql>
</defaultProvider>
</database>
3. oбязательно указать в настройках сервера MySQL в секциях [client] и [mysqld]:
default-character-set = utf8
UPD. На просторах Интернета нашел более изящный вариант:
jdbc:mysql://[your_host]/[database_name]?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8
Цветные логи.
[sp@bastion: ~] % ssh sergey@develop.edu.lan cat /var/log/messages | ccze | less
блпгодаря ccze вывод будет следующий:
{скриншот}
мая 18, 2009
Remove "Online Help" and "openSUSE" icon in OpenSUSE
# cd /usr/share/dist/desktop-files/
/usr/share/dist/desktop-files # rm *
апреля 02, 2009
защита от хотлинка в NGINX (nginx hotlink protect)
location ~ \.flv$ {
flv;
}
location ~ \.(jpg|jpeg|gif|mpg|mpeg|wmv|avi|flv)$ {
access_log off;
valid_referers none blocked server_names *.site.com/;
if ($invalid_referer) {
return 403;
}
}
марта 10, 2009
Opera Speedial collumns
[Size]
Rows=3
Columns=4
марта 04, 2009
Virtualbox to Vmware (convert .vdi to .vmdk)
февраля 23, 2009
shell
ZSH:
в .zshrc
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 "^R" history-incremental-search-backward
CSH:
в .cshrc:
bindkey -k up history-search-backward
bindkey -k down history-search-forward
BASH:
в .inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
февраля 19, 2009
Ubintu/Debian + PHP-FastCGI + Nginx
Необходимо установить пакеты php5-cgi php-cgiwrap + все необходимые модули php.
Скрипт автозапуска php-fastcgi
/etc/init.d/php-fastcgi
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: php-fastcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description: Start and stop php-cgi in external FASTCGI mode
### END INIT INFO
#
# Do NOT "set -e"
# Default values are enclosed in []PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Start php-fastcgi? [no]
START=yes
# Read configuration data
NAME=php-fastcgi
DESC="php-cgi runing in external FASTCGI mode"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Daemon pathname and args: IP=[127.0.0.1], port=[9000]
# /usr/bin/php-cgi links to -> /etc/alternatives/php-cgi -> /usr/bin/php5-cgi
DAEMON=/usr/bin/php-cgi
DAEMON_ARGS="-q -b 127.0.0.1:9000"
# Which user runs PHP? [www-data]
EXEC_AS_USER=www-data
# php-cgi env. variables: spawned children [5] , concurrent requests [1000]
PHP_FCGI_CHILDREN=5
PHP_FCGI_MAX_REQUESTS=125
export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS
# Exit if php-cgi is not installed
[ -x "$DAEMON" ] || exit 0
# Load rcS variable settings and set (re)start/stop verbosity
[ -f /etc/default/rcS ] && . /etc/default/rcS
VERBOSE=yes
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# If $START not 'yes' AND we are not stopping the $DAEMON
if [ "$START" != "yes" -a "$1" != "stop" ]; then
log_warning_msg "To enable $NAME, edit /etc/init.d/$NAME and set
START=yes"
exit 0
fi
do_start()
{
# Return values: 0=started ok,1=already running,2=unable to start
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
--test > /dev/null || return 1
start-stop-daemon --start --quiet --background \
--chuid $EXEC_AS_USER --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON -- $DAEMON_ARGS \
|| return 2
}
do_stop()
{
# Return values: 0=stopped ok,1=already stopped,2=unable to stop,
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
--pidfile $PIDFILE > /dev/null # --name $DAEMON
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
--exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
февраля 18, 2009
Virtualbox на OpenSuse 11.1
февраля 17, 2009
OpenSuse 11.1
Зато потом открыл для себя линукс, который устраивает всем "из коробки" - от набора ПО (а я устанавливал с liveCD, а не с DVD!) и фреймбуфера до дефолтной темы и шрифтов, которые так и оставил - понравилось. OpenSuse сейчас на ноутбуке, основном рабочем компьютере и дома на десктопе. Набор ПО везде одинаковый. Первая установка и настройка заняла около часа. Потом штатными средствами перенес все установленное ПО и настройки сервис-паком с помощью штатных средств. Особенно порадовали YasT и документация.
Ставил по совету коллеги: "Мастерство не пропьешь, а новелл - стрелянный воробей в дистростроительстве".
p.s. Не удивляйтесь - я и сам удивлен.
февраля 09, 2009
ZFS Time Slider рекомендую к просмотру и прочтению
2. И весьма эффектный ZFS Time Slider: http://blogs.sun.com/erwann/entry/zfs_on_the_desktop_zfs
января 16, 2009
января 13, 2009
Установка программ из исходников
Но иногда приходится. Допустим необходимой программы нет в репозитории, или она не той версии. Лучшей отговоркой будет - тестирование новых версий ПО. Правильный путь в этом случае - сборка пакетов. Но часто это лень делать. Нашел программу: Paco - менеджер установленного из исходников ПО (http://paco.sourceforge.net/)
Paco is a source code package organizer for Unix/Linux systems, originally written to aid package management when installing an LFS system.
When installing a package from sources, paco wraps the "make install" command (or whatever is needed to install the files into the system), and generates a log containing the list of all installed files.
Technically, this is done by preloading a shared library before installation using the environment variable LD_PRELOAD. During installation this library catches the system calls that cause filesystem alterations, logging the created files.
Like any other package manager, paco also provides several options to show package information in different formats. It can remove packages too, among some other basic operations. See the man page for more details.
Gpaco is the graphic interface of paco. It's included in the same tarball and installed by default, althought it can be disabled at configure time. Gpaco requires GTK+ (2.6 or later). As of version 2.0.0 gpaco requires also GTKMM (2.8 or later).
See some screenshots here.
Paco is protected by the GNU General Public License. Look at the COPYING file in the tarball for more details.
Рекомендую для самых ленивых.
midnight commander в gnome-terminal
gnome-terminal -t mc --default-working-directory=~ --hide-menubar --geometry 140x40+100+100 -e mc
января 05, 2009
как в Ubuntu отключить спикер.
echo "blacklist pcspkr" /etc/modprobe.d/blacklist
и перезагрузиться
либо rmmod pcspkr
p.s. Система: Ubuntu 8.10, ядро - 2.6.28
