Skip to content

Instantly share code, notes, and snippets.

View joeymink's full-sized avatar

Joey Mink joeymink

View GitHub Profile
@joeymink
joeymink / last_tweet.sh
Created April 9, 2014 13:35
Bash script to display a user's last tweet
#!/bin/bash
function usage {
echo "Usage:"
echo "last_tweet.sh <api key> <api secret> <username>"
exit 1
}
if [ -z $1 ] || [ -z $2 ] || [ -z $3 ]; then
usage
@joeymink
joeymink / last_flickr.sh
Last active August 29, 2015 13:58
Queries Flickr for the last upload by the given user
#!/bin/bash
####
# last_flickr.sh
#
# Queries Flickr's APIs for the last upload by the given user.
# (Only tested on OSX)
##
function usage {
@joeymink
joeymink / openvpn.sh
Created February 26, 2014 13:38
openvpn client startup script
# OpenVPN autostart on boot script
# Originally by Jan:
# http://www.hackerway.ch/2012/12/11/how-to-auto-start-openvpn-client-in-debian-6-and-ubuntu-12-04/
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /usr/sbin/openvpn --status /var/run/openvpn.client.status 10 --cd /etc/openvpn --config /etc/openvpn/client.conf --syslog openvpn
@joeymink
joeymink / tomcat.sh
Last active December 25, 2015 17:39 — forked from valotas/tomcat.sh
#!/bin/bash
#
# my_app This shell script takes care of starting and stopping my_app
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: my_app
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@joeymink
joeymink / find_repo_from_stree.py
Created September 20, 2013 01:57
Find location of a git repo with the given name from SourceTree bookmarks on OSX
import subprocess
import os
import re
repo_folder_name='repo_name'
home = os.environ['HOME']
p = subprocess.Popen(['plutil', '-convert', 'xml1', '-o', '-', '--', "%s/Library/Application Support/SourceTree/browser.plist" % home],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@joeymink
joeymink / opends.conf
Last active December 19, 2015 05:39
My quick-and-dirty upstart for OpenDS
# opends
description "OpenDS LDAP Server"
author "Joey Mink <jmink@optensity.com>"
start on (filesystem and net-device-up IFACE=lo)
setuid opends
exec /opt/OpenDS-2.3.0-build003/bin/start-ds --nodetach
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
# run as non privileged user
# add user with this command:
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat