Skip to content

Instantly share code, notes, and snippets.

@evilensky
evilensky / tomcat.sh
Created October 9, 2012 20:45 — forked from actionjack/tomcat.sh
Tomcat init.d script
#!/bin/bash
#
# tomcat7 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
def disable_notifications!
auth_url = "https://twitter.com/login"
notifications_url = "https://twitter.com/settings/notifications"
agent = Mechanize.new
page = agent.get(auth_url)
puts "DISABLING NOTIFICATIONS for #{self.username}"
puts "Logging in..."
page.forms_with(:action => 'https://twitter.com/sessions') do |forms|
Drop into lib/matterhorn:
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-ingest-service-impl-1.4-SNAPSHOT.jar
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-distribution-service-hls-1.4-SNAPSHOT.jar
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-distribution-service-streaming-1.4-SNAPSHOT.jar
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-workflow-notifier-avalon-1.4-SNAPSHOT.jar
Drop into etc/encoding:
https://raw.github.com/avalonmediasystem/avalon-felix/1.4.x/etc/encoding/avalon.properties
Drop into lib/matterhorn:
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-ingest-service-impl-1.4-SNAPSHOT.jar
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-distribution-service-hls-1.4-SNAPSHOT.jar
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-distribution-service-streaming-1.4-SNAPSHOT.jar
https://github.com/avalonmediasystem/avalon-felix/raw/1.4.x/lib/matterhorn/matterhorn-workflow-notifier-avalon-1.4-SNAPSHOT.jar
Drop into etc/encoding:
https://raw.github.com/avalonmediasystem/avalon-felix/1.4.x/etc/encoding/avalon.properties

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
# for Mountain Lion 10.8.3 - 10.8.4
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
# for Mountain Lion 10.8.1-10.8.2 and Lion 10.7.5
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
# for Mountain Lion 10.8.0 and Lion 10.7.4 BELOW
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|
# Install Homebrew
ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
# Follow on-screen instructions (X11 isn't necessary for this if it shows as not installed)
brew install node
# Open .bashrc and add this line (create .bashrc if its not in your home directory already)
@evilensky
evilensky / .zshrc
Created August 11, 2013 18:55 — forked from SlexAxton/.zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete