Skip to content

Instantly share code, notes, and snippets.

View drew1kun's full-sized avatar
🌴
On vacation

drew1kun

🌴
On vacation
View GitHub Profile
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
/usr/bin/which -s git || abort "brew install git first!"
@drew1kun
drew1kun / mem.py
Last active April 10, 2017 17:17
script for getting system memory info over command line
#!/usr/bin/env python
from subprocess import Popen
from subprocess import PIPE
from re import compile
# Get process info
ps = Popen(['ps', '-caxm', '-orss,comm'], stdout=PIPE).communicate()[0]
vm = Popen(['vm_stat'], stdout=PIPE).communicate()[0]
@drew1kun
drew1kun / appify.sh
Last active October 20, 2015 19:03 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/usr/bin/env bash
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
appify v3.0.0 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
Note that you cannot rename appified apps. If you want to give your app
a custom name, use the second argument:
`basename "$0"` my-script.sh "My App"
@drew1kun
drew1kun / seticon.sh
Last active November 4, 2015 19:46
set an icon for file or folder in OS X
#!/usr/bin/env sh
# Sets an icon on file or directory
# Usage setIcon.sh iconimage.jpg /path/to/[file|folder]
iconSource=$1
iconDestination=$2
icon=/tmp/`basename $iconSource`
rsrc=/tmp/icon.rsrc
# Create icon from the iconSource
cp $iconSource $icon
@drew1kun
drew1kun / vlc
Created October 28, 2015 17:41 — forked from kgriffs/vlc
Run VLC from the command line on Mac OS X and stream internet radio (such as Radio Paradise).
#!/usr/bin/env bash
/Applications/VLC.app/Contents/MacOS/VLC -I rc "$@"
@drew1kun
drew1kun / ds215j_provisioner.md
Created March 26, 2016 06:06 — forked from stevenhaddox/ds215j_provisioner.md
Bootstrap Synology DS215j DSM 5.x provisioner steps

Boostrap the Synology DS215j with optware, ipkg, and sudo

Inspired mostly from the Bootstrap DS215j blog post

Download & Install ipkg in a persistent manner

# Create a directory that won't get nuked during DSM security updates
mkdir /volume1/@optware
cd /volume1/@optware