Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bertrandom's full-sized avatar

Bertrand Fan bertrandom

View GitHub Profile
<?php
/**
* iphone actions.
*
* @package twonodes
* @subpackage iphone
* @author Bertrand Fan <b*******@fan.net>
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
#----------------------------------PLEASE NOTE---------------------------------#
#This file is the author's own work and represents their interpretation of the #
#song. You may only use this file for private study, scholarship, or research. #
#------------------------------------------------------------------------------##
Song: Wrap Your Troubles in Dreams (and Dream Your Troubles Away)
Album: Sweet and Lowdown Soundtrack
Written by Ted Koehler, Bill Moll, and Harry Barris
Performed by Dick Hymen Group featuring Howard Alden
Tabbed by Matt Rader email: ucimaaat@hotmail.com
Script to install yum on a retarded Centos 5.2 box:
rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/rpm-python-4.4.2.3-18.el5.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm \
http://mirror.centos.org/centos/5/os/i386/CentOS/m2crypto-0.16-6.el5.6.i386.rpm \
[root@server rsa]# cat process.sh
#!/bin/bash
convert -crop 13x23+142+124 -contrast -modulate 100 token.jpg digit1.tif
tesseract digit1.tif digit1 nobatch digits
convert -crop 13x22+154+124 -contrast -modulate 100 token.jpg digit2.tif
tesseract digit2.tif digit2 nobatch digits
convert -crop 13x22+167+125 -contrast -modulate 100 token.jpg digit3.tif
tesseract digit3.tif digit3 nobatch digits
convert -crop 11x21+187+125 -contrast -modulate 100 token.jpg digit4.tif
tesseract digit4.tif digit4 nobatch digits
@bertrandom
bertrandom / gist:665795
Last active August 24, 2016 14:44
Bookmarklet for setting the date posted for a photo on Flickr to now
javascript:(function()%7Bvar photoId %3D location.href.match(%2F%5C%2Fphotos%5C%2F((%5B0-9%5D%2B%40N%5B0-9%5D%2B)%7C%5B0-9a-zA-Z-_%5D%2B)%5C%2F(%5B0-9%5D%2B)%2F)%5B3%5D%3Bwindow.appContext.flickrAPI.callMethod('flickr.photos.setDates'%2C %7B"date_posted"%3A Math.round(new Date().getTime() %2F 1000)%2C "photo_id"%3A photoId%7D).then(function() %7Bwindow.appContext.flickrAPI.callMethod('flickr.photos.setPerms'%2C %7B"is_public"%3A 1%2C "is_friend"%3A 0%2C "is_family"%3A 0%2C "photo_id"%3A photoId%7D)%3B%7D)%7D)()
@bertrandom
bertrandom / Boxee Box Remote API.cpp
Created December 15, 2010 05:26
Boxee Box Remote API
int CXbmcHttp::xbmcCommand(const CStdString &parameter)
{
if (shuttingDown)
return -1;
int numParas, retVal=false;
CStdString command, paras[MAX_PARAS];
numParas = splitParameter(parameter, command, paras, ";");
if (parameter.length()<300)
CLog::Log(LOGDEBUG, "HttpApi Start command: %s paras: %s", command.c_str(), parameter.c_str());
else
@bertrandom
bertrandom / gist:777410
Created January 13, 2011 04:45
Set RFID reader to communicate at 9600 baud, No Parity, One stop bit, and No Flow Control
stty -F /dev/ttyUSB0 9600 -parenb -cstopb -ixon
#! /bin/bash
### BEGIN INIT INFO
# Provides: memcached
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: memcached - Memory caching daemon
@bertrandom
bertrandom / pil.patch
Created October 12, 2011 16:45
Patch for PIL to install on Ubuntu 11.04
--- setup.old 2011-10-12 16:37:50.034274363 +0000
+++ setup.py 2011-10-12 16:39:27.226276274 +0000
@@ -212,6 +212,7 @@
add_directory(include_dirs, "/usr/local/include")
add_directory(library_dirs, "/usr/lib")
+ add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
add_directory(include_dirs, "/usr/include")
#
@bertrandom
bertrandom / 30-pinning
Created October 13, 2011 19:35
APT config file for loading in oneiric repos
Package: *
Pin: release n=natty
Pin-Priority: 900
Package: *
Pin: release n=oneiric
Pin-Priority: 800