понедельник, 20 декабря 2010 г.

share OpenVpn server LAN

### VPN share server LAN
cat /proc/sys/net/ipv4/ip_forward
iptables  -t nat -A POSTROUTING -s 10.50.0.0/24 -o vmbr0 -j MASQUERADE

пятница, 17 декабря 2010 г.

linux RAM

Список процессов отсортированый по потребляемой памяти

ps -eo pid,ppid,rss,vsize,pcpu,pmem,cmd -ww --sort=rss
 
VSIZE (Virtual memory SIZE) - The amount of memory the process is
    currently using. This includes the amount in RAM and the amount in
    swap.

    RSS (Resident Set Size) - The portion of a process that exists in
    physical memory (RAM). The rest of the program exists in swap. If
    the computer has not used swap, this number will be equal to
    VSIZE.
 
Очистить кэшированую память
# sync; echo 3 > /proc/sys/vm/drop_caches

четверг, 16 декабря 2010 г.

autologon in linux

Вариант 1
Закомментировать в /etc/inittab строчку
   1:2345:respawn:/sbin/getty 38400 tty1
т.е.
#  1:2345:respawn:/sbin/getty 38400 tty1
ниже  ее добавить
   1:2345:respawn:/bin/login -f YOUR_USER_NAME tty1 /dev/tty1 2>&1

в /home/YOUR_USER_NAME в .bashrc или .bash_profile добавить строку для авто запуска иксов

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
    startx
fi

Вариант 2 
1) в /etc/inittab комментируем туже строку но добавляем:
   1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologin 38400 tty1
2)
su -
mkdir -p /usr/local/sbin/
touch /usr/local/sbin/autologin
chmod u+x /usr/local/sbin/autologin


3) nano /usr/local/sbin/autologin добавляем
#!/usr/bin/python
import os
os.execlp('login', 'login', '-f', 'my_user_name', '0')
 



4) ~/.bashrc добавить
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
   startx
fi

воскресенье, 12 декабря 2010 г.

upgrade minor version of OpenERP

For each minor version like this one, the procedure is simple because there is no change that requires a real migration.

1. Make a fresh backup of all existing databases, as well as a backup of the files of your OpenERP installation (server, web and addons), just in case.
2. Stop the OpenERP server as well as Web Server (if present).
3. Update the source files to the latest release, or simply install the new releases over the previous ones.
4. Start the server once with the following additional parameters, to trigger an update of all module data and views in the database based on the new source files:
openerp-server.py -d DB_NAME -u all
(include your usual startup parameters too, and replace DB_NAME with the name of the OpenERP database you wish to update)
5. Stop the server and repeat step 4 for each database on this OpenERP installation (any database not updated will use the latest business logic but might have errors or missing improvements in the views until you update it using this procedure)
6. Stop the server again and restart it normally.
7. Start again the Web Server if present.
8. You can now proceed with the update of the clients, which can be done separately by simply reinstalling the latest version.