Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, March 26, 2014

Adding Extra Repo CentOS

ELRepo
---------
To install ELRepo for RHEL-5, SL-5 or CentOS-5:
To make use of our mirror system, please also install yum-fastestmirror

To install ELRepo for RHEL-6, SL-6 or CentOS-6:
To make use of our mirror system, please also install yum-plugin-fastestmirror

Import the public key:


-----

Wednesday, October 2, 2013

Installing Squid 3 on CentOS 5.x

1. Get the PP repository.

wget -q -O- "http://devel.pramberger.at/getrepo?release=5" /etc/yum.repos.d/pramberger.repo
2. Install Squid

yum install


source:http://www.davychiu.com/blog/

Monday, December 31, 2012

Howto check fast I/O, speed


[root@oGcServ ~]# wget cachefly.cachefly.net/100mb.test -O /dev/null
--2011-09-01 03:48:23-- http://cachefly.cachefly.net/100mb.test
Resolving cachefly.cachefly.net... 205.234.175.175
Connecting to cachefly.cachefly.net|205.234.175.175|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: `/dev/null'
100%[==========================================] 104,857,600 83.5M/s in 1.2s
2011-09-01 03:48:25 (83.5 MB/s) - `/dev/null' saved [104857600/104857600]


[root@oGcServ ~]# dd if=/dev/zero of=test.file bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 17.6911 seconds, 60.7 MB/s
[root@oGcServ ~]#


Note: for BSD exclude 'condv=fdatasync'

Ubuntu rc.d iptables

#!/bin/sh
#
#This is an Ubuntu adapted iptables script from gentoo
#(http://www.gentoo.org) which was originally distributed
#under the terms of the GNU General Public License v2
#and was Copyrighted 1999-2004 by the Gentoo Foundation
#
#This adapted version was intended for and ad-hoc personal
#situation and as such no warranty is provided.

. /lib/lsb/init-functions

IPTABLES_SAVE="/etc/default/iptables-rules"
SAVE_RESTORE_OPTIONS="-c"

checkrules() {
if [ ! -f ${IPTABLES_SAVE} ]
then
echo "Not starting iptables. First create some rules then run"
echo "\"/etc/init.d/iptables save\""
return 1
fi
}

save() {
/sbin/iptables-save ${SAVE_RESTORE_OPTIONS} > ${IPTABLES_SAVE}
return $?
}

start(){
checkrules || return 1
/sbin/iptables-restore ${SAVE_RESTORE_OPTIONS} < ${IPTABLES_SAVE}
return $?
}

case "$1" in
save)
echo -n "Saving iptables state..."
save
if [ $? -eq 0 ] ; then
echo " ok"
else
echo " error !"
fi
;;

start)
log_begin_msg "Loading iptables state and starting firewall..."
start
log_end_msg $?
;;

stop)
log_begin_msg "Stopping firewall..."
for a in `cat /proc/net/ip_tables_names`; do
/sbin/iptables -F -t $a
/sbin/iptables -X -t $a

if [ $a == nat ]; then
/sbin/iptables -t nat -P PREROUTING ACCEPT
/sbin/iptables -t nat -P POSTROUTING ACCEPT
/sbin/iptables -t nat -P OUTPUT ACCEPT
elif [ $a == mangle ]; then
/sbin/iptables -t mangle -P PREROUTING ACCEPT
/sbin/iptables -t mangle -P INPUT ACCEPT
/sbin/iptables -t mangle -P FORWARD ACCEPT
/sbin/iptables -t mangle -P OUTPUT ACCEPT
/sbin/iptables -t mangle -P POSTROUTING ACCEPT
elif [ $a == filter ]; then
/sbin/iptables -t filter -P INPUT ACCEPT
/sbin/iptables -t filter -P FORWARD ACCEPT
/sbin/iptables -t filter -P OUTPUT ACCEPT
fi
done
log_end_msg 0
;;

restart)
log_begin_msg "Restarting firewall..."
for a in `cat /proc/net/ip_tables_names`; do
/sbin/iptables -F -t $a
/sbin/iptables -X -t $a
done;
start
log_end_msg $?
;;

*)
echo "Usage: /etc/init.d/iptables {start|stop|restart|save}" >&2
exit 1
;;
esac

exit 0