Skip to content

Instantly share code, notes, and snippets.

View boardstretcher's full-sized avatar

boardstretcher boardstretcher

  • Black Mesa Research
  • Detroit, Mi
View GitHub Profile
@boardstretcher
boardstretcher / get_urls.sh
Last active December 22, 2015 13:58
get all urls from a website
lynx -dump -listonly $WEBSITE
@boardstretcher
boardstretcher / bzip_over_ssh.sh
Last active December 22, 2015 13:58
send a bzipped file over ssh
bzip2 -c $PATH | ssh $USER@$SERVER "bzip2 -dc > $TO"
@boardstretcher
boardstretcher / tar_files_from.sh
Last active December 22, 2015 13:58
tar files over last x days
tar -c -f $FILENAME --after-date='$DAYS days ago' .
@boardstretcher
boardstretcher / deploy.txt
Last active December 22, 2015 18:39
deploy an all-master percona cluster using tungsten
# Scientific Linux 6.4
# deploy an all-master percona cluster using tungsten
# https://code.google.com/p/tungsten-replicator/
# on each node
yum -y update
yum -y install ruby java rsync tar
rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
vim /etc/yum.repos.d/Percona.repo ## change version to 6 (6.4 does not exist)
yum install -y Percona-Server-server-55.x86_64
@boardstretcher
boardstretcher / deploy_haproxy.sh
Last active December 22, 2015 20:19
install and set up latest haproxy for four nodes
# scientific linux 6.4
# lb node - no sql on this node
# sql nodes: db1, db2, db3, db4
yum -y update
yum -y install gcc
useradd haproxy
wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.24.tar.gz
tar zxvf haproxy-1.4.24.tar.gz
cd haproxy-1.4.24
@boardstretcher
boardstretcher / gist:6618260
Created September 19, 2013 02:07
create a virtual drive and mount it
dd if=/dev/zero of=filesystem.ext3 bs=1k count=32000
mkfs -t ext3 -F filesystem.ext3
mkdir -pv /mnt/virtsys
mount -o loop filesystem.ext3 /mnt/virtsys
@boardstretcher
boardstretcher / sprung_pastebin
Created September 21, 2013 22:49
use sprunge as a pastebin
date | curl -F "sprunge=<-" http://sprunge.us
# this will output a url that has your pasted code, easy to share
# on forums and things
@boardstretcher
boardstretcher / proc_reboot
Created September 22, 2013 00:31
reboot without using reboot command
echo 10 > /proc/sys/kernel/panic
echo 1 > /proc/sys/kernel/sysrq
echo s > /proc/sysrq-trigger
sleep 5
echo s > /proc/sysrq-trigger
sleep 5
echo b > /proc/sysrq-trigger
@boardstretcher
boardstretcher / clean_install_SL6
Last active December 23, 2015 15:29
clean install of scientific linux 6
#Clean minimal install of Scientific Linux 6/Centos 6
#Additional Security Removed (iptables, selinux)
#For additional hardening Information:
#http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/index.html
# initial installation
#use SL Install DVD (minimal install only exists on DVD)
#boot
#[tab] for Kernel Parameters (linux text asknetwork )
@boardstretcher
boardstretcher / python_setup.sh
Created September 30, 2013 18:57
RHEL compatible python dev environment setup. pip, virtualenv, and flask.
#!/bin/bash
yum install -y python2 python-pip
pip install virtualenv
mkdir projects
cd projects
virtualenv some_project
cd some_project
source bin/activate
pip install flask