Skip to content

Instantly share code, notes, and snippets.

@orenhe
orenhe / ssh-agent-restore.sh
Created January 17, 2013 12:32
Source this to try and setup the SSH agent path
# Originally from https://github.com/scharan/Goodies/blob/master/ssh-agent-restore
export SSH_AUTH_SOCK=$(\find /tmp/ssh-* -name agent.\* -uid $(id -u) | head -n 1)
@orenhe
orenhe / mysqldump2sqlite3.sh
Created September 23, 2012 13:44 — forked from miku/mysqldump2sqlite3.sh
Convert a mysql database dump into something sqlite3 understands.
#!/bin/sh
# ================================================================
#
# Convert a mysql database dump into something sqlite3 understands.
#
# Adapted from
# http://stackoverflow.com/questions/489277/script-to-convert-mysql-dump-sql-file-into-format-that-can-be-imported-into-sqlit
#
# (c) 2010 Martin Czygan <martin.czygan@gmail.com>
@orenhe
orenhe / style.css
Created June 19, 2012 19:15
Wordpress Twentyeleven theme zenburn colors
/*
Theme Name: Twenty Eleven zenburn colors
Author: Oren Held
Template: twentyeleven
Version: 0.1
License: MIT
Notes:
* Make sure you have Twentyeleven theme installed
* Set it to "dark" colorscheme
@orenhe
orenhe / contacts_csv_fix_prefix.pl
Created June 16, 2012 20:03
Add phone number prefix to contacts csv: pad phones with zero unless they start with 1
#!/usr/bin/perl -w
# Gets a contacts csv file through stdin, prints to stdout a modified file with phone prefix fixed
# This was useful for me when I exported Nokia contacts, which lacked the first '0' character.
# Note that it ruins the first (head) line, I manually took it from original file, although it must be dead simple to fix it in code.
while (<STDIN>) {
@a=split(",");
foreach ($item = 30; $item < 45; $item++) {
$phone=$a[$item];
@orenhe
orenhe / svnlogp
Created May 20, 2012 07:22
SVN Log P: a partial 'git log -p' for SVN
#!/bin/bash
# svnlogp is a script that implements 'git log -p' for svn (partially & inefficiently): it shows all the diff's of a given filename.
#
# Due the SVN centralized architecture, it's really slow, and 'svn blame' is commonly a fair alternative.
#
# Usage: svnlogp <filename>
#
# Author: Oren Held
filename=$1
@orenhe
orenhe / mediawiki2rst.pl
Created May 3, 2012 14:09
mediawiki2rst
#!/usr/bin/perl
#
# mediawiki2rst - converts mediawiki markup to Restructured Text format
#
# python-docutils provide rst2<whatever> tools, thus it can be one hop towards converting to html, odt, latex etc
#
# License: BSD-style
#
# Author: Oren Held
#