Skip to content

Instantly share code, notes, and snippets.

var days31 = ["label1",
"label2",
"label3"];
var days7 = ["parent/label4",
"parent/label5",
"parent/label6",
"label7"];
function auto_delete_mail(userLabel,days) {
@n8foo
n8foo / fabfile.py
Created July 19, 2016 21:59
example python fabric task
#! /bin/env/python
from fabric.api import *
env.use_ssh_config=True
env.roledefs = {
'all': [
'host1',
'host2',
@n8foo
n8foo / apt-get-update.yml
Last active July 19, 2016 21:55
Example basic ansible playbook
---
- hosts: hostgroup1
sudo: yes
serial: 3
tasks:
- shell: apt-get -y update
- shell: apt-get -y upgrade
#! /bin/bash
find /var/lib/puppet/clientbucket -name paths -exec ls -la {} \; -exec cat {} \; | grep -B 1 $1
#! /bin/bash
WD=`pwd`
DOMAIN=example.com
GITS=`find . -maxdepth 2 -name .git -type d | sed "s/\.\///g" | sed "s/\/.*//g"`
SVNS=`find . -maxdepth 2 -name .svn -type d | sed "s/\.\///g" | sed "s/\/.*//g"`
case $1 in
setup)
@n8foo
n8foo / allmovies.txt
Last active February 8, 2016 14:04
get a list of all movies as known by wikipedia
Less Than Zero
Zero Charisma
Zero Dark Thirty
Zero Day
Zero Effect
Zero for Conduct
Zero Hour!
Zero Tolerance
The $1,000,000 Reward
One Hundred Men and a Girl
@n8foo
n8foo / openssl_shortcuts.sh
Created April 17, 2015 02:56
openssl shortcuts
# check date of certificate on remote site
echo | openssl s_client -connect ssl.example.com:443 | openssl x509 -noout -dates
  • Long Tail Video
  • Macromedia
  • BMW
  • BMW Motorcycles
  • BMW Xplor
  • ASPSeek
  • Foursquare
  • Speedyclick
  • Model Mayhem
  • Tugg Inc (via Why We Ride mailing list)
@n8foo
n8foo / setup.sh
Created August 10, 2014 03:57
RPI SDR Install Instructions
# Install dependencies
sudo apt-get update
sudo apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake libpulse-dev libx11-dev
# Fetch and compile rtl-sdr source
mkdir -p ~/src/
cd ~/src/
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
@n8foo
n8foo / image_reload.js
Created June 27, 2014 00:57
javascript snippit to reload all the images on a page
setInterval(function() {
var images = document.images;
for (var i=0; i<images.length; i++) {
images[i].src = images[i].src.replace(/\btime=[^&]*/, 'time=' + new Date().getTime());
}
}, 10000); // 10000 milliseconds = 10 seconds