Connect the switch using a standard 9-pin Serial Cable.
These are the parameters to connect CISCO SG300-10 Gigabit switch using Kermit
set speed 115200
set carrier-watch off
set flow-control none
set duplex full
set parity none
connect
Connect the switch using a standard 9-pin Serial Cable.
These are the parameters to connect CISCO SG300-10 Gigabit switch using Kermit
set speed 115200
set carrier-watch off
set flow-control none
set duplex full
set parity none
connect
<Directory /home/www/www.xxx.com/htdocs>
UserOwner daemon
GroupOwner daemon
</Directory>
This become a known issue for RHEL if you are on a busy I/O storage.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=51306
Work around is to remount the filesystem using the following command.
mount -o remount /
This page shows you how to configure a Multi-homed Linux Box with 2 Network Interfaces to connect to the internet properly.
Step 1 – Update /etc/iproute2/rt_tables
echo 1 NET100 >> /etc/iproute2/rt_tables
echo 2 NET200 >> /etc/iproute2/rt_tables
Step 2 – Update the Routing Table
ip route add default via 192.168.100.1 dev eth1 table NET100
ip rule add from 192.168.100.0/24 table NET100
ip route add default via 192.168.200.1 dev eth0 table NET200
ip rule add from 192.168.200.0/24 table NET200
wget -r ftp://user:pass@server.com/
grep -rl ‘xxxx’ ./ | xargs sed -i ‘s/xxx/yyy/g’
Heres an example for starting a jar process with a single init script
#!/bin/sh
#
# init script for a Java application
#
# chkconfig: - 85 15
pid=0
# Check the application status
#
# This function checks if the application is running
check_status() {
s=`ps -e -o pid,cmd --sort cmd | grep "java -jar start.jar" | grep -v "grep " | tail -n1 | awk '{ print $1 }'`
# If somethig was returned by the ps command, this function sets the PID
if [ $s ] ; then
pid=$s
fi
# In any another case, set pid to 0
pid=0
}
# Starts the application
start() {
# At first checks if the application is already started calling the check_status
# function
check_status
if [ $pid -ne 0 ] ; then
echo "The application is already started"
exit 1
fi
# If the application isn't running, starts it
echo -n "Starting application: "
# Redirects default and error output to a log file
cd /home/www/dinhvan.vicosys.com.hk/htdocs/extension/ezfind/java
java -jar start.jar >> /var/log/ezfind.log 2>&1 &
echo "OK"
}
# Stops the application
stop() {
# Like as the start function, checks the application status
check_status
if [ $pid -eq 0 ] ; then
echo "Application is already stopped"
exit 1
fi
# Kills the application process
echo -n "Stopping application: "
kill -9 $pid &
echo "OK"
}
# Show the application status
status() {
# The check_status function, again...
check_status
# If the PID was returned means the application is running
if [ $pid -ne 0 ] ; then
echo "Application is started"
else
echo "Application is stopped"
fi
}
# Main logic, a simple case to call functions
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
This is a purify function to ensure user-inputed string is sanitized and prevent XSS kind of attacks.
function purify($input){ $result = ""; if (isset($input) && !empty($input)) { $result = rawurldecode($input); $result = strip_tags($result); $result = stripcslashes($result); $result = htmlspecialchars($result, ENT_QUOTES); $result = iconv('utf-8','utf-8//IGNORE',$result); } return $result; }
The following PHP code snippet will return client IP address.
function get_client_ip() { $ipaddress = ''; if (getenv('HTTP_CLIENT_IP')) $ipaddress = getenv('HTTP_CLIENT_IP'); else if(getenv('HTTP_X_FORWARDED_FOR')) $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); else if(getenv('HTTP_X_FORWARDED')) $ipaddress = getenv('HTTP_X_FORWARDED'); else if(getenv('HTTP_FORWARDED_FOR')) $ipaddress = getenv('HTTP_FORWARDED_FOR'); else if(getenv('HTTP_FORWARDED')) $ipaddress = getenv('HTTP_FORWARDED'); else if(getenv('REMOTE_ADDR')) $ipaddress = getenv('REMOTE_ADDR'); else $ipaddress = 'UNKNOWN'; return $ipaddress; }