čtvrtek 27. září 2012

How to use ngrep to capture SIP packets

It`s easy. With natural line breaks:

ngrep -W byline -d eth0 port 5060

To file:

ngrep -W byline -d eth0 port 5060 -O capture_file

Just INVITEs:

ngrep -W byline -d eth0 INVITE

Icinga monitoring how to

Icinga is a Nagios fork and still use Nagios plugins and NRPE/NSCA for distant monitoring. Let see how to make it work on Debian machine.  

1. Prepare
/usr/sbin/useradd -m icinga passwd icinga /usr/sbin/groupadd icinga /usr/sbin/groupadd icinga-cmd /usr/sbin/usermod -a -G icinga-cmd icinga /usr/sbin/usermod -a -G icinga-cmd www-data
2. Download from Sourceforge: http://sourceforge.net/projects/icinga/
tar xvzf icinga-x.tar.gz
./configure --with-command-group=icinga-cmd

How to ACL`s on Linux

aptitude install acl  
mount -o remount,acl /dev/hda3  
setfacl -R -m u:user:rwx /var/tmp/file  
setfacl -R -m g:group:rwx /var/tmp/file
 
“-R” is recursive. To see ACL rights just write

getfacl /var/tmp/file

And you`ll see something like this:

# file: var/tmp/file # owner: group # group: group user::rwx user:user:rwx group::rw- group:group:rwx mask::rwx other::---

And next you can add more users/groups rights to this file ;-)

How to sshfs

Almost like scp, or rsync syntax.
sshfs user@host:/path/to /local/path
And obviously if it isn`t working :)
modprobe fuse

středa 18. srpna 2010

SIP over TCP in Asterisk

Do sip.conf treba:

tcpenable=yes ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)


Do users.conf pre jednotliveho uzivatela, pripadne globalne do sip.conf treba:

[6000]
...
transport=tcp
...

úterý 3. srpna 2010

iLBC & SPEEX kodek na Asterisku

Kodeky s ktorymi som experimentoval hlavne koli potrebe co najmensieho datoveho toku pri telefonovani cez 3G siete.

Instalacia iLBC kodeku

Od 1.6 verzie Asterisku nie je iLbc standartnou vybavou, treba stiahnut rucne.. Asterisk ma na to vsak pripraveny script, kde po odsuhlaseni licencie stiahne vsetko potrebne:
cd /usr/src/asterisk-*/
./contrib/scripts/get_ilbc_source.sh
./configure
make menuconfig (vybrat iLbc v codecs sekcii)
make install

Nasledne treba povolit codec bud globalne v sip.conf, alebo pre kazdeho uzivatela zvlast:
disallow=all
allow=ilbc
allow=dalsikodek

A nakoniec kontrola:
asterisk -vvvvvvvvvvvvvr
load codec_ilbc.so
core show codecs
core show translations

Odkazy pre iLBC:

http://www.voip-info.org/wiki/view/iLBC

http://blogs.elastix.org/en/2009/11/ilbc-vs-g729-the-quick-guide-to-using-compressed-codecs-in-elastix/

Instalacia SPEEX kodeku
Na Debiane napiseme nasledovne:

aptitude install speex libspeex-dev
Potom je potrebne skompilovat Asterisk. Najprv spustime ./configure a nasledne v menuconfig oznacime podporu kodeku SPEEX v sekcii Codec Translators. Nasleduje obligatne make a make install.

V pripade,ze uz mame Asterisk skompilovany a kodek chceme pridat, musime spustit make distclean, aby sme Asteriska prinutili si podporu SPEEX natiahnut.

V pripade potreby rucnej kompilacie kodeku, je potrebne stiahnut si zdrojaky z adresy:
http://downloads.us.xiph.org/releases/speex/

pondělí 29. března 2010

How to Boinc on Linux (Debian)

At first:

aptitude install boinc-client boinc-manager

Then you have to create password for localhost, so open file and write your password on it.:

vim /etc/boinc-client/gui_rpc_auth.cfg

Restart client:

/etc/init.d/boinc-client restart

Next we want to attach to some Boinc project.

Find out your account key:

boinc_cmd --host localhost --passwd your_localhost_password --lookup_account http://einstein.phys.uwm.edu/ account_name account_password

Connect to project with your account key:

boinc_cmd --host localhost --passwd your_localhost_password --project_attach http://einstein.phys.uwm.edu/ your_account_key

Check Boinc state:

boinc_cmd --host localhost --passwd your_localhost_password --get_state

P.S.
Boinc client and his tasks usually running with nice 19.