### 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
понедельник, 20 декабря 2010 г.
пятница, 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.
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.
вторник, 23 ноября 2010 г.
extracting flv from a rtmp stream
There are several tools to create flv files from a rtmp stream in linux, two of them being rtmpdump and its fork flvstreamer.
I tried to retrieve a stream where i constantly got ping messages in the process and it just stopped, so i looked for alternative ways.
The one i found was this huge script, which did crash on me: http://ubuntuforums.org/showthread.php?t=1159309
I was unwilling to search for the error or analyze the stream myself, so i came up with the following solution:
Works quite reliable for me and is not as much code as the script which does not work.
If you end up downloading huge masses of files you can check them using flvtool2 with this script:
It returns "true" or "false", depending if projected filesize and actual filesize are equal, which means an incomplete file returns "false".
source: http://my.opera.com/dduenker/blog/show.dml/21695332
I tried to retrieve a stream where i constantly got ping messages in the process and it just stopped, so i looked for alternative ways.
The one i found was this huge script, which did crash on me: http://ubuntuforums.org/showthread.php?t=1159309
I was unwilling to search for the error or analyze the stream myself, so i came up with the following solution:
- capture stream with tcpdump
- extract streaming data with tcpflow
- pipe data through netcat
- connect rtmpdump to netcat
- ???
- profit!
sudo tcpdump -i ~device~ -p -s 0 -w ~dumpfile~ -v tcp src port 1935 tcpflow ~dumpfile~ # or use wireshrack like that http://www.youtube.com/watch?v=hNe70CbTlng cat ~streamfile~ |netcat -l 1935& rtmpdump -r "rtmp://localhost/streamer/stream.flv" -o
Works quite reliable for me and is not as much code as the script which does not work.
If you end up downloading huge masses of files you can check them using flvtool2 with this script:
#!/bin/sh if [ "$1" = "" ] then echo "no filename given" exit fi if [ $(stat -c%s "$1") -eq 0 ] then echo false exit fi if [ $(stat -c%s "$1") -eq `flvtool2 -P $1 /dev/null|grep filesize|sed 's/[^0-9]//g'` ] then echo true else echo false fi
It returns "true" or "false", depending if projected filesize and actual filesize are equal, which means an incomplete file returns "false".
source: http://my.opera.com/dduenker/blog/show.dml/21695332
вторник, 28 сентября 2010 г.
среда, 8 сентября 2010 г.
mc colors schema
~/.mc/ini
[Colors]
base_color=normal=,default:selected=,:marked=,default:markselect=,:menu=,:menuhot=,:menusel=,:menuhotsel=,:dnormal=,:dfocus=,:dhotnormal=,:dhotfocus=,:input=,:reverse=,:executable=,default:directory=,default:link=,default:device=,default:special=,:core=,:helpnormal=,:helplink=,:helpslink=,:
or
[Colors]
base_color=lightgray,default:normal=lightgray,default:selected=black,green:marked=yellow,default:markselect=white,green:errors=white,red:menu=lightgray,default:reverse=black,lightgray:dnormal=white,default:dfocus=black,green:dhotnormal=brightgreen,default:dhotfocus=brightgreen,green:viewunderline=brightred,default:menuhot=yellow,default:menusel=white,black:menuhotsel=yellow,black:helpnormal=black,lightgray:helpitalic=red,lightgray:helpbold=blue,lightgray:helplink=black,cyan:helpslink=yellow,default:gauge=white,black:input=black,green:directory=white,default:executable=brightgreen,default:link=brightcyan,default:stalelink=brightred,default:device=brightmagenta,default:core=red,default:special=black,default:editnormal=lightgray,default:editbold=yellow,default:editmarked=black,cyan:errdhotnormal=yellow,red:errdhotfocus=yellow,lightgray
[Colors]
base_color=normal=,default:selected=,:marked=,default:markselect=,:menu=,:menuhot=,:menusel=,:menuhotsel=,:dnormal=,:dfocus=,:dhotnormal=,:dhotfocus=,:input=,:reverse=,:executable=,default:directory=,default:link=,default:device=,default:special=,:core=,:helpnormal=,:helplink=,:helpslink=,:
or
[Colors]
base_color=lightgray,default:normal=lightgray,default:selected=black,green:marked=yellow,default:markselect=white,green:errors=white,red:menu=lightgray,default:reverse=black,lightgray:dnormal=white,default:dfocus=black,green:dhotnormal=brightgreen,default:dhotfocus=brightgreen,green:viewunderline=brightred,default:menuhot=yellow,default:menusel=white,black:menuhotsel=yellow,black:helpnormal=black,lightgray:helpitalic=red,lightgray:helpbold=blue,lightgray:helplink=black,cyan:helpslink=yellow,default:gauge=white,black:input=black,green:directory=white,default:executable=brightgreen,default:link=brightcyan,default:stalelink=brightred,default:device=brightmagenta,default:core=red,default:special=black,default:editnormal=lightgray,default:editbold=yellow,default:editmarked=black,cyan:errdhotnormal=yellow,red:errdhotfocus=yellow,lightgray
Подписаться на:
Сообщения (Atom)