Tuesday, September 04, 2007

VMWare Server 1.0.3 on 2.6.22.5 (Slackware 12)

1. Install it by default way
automaticaly by rpm
or
install by script from tar.gz


2. Edit source module vmmon.tar
cd /usr/lib/vmware/modules/source/
sudo tar -xvf vmmon.tar
cd vmmon-only
sudo vi include/compat_kernel.h

Find this:

#define __NR_compat_exit __NR_exit
static inline _syscall1(int, compat_exit, int, exit_code);

and change the static inline ..... line to:

int compat_exit(int exit_code);

Then tar up the vmmon-only directory again.

cd .. #go back to the source directory
tar -cf vmmon.tar vmmon-only


3. Replace source of module vmnet.tar (same folder with step 2) by
Download it from here


4. Add Script in "/etc/rc.M" (rc.M is script that's loaded when you use multiuser mode - M for "Multiuser")
# Start the vmware hardware setup
if [ -x /etc/rc.d/init.d/vmware ]; then
. /etc/rc.d/init.d/vmware start
fi


5. Add Script in "/etc/rc.K" (rc.K is script that's loaded when you shutdown or change to single user mode - K for "Kill")
# Stop the vmware hardware setup
if [ -x /etc/rc.d/init.d/vmware ]; then
. /etc/rc.d/init.d/vmware stop
fi


6. Run "vmware-config.pl" and follow the step until finish and successed

7. Run "vmware &"


That's all... Good Luck... :)
Come on smile....

Ref : http://wiki.archlinux.org/index.php/Installing_VMware

Friday, August 31, 2007

Shutdown PC but Power didn't turn off (Linux)

1. Try Check your kernel, did u have enable apm and acpi?
dmesg |grep apm
dmesg |grep acpi

If it's not enable, try to re-compile your kernel with apm and acpi enable


2. If still not work, try to append lilo in /etc/lilo.conf
append="acpi=force"
or
append="apm=power-off"
Try one of them.

Good Luck !!!

:)

Sunday, July 01, 2007

Three jump - the mostly used on IPTABLES

There's about 27 jump on IPTABLES. But only three jump that's usually used by firewall mostly.
They are ACCEPT, DROP, and REJECT.

ACCEPT - have function to allow packet if rule is true or accepted.
eg :
iptables -A INPUT -p tcp -d 192.168.0.2 --dport 22 -j ACCEPT
(this mean if destination packet is IP (192.168.0.2) and destination port is 22 and use protocol tcp, allow input packet)

DROP - have function to drop or reject packet (without acknowledge to sender) if rule is true or accepted.
eg :
iptables -A INPUT -p tcp -d 192.168.0.2 --dport 22 -j DROP
(this mean if destination packet is IP (192.168.0.2) and destination port is 22 and use protocol tcp, reject or drop input packet without acknowledge to sender)


REJECT - have function to drop or reject packet (with acknowledge to sender) if rule is true or accepted.
eg :
iptables -A INPUT -p tcp -d 192.168.0.2 --dport 22 -j REJECT
(this mean if destination packet is IP (192.168.0.2) and destination port is 22 and use protocol tcp, reject or drop input packet with acknowledge to sender)

That's all for today.

Please give me comment if I need to repair something or add something on it.

Thanks.

Tuesday, June 26, 2007

Squid Installation Notes (author - praban)

Squid Installation steps

1. make squid user/group

# groupadd -g 23 squid
# useradd -M -u 23 -g 23 -d /no/dir -s /bin/false squid

2. Use reiserfs for cache directory and add in fstab

/dev/hda6 /cache reiserfs notail,noatime 0 0

3. Configure

# CFLAGS="-O3 -march=i686" \
./configure \
--prefix=/opt/squid \
--disable-carp \
--enable-async-io=32 \
--with-aufs-threads=32 \
--enable-storeio=aufs \
--enable-removal-policies="heap" \
--enable-delay-pools \
--disable-wccp \
--disable-wccpv2 \
--enable-snmp \
--enable-arp-acl \
--enable-cache-digests \
--enable-err-language=English \
--enable-poll \
--enable-linux-netfilter \
--disable-ident-lookups \
--disable-unlinkd \
--enable-truncate \
--enable-pthreads \
--with-aio \
--with-dl

4. Compile & Install

# make
# make install
# strip /opt/squid/sbin/squid
# strip /opt/squid/bin/squidclient
# strip /opt/squid/libexec/*
# install /opt/squid/libexec/cachemgr.cgi /var/www/cgi-bin/
# mkdir -p /var/log/squid
# chown squid:squid /var/log/squid
# chown squid:squid /cache

5. squid.conf

http_port 3128
icp_port 0
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 10 MB
maximum_object_size_in_memory 8 KB
ipcache_size 2048
ipcache_low 90
ipcache_high 95
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir aufs /cache 6000 16 256
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log none
pid_filename /var/run/squid.pid
ftp_user netuser@
check_hostnames off
allow_underscore on
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
half_closed_clients off
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
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
acl ournet src 192.168.1.0/24
http_access allow ournet
http_access deny all
http_reply_access allow all
icp_access allow all
cache_mgr praban@hostingku.org
cache_effective_user squid
cache_effective_group squid
httpd_suppress_version_string on
visible_hostname hostingku.org
logfile_rotate 5
memory_pools off
via off
forwarded_for off
log_icp_queries off
cachemgr_passwd passwordku all
delay_pools 1
delay_class 1 2
delay_access 1 allow ournet
delay_access 1 deny all
delay_parameters 1 64000/64000 5000/16000

6. Ready to running

# /opt/squid/sbin/squid -z
# /opt/squid/sbin/squid -D

Shell's Command

I still learn about linux. This some of command that I know in linux's shell.
ls - listing
cd - change directory
mkdir - make directory
rmdir - remove directory
chmod - change permission mode TypeOfFile-owner-groups-others (ex: drwxr_xr_x)
chfn - change finger
usermod - change or add user attribute, for example: group
chown - change owner of file or directory
lspci - listing pci on pc
lsmod - listing module
ln - make link to a file or folder
cp - copy
mv - move or rename file
cat - concatenate files and print on the standard output
less - opposite of more
more - file perusal filter for crt viewing
grep
find
arp
ifconfig
iptables
ipchain
vmstat
etc...

So many syntax, Maybe u can find the rest. :)
You can see the manual by type "man <command>" or only need help just type "<command> -h" or "<command> --help ".

If u have question, u could ask by comment. I'll answer it if i could. So, we could learn together.
:D