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
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Update: changed because the old IP-service wasn't working anymore
# Uses curl to be compatible with machines that don't have wget by default
# modified by Ross Hosman for use with cloudflare.
#
# Place at:
# /usr/local/bin/cf-ddns.sh
# if you're lazy (like me): curl https://gist.githubusercontent.com/larrybolt/6295160/raw/9efbc7850613e06db1b415bdf4fbdd8361209865/cf-ddns.sh > /usr/local/bin/cf-ddns.sh && chmod +x /usr/local/bin/cf-ddns.sh && vim /usr/local/bin/cf-ddns.sh
# run `crontab -e` and add next line:
@xxdesmus
xxdesmus / Mailbox Mac beta SSL error
Created August 25, 2014 18:54
Mailbox Mac beta SSL error
8/25/14 11:52:41.019 AM Mailbox (Beta)[1222]: Logger instance installed
8/25/14 11:52:41.019 AM Mailbox (Beta)[1222]: Logger instance installed
8/25/14 11:52:41.020 AM Mailbox (Beta)[1222]: Logger instance installed
8/25/14 11:53:11.635 AM Mailbox (Beta)[1222]: [ERROR] DropboxSDK: SSL Error. Cannot validate a certificate for the host: api.dropbox.com
8/25/14 11:53:11.636 AM Mailbox (Beta)[1222]: [WARNING] DropboxSDK: error making request to /1/login - (-1012) Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)"
8/25/14 11:53:11.636 AM Mailbox (Beta)[1222]: Login Error: Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)"
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
mtr -r 75.98.93.66
Start: Mon Nov 3 19:23:53 2014
HOST: JustinMBA.local Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.0.1.1 0.0% 10 1.4 1.5 1.3 2.5 0.0
2.|-- 71.198.40.1 0.0% 10 15.0 15.7 13.8 17.2 1.1
3.|-- te-0-7-0-9-sur03.oakland. 0.0% 10 15.5 20.0 14.6 29.2 5.3
4.|-- te-0-2-0-6-ar01.sfsutro.c 0.0% 10 16.6 18.4 15.6 27.1 3.4
5.|-- he-1-4-0-0-cr01.sanjose.c 0.0% 10 18.2 19.9 18.2 23.4 1.6
6.|-- he-0-13-0-0-pe03.11greato 0.0% 10 35.2 21.9 18.3 35.2 5.5
7.|-- xe-9-3-0.sjc10.ip4.tinet. 0.0% 10 18.3 19.3 17.4 21.3 1.0

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@xxdesmus
xxdesmus / vpnsetup.sh
Last active August 29, 2015 14:13 — forked from hwdsl2/.MOVED.md
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise).
# With minor modifications, this script *can also be used* on dedicated servers
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#
@xxdesmus
xxdesmus / keybase.md
Created January 25, 2015 23:16
keybase.md

Keybase proof

I hereby claim:

  • I am xxdesmus on github.
  • I am xxdesmus (https://keybase.io/xxdesmus) on keybase.
  • I have a public key whose fingerprint is BBAA 6BCE 3305 7FD6 6452 7115 57B6 0114 DE0B 314D

To claim this, I am signing this object:

@xxdesmus
xxdesmus / dyre-dga.py
Last active August 29, 2015 14:21 — forked from jedisct1/dyre-dga.py
#! /usr/bin/env python
# Dyre/Dyreza DGA
# Implementation by Talos
# From http://blogs.cisco.com/security/talos/threat-spotlight-dyre
# Another Python implementation was also posted back in December 2014 by moritz.kroll:
# https://www.virustotal.com/en/file/3716902c64afe40369e6ed67f9b9f7eea30f809348b3558adcff622965e80435/analysis/
from datetime import date
from hashlib import sha256
from socket import gethostbyname, gaierror
@xxdesmus
xxdesmus / wget.txt
Created September 28, 2015 20:03 — forked from suzannealdrich/wget.txt
wget spider cache warmer
wget --spider -o wget.log -e robots=off -r -l 5 -p -S --header="X-Bypass-Cache: 1" live-mysite.gotpantheon.com
# Options explained
# --spider: Crawl the site
# -o wget.log: Keep the log
# -e robots=off: Ignore robots.txt
# -r: specify recursive download
# -l 5: Depth to search. I.e 1 means 'crawl the homepages'.  2 means 'crawl the homepage and all pages it links to'...
# -p: get all images, etc. needed to display HTML page
# -S: print server response