Skip to content

Instantly share code, notes, and snippets.

import subprocess
import threading
import logging
import os
import time
logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] (%(threadName)-5s) %(message)s')
threads = {}
mountpoints = ["mp_" + str(x) for x in range(30)]
@kalebo
kalebo / keybase.md
Created March 29, 2017 01:32
keybase.md

Keybase proof

I hereby claim:

  • I am kalebo on github.
  • I am kalebo (https://keybase.io/kalebo) on keybase.
  • I have a public key ASDKihr7WMC04VHFjShhD78C3MCM51PwQAsxvo7rTcAzTQo

To claim this, I am signing this object:

@kalebo
kalebo / kyleisms.json
Last active October 10, 2019 16:54
Kyle's kyleisms immortalized
[
"What do now guys?",
"Did I tell you about that time I got stuck in an elevator?",
"Life's hard when 'tarded.",
"So... Lunch?",
"Mornin. (said around 1pm)",
"Ooo, piece of candy!",
"It's brrzy outside.",
"It'll be super cute!"
]
@kalebo
kalebo / adgroupmembers.ps1
Created December 21, 2016 22:41
Select more info for each of the users in a AD group, sort and format
get-adgroupmember adgroupname | foreach {get-aduser $_.name | select name, surname, givenname} | sort-object surname | Format-Table -autosize
@kalebo
kalebo / pptx2pdf.vbs
Last active September 20, 2016 02:31
Convert a directory of powerpoint slides to pdfs for lecture notes
'''
' This is a remixed VB script that I adapted from BillP3rd from stackoverflow.
' It expects a existing directory for output and powerpoint to be installed.
'
' Usage: cscript ppxt2pdf.vbs c:\Users\user\class_ppt_dir class_handouts_dir
'
' Also, I hate Visual Basic
'''
Option Explicit
git clone --bare https://github.com/kalebo/dotfiles.git $HOME/.dotfiles
function gitdot {
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .dotfiles-backup
gitdot checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
@kalebo
kalebo / swapwin
Created June 16, 2015 16:32
swapwin
#!/bin/bash
##
# Example usage: swapwin firefox 1280
#
# Be sure to install wmctrl.
##
name=$1
location=$2
@kalebo
kalebo / dynamic_ip_tracker.py
Last active August 29, 2015 14:20
Dynamic IP Tracker
#!/usr/bin/python
# To add an an entry from a remote machine (NAME at LOCATION):
# $ echo "LOCATION::NAME" | telnet YOURSERVER 45667
import socket
from datetime import datetime
HOST = ""
@kalebo
kalebo / pianobar_debian.sh
Last active May 19, 2017 16:07 — forked from cristianrasch/pianobar_debian.sh
Build commands for Pianobar (2014.06.08-dev) on Debian Jessie
# install the building dependencies
sudo aptitude install libevent-pthreads-2.0-5 libao-dev libgnutls-dev libmad0-dev libfaad-dev libjson0-dev libjson-glib-dev libavformat-dev libavfilter-dev
rm -rf ~/repos/pianobar
git clone git://github.com/PromyLOPh/pianobar.git ~/repos/pianobar
cd ~/repos/pianobar
make
# all set, you can run pianobar directly from the source directory, alternatively run this command to have it installed:
[sudo make install]
@kalebo
kalebo / factcheck1.py
Last active August 29, 2015 14:05
A quick script to query WolfamAlpha for planet diameters to see if all the planets could really fit between the earth and the moon. Yes this is ugly code and it is overdoing it. See https://gist.github.com/4052828 for my inspiration.
import xmltodict
import urllib2
PLANETS = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"]
WA_KEY = "GETYOUR-OWNAPIKEY"
def query(q, key=WA_KEY):
return urllib2.urlopen('http://api.wolframalpha.com/v2/query?appid=%s&input=%s&format=plaintext' % (key,urllib2.quote(q))).read()