Skip to content

Instantly share code, notes, and snippets.

@drew-kun
drew-kun / ds215j_provisioner.md
Created Mar 26, 2016 — forked from stevenhaddox/ds215j_provisioner.md
Bootstrap Synology DS215j DSM 5.x provisioner steps
View ds215j_provisioner.md

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
@drew-kun
drew-kun / vlc
Created Oct 28, 2015 — forked from kgriffs/vlc
Run VLC from the command line on Mac OS X and stream internet radio (such as Radio Paradise).
View vlc
#!/usr/bin/env bash
/Applications/VLC.app/Contents/MacOS/VLC -I rc "$@"
@drew-kun
drew-kun / seticon.sh
Last active Nov 4, 2015
set an icon for file or folder in OS X
View seticon.sh
#!/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
@drew-kun
drew-kun / appify.sh
Last active Oct 20, 2015 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
View appify.sh
#!/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"
@drew-kun
drew-kun / mem.py
Last active Apr 10, 2017
script for getting system memory info over command line
View mem.py
#!/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]
View homebrew_remove_man.sh
#!/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!"