This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xv | |
profile=$1 # determine aws account to deploy. | |
eb_user_key=$2 # set environment variable to configuration of eb. | |
[ "${profile}" = "" ] && profile=default | |
[ "${eb_user_key}" = "" ] && eb_role_key=default-eb | |
if [ "${eb_user_key}" != "" ];then | |
AWS_EB_KEY_INFO=$(php -r '$credentials = parse_ini_file("'${HOME}'/.aws/credentials", true);echo $credentials["'${eb_user_key}'"]["aws_access_key_id"] . " " . $credentials["'${eb_user_key}'"]["aws_secret_access_key"];') | |
set -- ${AWS_EB_KEY_INFO} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usernames who will be using the Dropbox service | |
DROPBOX_USERS="username" | |
DAEMON=.dropbox-dist/dropboxd | |
start() { | |
echo "Starting dropbox..." | |
for dbuser in $DROPBOX_USERS; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install sysbench | |
$ apt-get install sysbench | |
# CPU benchmark, 1 thread | |
$ sysbench --test=cpu --cpu-max-prime=20000 run | |
# CPU benchmark, 64 threads | |
$ sysbench --test=cpu --cpu-max-prime=20000 --num-threads=64 run | |
# Disk benchmark, random read. See .fio files in this gist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# transcode-video.sh | |
# | |
# Copyright (c) 2013-2015 Don Melton | |
# | |
about() { | |
cat <<EOF | |
$program 5.13 of April 8, 2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Mac OS X webarchive is a binary format of a plist file. You can extract the contents manually: | |
# 1. convert the plist file into XML by "plutil -convert xml1 file.webarchive" | |
# 2. parse the resulted XML file by some XML parser | |
# 3. decode "WebResourceData" by Base64.decode64(data) in each key | |
# 4. save the decoded content into a file indicated by "WebResourceData" | |
# Thankfully, the plist library can take care of annoying steps 2 and 3. | |
# | |
# Preparation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modifies a pragprog's epub archive to use more suitable fonts on Sony | |
# PRS-505 eBook Reader. | |
task :default => :help | |
def in_filename | |
ENV['input'] | |
end | |
def out_filename |