Skip to content

Instantly share code, notes, and snippets.

View email_cleanup.js
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 Jul 19, 2016
example python fabric task
View fabfile.py
#! /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 Jul 19, 2016
Example basic ansible playbook
View apt-get-update.yml
---
- hosts: hostgroup1
sudo: yes
serial: 3
tasks:
- shell: apt-get -y update
- shell: apt-get -y upgrade
View puppet_filebucket_search.sh
#! /bin/bash
find /var/lib/puppet/clientbucket -name paths -exec ls -la {} \; -exec cat {} \; | grep -B 1 $1
View repo_update.sh
#! /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 Feb 8, 2016
get a list of all movies as known by wikipedia
View allmovies.txt
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
View openssl_shortcuts.sh
# check date of certificate on remote site
echo | openssl s_client -connect ssl.example.com:443 | openssl x509 -noout -dates
View hacked_emails.md
  • 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 Aug 10, 2014
RPI SDR Install Instructions
View setup.sh
# 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 Jun 27, 2014
javascript snippit to reload all the images on a page
View image_reload.js
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