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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'multi_json' | |
Vagrant::Config.run do |config| | |
# Will load nodes/vagrant.json | |
VAGRANT_JSON = MultiJson.load(Pathname(__FILE__).dirname.join('nodes', 'vagrant.json').read) |
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
# Borrowed from https://coderwall.com/p/sikrdw | |
module Vagrant | |
module Provisioners | |
class Base | |
require 'chef' | |
require 'chef/config' | |
require 'chef/knife' | |
end |
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
set $is_trusted_ip false; | |
if ($http_x_forwarded_for ~ "68\.148\.96\.174") { | |
set $is_trusted_ip true; | |
} |
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 | |
# Thanks to: Ahmad Azizan | |
# http://blog.lab69.com/2012/02/renaming-mp3-files-with-ruby.html | |
# You need to require this.. | |
require 'rubygems' | |
require 'mp3info' | |
# This variable will hold your first argument as directory |
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 | |
# List all keys stored in memcache. | |
# Copied from: https://gist.github.com/bkimble/1365005 | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] | |
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/env bash | |
cat {{web_logs}}/access.log | sort -k1 | awk '{print $1}' | uniq -c | sort -k 1 -nr | head -n 20 |
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
ls | xargs du -hs | sort -nr |
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
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); |
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
#disable | |
launchctl unload "$HOME/Library/LaunchAgents/cx.pow.powd.plist" | |
#enable | |
launchctl load -Fw "$HOME/Library/LaunchAgents/cx.pow.powd.plist" |
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
# osx | |
ack -l "ReplaceMe" | xargs sed -i "" "s/ReplaceMe/withMe/g" | |
# linux | |
ack -l "ReplaceMe" | xargs sed -i "s/ReplaceMe/withMe/g" | |
#amember | |
ack --php -l "Release: 3\..\..PRO \(.Revision\: .*\)" | xargs sed -i "" "s/Release: 3\..\..PRO.*$/Release: xxxxxxxxxxxxxxxxxxx/g" |