This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//usage | |
//# watch "php monitor.php >> ./server_load_log" | |
$script_connection_count = 'netstat -an | grep 3306 | wc -l'; | |
$script_load_avg = 'uptime'; | |
$load_avg_result = exec($script_load_avg); | |
$connection_count = exec($script_connection_count); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo 'Mysql database scan'."\n"; | |
include_once(dirname(__FILE__)."/conf.php"); | |
// init db connection | |
echo 'init db connection'."\n"; | |
$dbconn = mysql_pconnect($server['host'], $server['username'], $server['password']); | |
// get all database names from server | |
echo 'get all database names from server'."\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set("Asia/Taipei"); | |
//source DB | |
$server['host'] = 'hostname_for_source_db'; | |
$server['username'] = 'username_for_source_db'; | |
$server['password'] = 'password_for_soruce_db'; | |
//destination DB | |
$server_dest['host'] = 'hostname_for_destination_db'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Intel Corporation 82574L Gigabit Network Connection | |
DEVICE=eth0 | |
BOOTPROTO=static | |
IPADDR=192.168.0.10 | |
BROADCAST=192.168.0.255 | |
NETMASK=255.255.255.0 | |
NETWORK=192.168.0.0 | |
GATEWAY=192.168.0.254 | |
HWADDR=00:25:90:10:51:04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -i | |
apt-get update | |
apt-get -y install binutils gcc make linux-source linux-headers-$(uname -r) mpich2 nfs-server nfs-client | |
cd /usr/local/src/ | |
wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/cudatoolkit_4.2.9_linux_64_ubuntu11.04.run | |
wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/drivers/devdriver_4.2_linux_64_295.41.run | |
wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/sdk/gpucomputingsdk_4.2.9_linux.run | |
chmod 755 /usr/local/src/*.run | |
cd /usr/local/src/ | |
./cudatoolkit_4.2.9_linux_64_ubuntu11.04.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aptana3 install | |
http://www.samclarke.com/2012/04/how-to-install-aptana-studio-3-on-ubuntu-12-04-lts-precise-pangolin/ | |
SVN install | |
http://hann99.blogspot.tw/2012/02/aptana-studio-3-svn.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get -y install binutils gcc make linux-source linux-headers-$(uname -r) mpich2 nfs-server nfs-client | |
mkdir /mnt/mirror | |
echo "/mnt/mirror *(rw,sync, no_root_squash)" | tee -a /etc/exports | |
service nfs-kernel-server restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
src=/tmp/ | |
dest=192.168.1.7 | |
/usr/bin/inotifywait -mrq --format '%w %w%f %e' -e attrib,modify,move,create,delete,close_write $src \ | |
| while read path files event | |
do | |
if [ "$event" == "MOVE_TO" ] || [ "$event" == "CREATE" ] || [ "$event" == "ATTRIB" ] || [ "$event" == "CLOSE_WRITE" ]; then | |
#just scp it | |
#echo $path | |
#echo $files $event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install build-essential libssl-dev libpcre3-dev libncurses5-dev libreadline6-dev zlib1g-dev | |
sudo apt-get install git-core | |
sudo apt-get install libxml2-dev libxslt-dev | |
sudo apt-get install sqlite3 libsqlite3-dev | |
sudo apt-get install libmysql-ruby libmysqlclient-dev | |
sudo apt-get install vim | |
sudo apt-get install curl | |
echo "export rvm_path=\"$HOME/.rvm\"" > ~/.rvmrc | |
mkdir ~/.rvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#bash <(curl -fsSLk https://raw.github.com/gist/3496983) | |
yum -y install sudo | |
yum -y install ImageMagick | |
yum -y install wget | |
yum -y install make | |
yum -y install gcc | |
yum -y install libtool |
OlderNewer