Archive

Archive for the ‘Unix’ Category

Squid Proxy Server Mac Address based filtering

June 16th, 2010 admin No comments

To set up ACL’s based on MAC address:

Open squid.conf:

# vi /etc/squid/squid.conf

Local acl, section and append ACL as follows:

acl macf1 arp mac-address
acl macf2 arp 00:11:22:33:44:55
http_access allow macf1
http_access allow macf2
http_access deny all

Save and close the file. Restart squid server:

# /etc/init.d/squid restart

Freebsd: Install wget Utility To Download Files From The Internet

June 7th, 2010 emran No comments

Install wget Using FreeBSD Ports Collection

Type the following command as root user to upgrade ports tree, enter:

# portsnap fetch update

Now, install the wget, enter:

# cd /usr/ports/ftp/wget
# make install clean
# rehash

Categories: FreeBSD, Unix Tags:

OpenSIPS Externel Perl Script Run

June 7th, 2010 emran No comments

You can easily redirect any sip uri based on opensips exec.so module on perl script. you need to load

loadmodule “exec.so”

In the route section you have to exec perl script with paramter $tu (To username) and $fu (from Username).

route {

if(method == “INVITE”) {
exec_dset(“/usr/local/bin/route.pl $fU $tU”);
sl_send_reply(“302″,”LCR Redirect”);
} else {
route(1);
}

}

In the perl script just write the follow code:

#!/bin/sh
echo sip:+121242415112@howtonix.com

NOTE: To get this to work correctly with Asterisk you need to add “promiscredir=yes” to the general section of your sip.conf

FreeBSD Install Lighttpd Web Server

June 7th, 2010 admin No comments

Lighttpd a secure, fast, compliant and very flexible web-server which has been optimized for high-performance environments. It has a very low memory footprint compared to other webservers and takes care of cpu-load.

Lighttpd on FreeBSD:

First update your port tree by typing following commands:

# portsnap fetch
# portsnap update

Install lighttpd web server under FreeBSD

Lighttpd port is located under /usr/ports/www/lighttpd:

# cd /usr/ports/www/lighttpd

Install lighttpd:

# make
# make install
# make clean

Start Lighttpd Server Under FreeBSD

To start Lighttpd server, enter:

# /usr/local/etc/rc.d/lighttpd start

Verify that lighttpd is running:

# netstat -nat

Auto start lighttpd service

You need to enable both services. Open /etc/rc.conf:

# vi /etc/rc.conf

Append following two lines:

lighttpd_enable="YES"

List of TCP and UDP port numbers

September 29th, 2009 emran No comments

The following link contains list of TCP and UDP ports:

http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

Categories: CentOS, Debian, Fedora, FreeBSD, Mandrake, NetBSD, OpenBSD, SuSE Tags:

Adding custom route on Debian network script

September 27th, 2009 emran No comments

Add the following line on /etc/network/interfaces

up route add -net 172.22.0.0 netmask 255.255.254.0 gw 192.168.15.101 dev eth0 (The connected Hardware interface.)

Now restart the network service by

#/etc/init.d/networking restart

Categories: CentOS, Debian, Fedora, FreeBSD, Linux Tags:
7 visitors online right now
7 guests, 0 members
Max visitors today: 8 at 11:34 pm UTC
This month: 8 at 09-03-2010 11:34 pm UTC
This year: 43 at 06-10-2010 04:02 pm UTC
All time: 43 at 06-10-2010 04:02 pm UTC