Skip to content

Instantly share code, notes, and snippets.

@xxdesmus
xxdesmus / tarsnap-delete.sh
Created August 3, 2014 01:14
tarsnap-delete.sh
#! /bin/bash
echo `date +%F\ %T`: Removing $1 backup from `date -d "7 days ago" "+%Y-%m-%d"` >> /var/log/tarsnap/backupscript.log
/usr/local/bin/tarsnap -d -f $1-`date -d "7 days ago" "+%Y-%m-%d"` &>> /var/log/tarsnap/backupscript.log
echo `date +%F\ %T`: Completed removing $1 backup from `date -d "7 days ago" "+%Y-%m-%d"` >> /var/log/tarsnap/backupscript.log
@xxdesmus
xxdesmus / tarsnap-backup.sh
Created August 3, 2014 00:47
tarsnap-backup.sh
#! /bin/bash
echo `date +%F\ %T`: Beginning back up of $2 >> /var/log/tarsnap/backupscript.log
/usr/local/bin/tarsnap -c -f $1-`date +%F` $2 &>> /var/log/tarsnap/backupscript.log
echo `date +%F\ %T`: Completed back up of $2 >> /var/log/tarsnap/backupscript.log
#!/bin/sh
# Installs tarsnap client on Debian and Ubuntu
#
# You'll need to setup an account at
# http://www.tarsnap.com
# and load it with some funds
#
# Make sure you run this as root
#
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 0 979192 23267/lt-nghttpx
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 0 905842 3037/lt-nghttpd
tcp 0 0 127.0.0.2:80 0.0.0.0:* LISTEN 0 875607 25471/nginx
tcp 0 0 127.0.0.2:80 127.0.0.1:41485 TIME_WAIT 0 0 -
tcp6 0 0 :::443 :::* LISTEN 0 875606 25471/nginx
tcp6 0 0 :::8080 :::* LISTEN 0 905843 3037/lt-nghttpd
tcp6 0 0 :::80 :::* LISTEN 0 875605 25471/nginx
==================
Request over IPv4
==================
curl -v -k -4 https://cdntest.org:8443/
* Adding handle: conn: 0x7fc21100c400
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
@xxdesmus
xxdesmus / gist:9202356
Created February 25, 2014 03:53
CNAME flattening in action
dig shiftyplatypus.com
; <<>> DiG 9.8.3-P1 <<>> shiftyplatypus.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26231
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;shiftyplatypus.com. IN A