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 | |
/etc/init.d/rabbitmq-server stop | |
for x in $(ps -ef | grep -v grep | grep rabbit | awk '{print $2}'); do kill -9 $x; echo "Process id $x is killed"; done | |
rm /var/lib/rabbitmq/.erlang.cookie | |
rm -rf /var/lib/rabbitmq/mnesia/ | |
rm -rf /etc/rabbitmq/ | |
apt-get remove --purge rabbitmq-server | |
apt-get autoremove | |
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
#Apache | |
RewriteRule ^/wp-uploads/(.*)$ /srv/www/wp-uploads/%{HTTP_HOST}/$1 | |
#nginx | |
location /wp-uploads/ { | |
rewrite ^/wp-uploads/(.*)$ /$1 break; | |
root /srv/www/wp-uploads/$host; | |
} |
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
(INTERNET) | |
| | |
HAPROXY\ | /HAPROXY-STANDBY | |
NFS- DRBD1 <------VIP DRBD2 -NFS-STANDBY | |
MYSQL/ /|\ \MYSQL-STANDBY | |
/ | \ | |
WEB1 WEB2 WEB3 WEB4 (apache's mpm-itk/nginx php5-fpm) | |
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
(INTERNET) | |
| | |
HAPROXY\ | /HAPROXY-STANDBY | |
NFS- DRBD1 <------VIP DRBD2 -NFS-STANDBY | |
MYSQL/ / /|\ \ \MYSQL-STANDBY | |
PUPPET/ / | \ \STORAGE | |
/ | \ | |
WEB1 WEB2 WEB3 WEB4 (apache's mpm-itk/nginx php5-fpm) | |
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
case $multiple_nodes { | |
yes: { | |
file { 'rabbitmq.config': | |
ensure => file, | |
path => '/etc/rabbitmq/rabbitmq.config', | |
content => template("${module_name}/rabbitmq.config"), | |
owner => 'rabbitmq', | |
group => 'rabbitmq', | |
mode => '0644', |
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
#clean debian 6.0 machine | |
su - root | |
apt-get install build-essential curl libyaml-dev | |
curl -L https://get.rvm.io | bash -s stable | |
source /usr/local/rvm/scripts/rvm | |
echo "[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm" " >> ~/.bash_profile | |
source ~/.bashrc | |
rvm pkg install zlib --verify-downloads 1 | |
rvm install 1.9.1 --verify-downloads 1 |
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 | |
#set -e | |
allfiles=(/root/work4/xi_wang); | |
#echo "I count ${#allfiles[@]} afiles to manipulate." | |
for afile in ${allfiles[@]}; | |
do | |
virtualhostcount=0 | |
#... I should use awk rather than grep.. |
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 | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin # modify if you need | |
DAEMON_ARGS="/home/hastebin/haste-server/server.js" # path to your node.js server/app | |
DESC="node.js pastebin server" # whatever fancy description you like | |
NODEUSER=hastebin:hastebin # USER who OWNS the daemon process (no matter whoever runs the init script) | |
LOCAL_VAR_RUN=/var/run # in case the init script is run by non-root user, you need to | |
NAME=node # name of the node.js executable | |
DAEMON=/usr/local/bin/$NAME # this SHOULD POINT TO where your node executable is | |
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 | |
#(optional) in the format user.name:password@ (you need the @ after) | |
password="$(< ~/.hidden_password)" | |
url="hastebin.com" | |
key="$(curl --silent --insecure --data-binary @/dev/fd/0 https://"$password""$url"/documents | cut -d "\"" -f 4)" | |
echo "https://"$url"/"$key"" |
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 | |
#This Script parses the output of these two files | |
#iostat -N vg_backup-lv_backup 1 > iostat_output & | |
#cat iostat_output | grep vg_backup-lv_backup >vg_only | |
#where vg_backup-lv_backup is the name of your lv (see the names of you lvs here ls -l /dev/mapper/) | |
numlines=5000 | |
geta() { |
OlderNewer