Skip to content

Instantly share code, notes, and snippets.

View gelendir's full-sized avatar

Gregory Eric Sanderson gelendir

View GitHub Profile
@gelendir
gelendir / gmail_proxy.py
Created December 5, 2010 21:14
Proxys SMTP requests to Gmail's SMTP server
#!/usr/bin/python2
"""
Simple SMTP Gmail proxy
By Gregory Eric Sanderson Turcot Temlett MacDonnell Forbes
One of the servers that I maintain has a crappy Exim that randomly crashes. In a fit of frustration,
while looking for a solution that would notify me when problems occured, I hacked together this script.
When monit can't send me warning messages through Exim, it sends them to my gmail account through
this script that acts as a backup SMTP server.
@gelendir
gelendir / skt.py
Created October 24, 2010 01:40
translate string into klingon stupidly
"""
Stupid Klingon Translator (SKT)
hacked together in 5 minutes by :
Gregory Eric Sanderson Turcot Temlett MacDonnell Forbes
Hubert and Mathieu gave me the brilliant idea of implementing a gettext klingon translator
for python projets that use internationalization. Instead of diving in to the
gettext API (BOOOOORING) I hacked together a small function that scrapes Mr.Klingon's
website for translated strings. (http://mrklingo.freeshell.org/uta/index.php)
@gelendir
gelendir / infb.css
Created November 27, 2010 18:35 — forked from ruel/infb.py
A script to scrape information from your facebook friends
/*
Ruel Pagayon (c) 2010 - ruel@ruel.me
Cascading Style Sheet for InFB Log Output.
*/
body {
background-color: #3C3C3C;
color: #FFF;
margin-top: 50px;
margin-left: 25px;
@gelendir
gelendir / ninja_name.py
Created October 31, 2013 03:02
Convert to samurai name
letters = {
'a': 'ka',
'b': 'zu',
'c': 'mi',
'd': 'te',
'e': 'ku',
'f': 'lu',
'g': 'ji',
'h': 'ri',
'i': 'ki',
@gelendir
gelendir / slides.md
Last active December 23, 2015 16:39

title: Fabric name: inverse layout: true class: center, middle, inverse

#Fabric

Lord Junior 6th Gregory Eric Sanderson Turcot Temlett MacDonnell of Glengary Forbes of Linden

CONFIGFILE_PATH = "~/.tiktok.conf"
config = None
def get_config():
global config
if not config:
config = loadconfig( configfile )
return config
#!/usr/bin/env python2
import urllib
import json
URL="HTTPS://mtgox.com/api/1/BTCUSD/ticker"
print json.loads(urllib.urlopen(URL).read())['return']['last_local']['value']
<?php
$BASE_URL = "http://131.137.250.85/cgi-bin/qweb.dll";
$SCRIPT_NAME = basename(__FILE__);
function send_request($url, $body=null) {
$query = parse_url($url);
@gelendir
gelendir / imgurdl.py
Created October 23, 2011 01:08
imgur album downloader
from html.parser import HTMLParser
from urllib import request
import os.path
import re
import json
import sys
class ImgListScraper( HTMLParser ):
@gelendir
gelendir / jobsdead.py
Created September 11, 2011 22:12
Is steve jobs dead ?
#!/usr/bin/env python2
import urllib
import smtplib
import time
from HTMLParser import HTMLParser
from email.mime.text import MIMEText
SERVER = "smtp.gmail.com"
PORT = 587