This file contains hidden or 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
# brew install youtube-dl | |
function youtube_music | |
{ | |
$(youtube-dl -f 37/22/18 "$1" --extract-audio --audio-format mp3 | tee /dev/tty) | |
} | |
function youtube_video | |
{ | |
$(youtube-dl -f 37/22/18 "$1" | tee /dev/tty) |
This file contains hidden or 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
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com |
This file contains hidden or 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
# NB! must be loaded after [require 'capistrano/ext/multistage'] | |
namespace :multistage do | |
desc "List available stages" | |
task :list, :except => { :no_release => true,:stages => true } do | |
print "#{stages.join(',')}\n" | |
end | |
end | |
# overload config to allow stage listing w/o selected stage | |
if callbacks[:start] |
This file contains hidden or 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 php | |
<?php | |
class Coder | |
{ | |
const CRYPT_CIPHER = MCRYPT_RIJNDAEL_128; | |
const CRYPT_MODE = MCRYPT_MODE_ECB; | |
protected static function get_crypt_iv() | |
{ |
This file contains hidden or 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
function cask_install() { | |
if brew cask info "${@}" | grep "Not installed" > /dev/null; then | |
brew cask install "${@}" | |
else | |
echo "${@} is already installed." | |
fi | |
} | |
function cask_upgrade() { | |
if brew cask info "${@}" | grep "Not installed" > /dev/null; then |
This file contains hidden or 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
function pear_remove { | |
local channel="$1" | |
if [ -z $channel ]; then | |
echo "Error: channel must be provided" | |
return 1 | |
fi | |
for pkg in $(pear list -c "$channel" | awk '{if ( $2 ~ /([0-9]+)\.([0-9]+)\.([0-9]+)/ ) print $1}') ; do | |
pear uninstall "$channel/$pkg" |
This file contains hidden or 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 bash | |
# | |
# Remove any argument matching --env= and prepend --env=test | |
# | |
args=("$@") | |
idx=0 |
This file contains hidden or 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 a Webserver | |
apt-get -y install apache2 | |
# Target docroot to /home/satis/web/ | |
# Install PHP5 CLI and needed programs. | |
apt-get -y install php5-cli php5-curl php5-json git wget | |
# Add a specifix user for our task | |
adduser satis |
This file contains hidden or 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
# Create a new Token | |
curl -u 'githubuser' -d '{"note":"Your Application"}' https://api.github.com/authorizations | |
# It is: "ebab4dc37e654bb230a9c69ebcd5f38e9a81e210" | |
#{ | |
# "created_at": "2013-01-04T18:00:28Z", | |
# "app": { | |
# "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api", |
This file contains hidden or 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
# Cronjob for poor man monitoring of server health | |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
# Every sunday, check for apt-get upgrades. | |
33 3 * * 0 root apt-get update ; apt-get -q --simulate upgrade | |
# Every sunday, check for SMART errors. | |
34 3 * * 0 root echo 'SMART Sectors'; smartctl -a /dev/sda | grep -i sector ; smartctl -a /dev/sdb | grep -i sector; echo 'SMART All'; smartctl -a /dev/sda ; smartctl -a /dev/sdb |