Skip to content

Instantly share code, notes, and snippets.

View jinie's full-sized avatar

Jimmy Selgen Nielsen jinie

View GitHub Profile
#!/usr/bin/env python
import re
import sys
from functools import partial
remainder = ""
bufsize=4096
ex = re.compile('"(?:url|referer)"\:"([^"]*)"')
with open(sys.argv[1]) as f:
import re
import sys
ex = re.compile("\"(url|referer)\"\:\"(.*)\"")
with open(sys.argv[1]) as f:
for line in iter(f.readline,""):
m = ex.search(line)
print(m.group(2))
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
#!/usr/bin/env bash
trap "echo Exited!; exit;" SIGINT SIGTERM
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo "-----------------------------------------------------------"
echo "-----------------------------------------------------------"
@jinie
jinie / color-theme-mustang.el
Created June 4, 2013 23:18
Mustang color theme for Emacs
;;;
;;; Mustang emacs theme by Jimmy Selgen Nielsen
;;;
;;; Inspired by:
;;; Mustang color theme for Vim by Henrique C. Alves:
;;; http://hcalves.deviantart.com/art/Mustang-Vim-Colorscheme-98974484
;;;
(defun color-theme-mustang ()
(interactive)
@jinie
jinie / gist:5012377
Last active December 14, 2015 02:18 — forked from tommorris/gist:2795214
Updated for redmine 2.2-stable Added a simple "responsible => username" mapping to set Assignee.
import sys
import csv
import httplib, urllib, base64
def main():
# set the name of your repository, username and password
username = "test"
password = "test"
repo = "test"
@jinie
jinie / zombie_automation.py
Created November 6, 2012 23:16
Zombie Apocalypse Automation
#!/usr/bin/python
from Tkinter import *
from random import randint
import timeit
from optparse import OptionParser
worldInstance = None
class Direction(object):
@jinie
jinie / read.py
Created July 5, 2011 18:25
Read binary file in python and print hex output
#!/usr/bin/python
import sys,getopt
filename = None
blocksize = 1024
opts,args = getopt.getopt(sys.argv[1:],'f:b:')
for o,a in opts:
if o == '-f':
@jinie
jinie / read.pl
Created July 5, 2011 17:59
Read binary file in perl and print hex output
#!/usr/bin/perl -w
use strict;
my $BLOCK_SIZE=1024;
my $fname = $ARGV[0];
open(F,"<$fname") or die("Unable to open file $fname, $!");
binmode(F);
my $buf;
@jinie
jinie / gist:1065394
Created July 5, 2011 17:50
Read binary file in ruby and print hex output
#!/usr/bin/ruby
require 'getoptlong'
filename = ""
blocksize = 1024
opts = GetoptLong.new(
[ "-f", "--file", GetoptLong::REQUIRED_ARGUMENT],
[ "-b", "--block", GetoptLong::REQUIRED_ARGUMENT]