Skip to content

Instantly share code, notes, and snippets.

View doorknob60's full-sized avatar

Austin B doorknob60

View GitHub Profile
#!/usr/bin/env python3
import csv
import datetime
import signal
import sys
import time
from pythonping import ping
PINGURL1 = "sea15s07-in-f78.1e100.net" # A Google server
PINGURL2 = "oldschool31.runescape.com"
// Flight management
// Copyright Austin Beatty 2013
#include <iostream>
#include <list>
#include <string>
using namespace std;
struct Flight
#!/bin/bash
declare -i a=47
declare -i n=25
declare -i z=0
while (($n>0)); do
z=$a+$z
n=$n-1
done
echo "The answer is $z"
@doorknob60
doorknob60 / youtube-subs-cli.py
Created June 7, 2012 01:01
Youtube subscription viewer
#!/usr/bin/env python3
import feedparser
import subprocess
d = feedparser.parse('http://gdata.youtube.com/feeds/base/users/USER/newsubscriptionvideos')
onetoten = range(0, 20)
for n in onetoten:
print(str(n)+". "+d.entries[n].title+" - "+d.entries[n].author)
x = int(input('Which number (0-19)? '))
print(d.entries[x].link)
rawurl = subprocess.check_output(['youtube-dl', '-g', '--max-quality=22', '--cookies', '/tmp/ytdl-cookie.txt', d.entries[x].link])
wget --header="Host: stabyourself.net" --header="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2" --header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header="Accept-Language: en-us,en;q=0.5" --header="Accept-Encoding: gzip, deflate" --header="Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" --header="Connection: keep-alive" --header="Referer: http://stabyourself.net/nottetris2/" --header="Cookie: __utma=2319858.1453359753.1316034880.1316034880.1316744373.2; __utmz=2319858.1316744373.2.2.utmcsr=makeuseof.com|utmccn=(referral)|utmcmd=referral|utmcct=/tag/tetris-2-tetris-anarchists-crossplatform/; PHPSESSID=29abafdfa0e1baf451891c329a73326c; __utmb=2319858.1.10.1316744373; __utmc=2319858" 'http://stabyourself.net/dl.php?file=nottetris2/nottetris2-linux.zip' --content-disposition
@doorknob60
doorknob60 / findbin-zenity.sh
Created August 23, 2011 05:51
Find where binaries are in Arch package
#!/bin/sh
package=`zenity --entry --text="Enter the name of an installed package"`
output=`pacman -Ql "$package" | grep /usr/bin`
zenity --info --text="$output"
@doorknob60
doorknob60 / gist:1126667
Created August 5, 2011 00:34
Youtube player thingy
#!/bin/sh
URL=`xclip -o`
RAWURL=`youtube-dl -g --max-quality=22 --cookies /tmp/ytdl-cookie.txt "$URL"`
mplayer -cookies -cookies-file /tmp/ytdl-cookie.txt "$RAWURL"