This file contains hidden or 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
root@freetunes:/tmp# vgcfgrestore --file /etc/lvm/backup/lvm-raid lvm-raid | |
Restored volume group lvm-raid | |
root@freetunes:/tmp# vgchange -ay | |
1 logical volume(s) in volume group "lvm-raid" now active | |
root@freetunes:/tmp# lvs | |
LV VG Attr LSize Origin Snap% Move Log Copy% Convert | |
lvm0 lvm-raid -wi-a- 5.46t | |
root@freetunes:/tmp# e2fsck /dev/lvm-raid/lvm0 | |
e2fsck 1.41.11 (14-Mar-2010) | |
e2fsck: Superblock invalid, trying backup blocks... |
This file contains hidden or 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
Calista ➜ dashboard git:(master) ssh dashboard@nodejs-3 "cd app && git submodule update" | |
Initialized empty Git repository in /home/dashboard/app/assets/_lib/d3/.git/ | |
Host key verification failed. | |
fatal: The remote end hung up unexpectedly | |
Clone of '[email protected]:gosquared/d3' into submodule path 'assets/_lib/d3' failed | |
Calista ➜ dashboard git:(master) ssh dashboard@nodejs-3 "ssh-keygen -F github.com -f ~/.ssh/known-hosts | head -1" | |
# Host github.com found: line 1 type RSA |
This file contains hidden or 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
$ time curl -I "$uri" &> /dev/null | |
# when routed to the host that is up | |
curl -I "$uri" &> /dev/null 0.00s user 0.00s system 2% cpu 0.299 total | |
# when routed to the host that is down. Should this be ~3s as per fail_timeout & max_fails? | |
curl -I "$uri" &> /dev/null 0.00s user 0.00s system 0% cpu 21.304 total |
This file contains hidden or 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
! pmacctd configuration | |
! | |
! | |
! | |
daemonize: true | |
pidfile: /var/run/pmacctd.pid | |
syslog: daemon | |
! | |
! interested in in and outbound traffic | |
aggregate: src_host,src_port,dst_host,dst_port |
This file contains hidden or 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
if [ $(ls | grep -c "backup.*tgz") > 0 ] | |
then | |
unless folder _purge exists; do | |
mkdir _purge | |
done | |
mv backup*tgz _purge | |
mv backup*md5 _purge | |
fi |
This file contains hidden or 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
__parallelize() { | |
local _task="$1" | |
local _hosts="${2:-"$SERVERS_APP_USER"}" | |
background_task_pids=() | |
background_tasks=() | |
for _host in $_hosts | |
do | |
( eval "$_task" ) & |
This file contains hidden or 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
Calista ➜ deliver git:(multi-server) ✗ multi | |
/usr/local/bin/parallel | |
FAILED! |
This file contains hidden or 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
def em(redis_url=REDIS_URL, &block) | |
EM.run do | |
redis = EM::Hiredis.connect(redis_url) | |
block.call(redis) | |
end | |
end | |
# ... | |
# fluffyness | |
# ... |
This file contains hidden or 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
server { | |
listen 80; | |
server_name dashboard.foo.com; | |
upstream dashboard_backend { | |
server 11.11.12.40:5000 max_fails=3 fail_timeout=1s; | |
} | |
location /{ | |
proxy_set_header X-Forwarded-Proto $scheme; |
This file contains hidden or 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
#!/usr/bin/env sh | |
tail -f /var/log/apache2/gosquared*access.log | awk ' | |
BEGIN { blocked_ips="" } | |
/ http/ { | |
if (! index(blocked_ips, $1)) { | |
// append this ip to our internal blocked_ips list | |
blocked_ips = blocked_ips " " $1 | |
"date" | getline current_time |