Archive for the ‘unix’ Category
Step By Step Of BIND9 Installation On Ubuntu Linux
Written by piju on April 29, 2010 – 12:30 pm -1. Install Bind9:
sudo apt-get install bind9
2. Copy these files:
# cp /etc/bind/db.local /etc/bind/piju.fakap.server
# cp /etc/bind/db.127 /etc/bind/piju.fakap.254
# cp /etc/bind/named.conf.default-zones /etc/bind/named.conf.server
3. Edit piju.fakap.server file:
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA piju.fakap.net. root.piju.fakap.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS piju.fakap.net.
IN A 192.168.1.1
www IN A 192.168.1.1
mail IN A 192.168.1.1
4. Edit file piju.fakap.254:
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA piju.fakap.net. root.piju.fakap.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS piju.fakap.net.
2 IN PTR www.piju.fakap.net.
2 IN PTR mail.piju.fakap.net.
5. Edit named.conf.server:
// prime the server with knowledge of the root servers
zone “.” {
type hint;
file “/etc/bind/db.root”;
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone “localhost” {
type master;
file “/etc/bind/db.local”;
};
zone “127.in-addr.arpa” {
type master;
file “/etc/bind/db.127″;
};
zone “piju.fakap.net” {
type master;
file “/etc/bind/piju.fakap.server”;
};
zone “2.in-addr.arpa” {
type master;
file “/etc/bind/piju.fakap.254″;
};
6. Edit named.conf:
include “/etc/bind/named.conf.options”;
include “/etc/bind/named.conf.local”;
include “/etc/bind/named.conf.server”;
7. Value on /etc/resolv.conf:
search piju.fakap.net
nameserver 192.168.1.1
Twitter: Post Update Using Curl On Command Line Interface
Written by piju on June 23, 2009 – 6:59 pm -%touch twit.sh
%echo curl –basic –user “YOURUSERNAME:PASSWORD” –data-ascii “status=`echo $@|tr ‘ ‘ ‘+’`” “http://twitter.com/statuses/update.json” >> twit.sh
%chmod +x twit.sh
%./twit.sh Hello World!
Posted in debian, fedora, freebsd, linux, unix | No Comments »
Google Chrome Browser for Mac OSX
Written by piju on May 24, 2009 – 3:15 am -Google still don’t have its browser for Mac OSX platform or operating system yet,
If you want to try Google Chrome internet browser for your Mac OSX,
you can try to use Chromium
Posted in hackintosh, mac, unix | No Comments »
Tutorial: How To Cache Youtube Using Squid Caching Proxy
Written by piju on November 8, 2008 – 9:38 pm -This is tutorial lesson on how to cache youtube using squid caching proxy.
First, u need to download and compile squid version 2.7 stable 3 with these configuration.
./configure \ --sysconfdir=/etc/squid \ --prefix=/usr \ --enable-async-io \ --enable-removal-policies=lru,heap \ --disable-delay-pools \ --disable-wccp \ --disable-wccp2 \ --enable-kill-parent-hack \ --enable-snmp \ --enable-default-err-languages=English --enable-err-languages=English \ --enable-linux-netfilter \ --disable-auth
Then edit your own squid.conf for your own environment. Finding where is squid.conf location also a lesson
Touch a file, and name it as store_url_rewrite, make it executable and write this code on it
#!/usr/bin/perl
$|=1;
while (<>) {
@X = split;
$url = $X[0];
$url =~s@^http://(.*?)/get_video\?(.*)video_id=(.*?)&.*@squid://videos.youtube.INTERNAL/ID=$3@;
$url =~s@^http://(.*?)/get_video\?(.*)video_id=(.*?)$@squid://videos.youtube.INTERNAL/ID=$3@;
$url =~s@^http://(.*?)/videodownload\?(.*)docid=(.*?)$@squid://videos.google.INTERNAL/ID=$3@;
$url =~s@^http://(.*?)/videodownload\?(.*)docid=(.*?)&.*@squid://videos.google.INTERNAL/ID=$3@;
print "$url\n"; }
Just try to use this squid.conf ( please read the manual and edit whatever lines depends on your own environment )
acl all src all acl manager proto cache_object acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localnet http_access deny all icp_access allow localnet icp_access deny all http_port 3128 transparent hierarchy_stoplist cgi-bin ? cache_mem 6 MB maximum_object_size_in_memory 32 KB memory_replacement_policy heap GDSF cache_replacement_policy heap LFUDA cache_dir aufs /nfs/cache 20000 16 256 maximum_object_size 64 MB cache_swap_low 98 cache_swap_high 99 access_log /var/log/squid/access.log squid cache_log /var/log/squid/cache.log cache_store_log none log_fqdn off storeurl_rewrite_program /etc/squid/store_url_rewrite acl store_rewrite_list url_regex ^http://(.*?)/get_video\? acl store_rewrite_list url_regex ^http://(.*?)/videodownload\? storeurl_access allow store_rewrite_list storeurl_access deny all cache allow store_rewrite_list acl QUERY urlpath_regex cgi-bin \? cache deny QUERY refresh_pattern ^http://(.*?)/get_video\? 10080 90% 999999 override-expire ignore-no-cache ignore-private refresh_pattern ^http://(.*?)/videodownload\? 10080 90% 999999 override-expire ignore-no-cache ignore-private refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320 quick_abort_min 0 quick_abort_max 0 quick_abort_pct 98 acl apache rep_header Server ^Apache broken_vary_encoding allow apache vary_ignore_expire on cache_effective_user squid cache_effective_group squid log_icp_queries off ipcache_size 2048 ipcache_low 98 ipcache_high 99 memory_pools off reload_into_ims on coredump_dir /usr/var/cache pipeline_prefetch on
See the result using tail
root@piju-laptop:~# tail -f /var/log/squid/access.log | grep TCP_HIT 1226204534.323 769 127.0.0.1 TCP_HIT/200 8138088 GET http://www.youtube.com/get_video?video_id=mjVXavHV2rU&t=OEgsToPDskJ5cKubeUhB4Cay12jNVBlE&eurl=http%3A%2F%2Fpiju%2Efakap%2Enet%2F&el=embedded&ps=default - NONE/- video/flv
Million thanks to jagawarnet,
for his encouragement and inspire.
Wish u all luck !
Posted in computer, debian, linux, unix | 2 Comments »
How To Change Users Default Shell On FreeBSD
Written by piju on June 7, 2008 – 2:18 am -If u want to change ur own default shell on freebsd, u can use chsh command
but how to change to ur 1000 users on ur system ?
for example, changing to zsh
$i;done
cd /usr/home && for i in *;do chsh -s zsh

