Ip Authentication in Kamailio **IP baseed Authentication in Kamailio for Peers. ** > route[PEER]{ if (allow_trusted("$si","$(proto)")) { xlog("L_INFO","\n\n–Trusted IP – $si – $proto"); record_route(); route(LCR); }; if (allow_address("1", "$si", "$sp")) { xlog("
Create View for simplifying LCR tables **MySQL View to simplify Kamailio LCR Tables ** > create view openser.nt_dialplan As SELECT t.rule_id,r.lcr_id,prefix,from_uri,stopper,enabled,gw_id,priority,weight FROM lcr_rule r, lcr_rule_target t WHERE r.id = t.rule_id
iptables Iptables Neat Tips Separate Log File For Iptables : vi /etc/syslog.conf -------------------------------------------------------------------------------- Append to the file : kern.warning /var/log/iptables.log Restart syslog daemon. Now you can block any ip and log it to the file iptables -A INPUT -s x.x.x.x -m limit --limit 5/m --limit-burst 7
Kamailio Nat Traversal using RTPProxy 1. Install rtpproxy : > `http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz``` > tar -zxvf rtpproxy-1.2.1.tar.gz<br></br> cd rtpproxy-1.2.1<br></br> ./configure<br></br> make<br><
Using LCR with kamailio Follow the tutorial here to implement LCR with kamailio : 1. Add lcr.so to load module loadmodule lcr.so 2. Add required parameters to the module modparam(“lcr”,”db_url”,DBURL) modparam(“lcr”, “gw_uri_avp”, “$avp(i:709)”) modparam(“lcr”, “ruri_user_avp”, “$avp(i:500)”) modparam(“lcr”, “flags_
Compiling additional modules kamailio If you need to install additional modules you might need after you install kamailio : 1. cd /usr/local/src/kamailio-3.1.1 2.make FLAVOUR=kamailio cfg 3.make install-modules modules=modules/lcr Assuming that lcr is the module that you want to install additionally.
Using Ngrep To capture network activity You can use ngrep to diagnose your sip or other network activity : Dependency : libpcap-devel yum install libpcap-devel Download ngrep [http://downloads.sourceforge.net/project/ngrep/ngrep/1.45/ngrep-1.45.tar.bz2?r=http%3A%2F%2Fngrep.sourceforge.net%2Fdownload.html&ts=1296767443&use_mirror=voxel] wget http:
Install kamailio from source Centos <strong>Dependencies :</strong><br></br> Yum install bison pcre-devel libpcap-devel``` **Installation :** 1. Go to /usr/local/src/ 2. Download The latest version of kamailio 3.1.2 from source : [Download Latest Kamailio Source Here](http://www.kamailio.org/pub/kamailio/latest/src/
Rest Mysql root Password Reset Mysql Root Password 1. Kill the mysql daemon by loggin in as root 2. Start mysql in safe mode : mysqld_safe --skip-grant-tables 3. SSH using another session or login to another terminal<br></br> 4. Connect to mysql without password, you should be able to
Using grep to display line that doesnot start with a pattern If you want to display a line, that does not begin with a pattern you can use grep to achieve that. It is specially useful when you want to view the lines that are not commented in a configuration file. grep -v “^;” ( This will display lines that dont start with
Use cron to sync time using ntp Sync the Time once a day at 2.00 `0 2 * * * /usr/sbin/ntpdate -s -b -p 8 -u``` or 0 2 * * * /usr/sbin/ntpdate -s -b -p 8 -u 0.us.pool.ntp.org
Sed Find a value between pattern Find and Display a line with a value (eg. ;value) sed -n '/startpattern/,/endpattern/{s/;value//p}' Filepath Print Value Between Two patterns Exclusive ( Single Line ): sed 's/.pattern1(.)pattern2.*/\1/' eg.Following code displays value between < and > sed 's/../\1/' Print
vi tips and tricks Delete leading spaces vi You can delete leading spaces in vi editor using the following command : :%s/^\s\s*//g
squid access control Block by url and url keywords in squid You can block access in squid by url and by keywords. To block by url or domain name.. acl blocksites dstdomain .example.com .test.com http_access deny blocksites To block access to websites by keyword : acl blockwords url_regex -i keyword1 keyword2 http_access deny blockwords Thanks
Configure DNS Server With Views This is a tutorial to configure bind dns server with Views . Views help you serve different results based on the query source. 1. Create an RNDC Key : key "rndc-key" { algorithm hmac-md5; secret "yourrndckeyhere"; } 2. Create a Transaction Signature Key : key "tsigkey" { algorithm "hmac-md5&
Remove Files from a List You can utilize bash to delete files from a list in text file : for i in cat filetoremove.txt ; do rm $i;done
Vi editor Tutorial and examples **Search and Replace ** Append a string to start of every other line: g#^# if line('.')%2|s#^#http://test # or :g/^/ if line('.')%2 | s/^/word/ or :g/^/ if line('.')%2|s/^/zz / Search and Replace a string : %s/string/newstring/ [ Options : g = Replace
Configure Linux As a router Configure Linux As A Router: 1. Enable Ip Forwarding in sysctl.conf net.ipv4.ip_forward=1 Configure Firewall, assuming eth0 as WAN Interface, eth1 is LAN Interface : iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -A FORWARD -i eth1 -j ACCEPT Port Forwarding With IPTables : -A PREROUTING
Cloning disk image in Vmware Server via Command You can clone images in vmware server via command line as : vmkfstools -i source.vmdk destination.vmdk
Configuring a Dynamic DNS Server Dynamic Dns : dnssec-keygen -a HMAC-MD5 -b 128 -n USER DYNAMIC_DNS_KEY cat Kdynamic_dns_key*.private key :sdflkjdfskdlfsjdfj vi /etc/named.conf key DYNAMIC_DNS_KEY{ algorithm hmac-md5; secret kdjfkdjkfd (key from above); }; zone "test.com" IN{ type master; file "data/master-example.com"; allow-update {key
Passwordless SSH 1. Create a key using putty gen. 2. Paste the content into .ssh/authorized_keys file . 3. You should be able to login without password. In linux you can generate the key using : ssh-keygen -t rsa Then copy the content of id_rsa.pub to .ssh/authorized_keys cat id_
Change login background in windows 7 You can change the login background in windows 7 without any hacks or software. Go to : C:\windows\system32\oobe Create a new folder called Info C:\windows\system32\obe\Info Now create a folder called backgrounds. C:\windows\system32\obe\Info\backgrounds Put the picture that you want to
Creating Alternating colors in a table It’s pretty awesome to have a table with alternating colors for the rows for readability. You can create the stylesheet as mentioned here : table { background-color: teal } table, td, th { border:1px solid green; border-collapse:collapse; vertical-align: middle; text-align: center; } tr.d0 td { background-color: #CC9999; color: black; } tr.d1 td