Skip to content

Instantly share code, notes, and snippets.

View jbeluch's full-sized avatar

Jonathan Beluch jbeluch

View GitHub Profile
@jbeluch
jbeluch / irssi-connect.sh
Created April 1, 2011 19:54
irssi remote notification via ssh
#!/bin/sh
# If we get an argument, use it for ssh port, otherwise use default of 22
if [ -n "$1" ]
then
port=$1
else
port=22
fi
import xbmc, xbmcgui
url = 'rtmp://69.31.76.55:1935/ondemand/flvstream?_fcs_vhost=cp94207.edgefcs.net&akmfv=1.7/webtv_afrique/3125822'
playpath = 'webtv_afrique/3125822'
li = xbmcgui.ListItem(path=url)
li.setProperty('PlayPath', playpath)
li.setProperty('TcUrl', url)
xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li)
@jbeluch
jbeluch / scrape.py
Created March 1, 2011 22:21
Scrapes movies listed on classiccinemaonline.com and creates a histogram of movies per year.
#!/usr/bin/env python
'''
Jonathan Beluch - web@jonathanbeluch.com
Scrapes movie titles from http://www.classiccinemaonline.com and
creates a histogram showing the distribution of titles by year.
Requires BeautifulSoup, matplotlib and numpy.
'''
#!/usr/bin/env python
# Copyright (C) 2011 by Jonathan Beluch
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@jbeluch
jbeluch / .screenrc
Created November 17, 2010 14:53
Basic .screenrc
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{..G}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a"
@jbeluch
jbeluch / RTM-emailer.py
Created November 16, 2010 22:01
RTM Task Emailer
#!/usr/bin/env python
"""
RTM Task emailer
Emails all current incomplete RTM tasks. It uses a gmail account to
send the email.
SETUP:
Edit RTM_USERNAME, USERNAME, PASSWORD below
The first time you run the script, run it with the "auth" argument
@jbeluch
jbeluch / gmailer.py
Created November 16, 2010 19:43
Send email from a gmail address
#!/usr/bin/env python
import smtplib
class GMail(object):
hostname = 'smtp.gmail.com'
port = 587
def __init__(self, username=None, password=None):
self.server = smtplib.SMTP(self.hostname, self.port)
self.server.ehlo()