Skip to content

Instantly share code, notes, and snippets.

View jinie's full-sized avatar

Jimmy Selgen Nielsen jinie

View GitHub Profile
@jinie
jinie / unifi
Last active August 29, 2015 13:57
Startup script for UniFi Controller
#!/bin/sh
### BEGIN INIT INFO
# Provides: unifi
# 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: Starts the UniFi admin interface
### Keybase proof
I hereby claim:
* I am jinie on github.
* I am jinie (https://keybase.io/jinie) on keybase.
* I have a public key whose fingerprint is 51FD 1BF4 2F94 14B8 4E9B FF85 E85B 6754 E8F6 1F7F
To claim this, I am signing this object:
@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]
@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 / .vimrc
Created October 28, 2015 13:28
vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Let Vundle manage Vundle
Bundle 'gmarik/vundle'
" My Bundles
@jinie
jinie / hue_automation.py
Created November 13, 2015 13:05
Automating Hue lights at dusk/dawn, or scheduled
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import astral
import logging
import datetime
from dateutil import parser
from threading import Thread
@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 / 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)
#!/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 "-----------------------------------------------------------"
#!/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.