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
| <?php | |
| // Your AWS secret key and access key | |
| $secretKey = '[YOUR_SECRET_KEY]'; | |
| $awsAccessKey = '[YOUR_ACCESS_KEY]'; | |
| $bucket = 'my-bucket'; | |
| /** | |
| * Calculate the HMAC SHA1 hash of a string. |
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
| package main | |
| // Source: http://divan.github.io/posts/go_concurrency_visualize/ | |
| import ( | |
| "fmt" | |
| "net" | |
| "time" | |
| ) |
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
| #!/bin/bash | |
| DIR=$1 | |
| MAX_SIZE_BYTES=$2 | |
| echo "Last Modified, Size, File Path" | |
| find ${DIR} -type f -size +${MAX_SIZE_BYTES}k -not -path "/proc/*" -exec ls -lh {} \; | awk '{ print $8 ": " $5 " " $9}' |
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
| !/bin/bash | |
| PORT=$1 | |
| if [ "$PORT" == "" ]; then | |
| echo "Usage: $0 [PORT]" | |
| exit 1 | |
| fi | |
| while [ true ] |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| func main() { | |
| http.HandleFunc("/hijack", func(w http.ResponseWriter, r *http.Request) { |
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
| ## mysql::master | |
| ruby_block "store_mysql_master_status" do | |
| block do | |
| node.set[:mysql][:master] = true | |
| m = Mysql.new("localhost", "root", node[:mysql][:server_root_password]) | |
| m.query("show master status") do |row| | |
| row.each_hash do |h| | |
| node.set[:mysql][:master_file] = h['File'] | |
| node.set[:mysql][:master_position] = h['Position'] | |
| end |
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
| In the situation you've accidentally already committed changes to your "master" branch and want the moved to a seperate branch: | |
| git branch [NEW_BRANCH_NAME] # Create new branch with the changes you just committed | |
| git reset --hard HEAD~[NUM_COMMITS] # Go back [NUM_COMMITS] commits. You *will* lose uncommitted work.*1 | |
| git checkout [NEW_BRANCH_NAME] # Checkout the newly created branch that contains your modifications |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.apple.newsyslog</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/sbin/newsyslog</string> | |
| </array> |
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
| echo "show info" | socat unix-connect:[STATS_SOCKET_PATH] stdio | |
| echo "show stat" | socat unix-connect:[STATS_SOCKET_PATH] stdio | |
| echo "show errors" | socat unix-connect:[STATS_SOCKET_PATH] stdio | |
| echo "show sess" | socat unix-connect:[STATS_SOCKET_PATH] stdio |