Me :)

Your comments & suggestions may be mailed to:

Copyright ї 1998 Taras Plakhotnichenko
Most recent revision 23 Dec 2011

стрельба из лука в России

The first archery dedicated WEB site in Russia

Добавляем новый диск в логический том
Переделка публичного ключа после виндового puttygen
Устанавливаем RVM (ruby version manager)
Загрузка в режиме text mode only (CentOS 6.1)
Dropbox клиент для линукса
Backup через rsync

Переделка публичного ключа после виндового puttygen:

ssh-keygen -i -f taras.key >> authorized_keys

Добавляем новый диск в логический том:

#make phisical volume
pvcreate /dev/sdc

#extend existing volume group with new phisical volume
vgextend VolGroup /dev/sdc
#create logical volume
lvcreate -l 100%FREE -n backup VolGroup

#make file system
mke2fs -b 4096 /dev/VolGroup/backup

#check file system
e2fsck -p /dev/VolGroup/backup

#mount it
mount /dev/VolGroup/backup /mnt/backup/

Устанавливаем RVM (ruby version manager):

yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel svn sqlite-devel
yum install git
yum install curl
sudo bash -s stable < <(curl -s )
rvm pkg install zlib
rvm pkg install openssl
rvm --skip-autoreconf pkg install iconv
rvm install 1.9.2 --with-zlib-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr --with-iconv-dir=$rvm_path/usr
#or if the previos step can't help to install rails:
#rvm install 1.9.2
usermod -a -G rvm user
su - user
testing: type rvm | head -1 #rvm is a function
rvm --default 1.9.2
testing: ruby -v
rvm all do gem install rails
#testing: ruby -ropenssl -rzlib -rreadline -e "puts 'Happy new Ruby'"
rvm all do gem install execjs
rvm all do gem install therubyracer
rails new myapp
cd ~./myapp
rails server

#if you get "Could not find a JavaScript runtime"on issueing "rails server":
#add to Gemfile (in ./myapp directory) the string: gem 'therubyracer'
#on normal startup of rails server you'll get something like this:

=> Booting WEBrick
=> Rails 3.1.3 application starting in development on
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-01-08 01:56:32] INFO WEBrick 1.3.1
[2012-01-08 01:56:32] INFO ruby 1.9.2 (2011-07-09) [i686-linux]
[2012-01-08 01:56:32] INFO WEBrick::HTTPServer#start: pid=25039 port=3000

Type localhost:3000 in your browser and you get something like this:

Загрузка в режиме text mode only (CentOS 6.1):

vi /boot/grub/grub.conf
В строке kernel.... убираем: rhgb quiet

Dropbox клиент для линукса:

cd ~ && wget -O - | tar xzf -

Backup через rsync (CentOS 6.1):

# destination directory
path = /home
# Hosts you allow to copy (specify source Host)
hosts allow =
hosts deny = *
list = true
uid = root
gid = root
read only = false

# default: off
# description: The rsync server is a good addition to an ftp server, as it
# allows crc checksumming etc.
service rsync
{ disable = no
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID

#my @holidays = ('30','31','01','02','03','04','05','06','07','08','09');
#my $day = `date +%d`;
#if (map /$day/, @holidays) {print "holiday day - there's no need for backup\n"; exit;};
my $date=`date +%Y%m%d`;
my $date_before_yesterday=`date +%Y%m%d --date="2 days ago"`;
`rsync -arzv -e "ssh -l root" /home/backup/TMP`;
system("cd /home/backup/TMP; tar -czPf /home/backup/RUBY-x86_HOME/ruby-x86_home_$date.tar.gz ./");
`chown backup:backup /home/backup/RUBY-x86_HOME/ruby-x86_home_$date.tar.gz`;
`rm -rf /home/backup/TMP/*`;
`rm -f "/home/backup/RUBY-x86_HOME/ruby-x86_home_$date_before_yesterday.tar.gz"`;