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
| body { | |
| margin: 20px 0px 0px 50px; | |
| } | |
| .formattext { | |
| text-align: right; | |
| } | |
| .formatresult { | |
| text-align: left; |
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
| # BEFORE | |
| /tmp/git-cleanup/repo.git $ git count-objects -v | |
| count: 0 | |
| size: 0 | |
| in-pack: 204529 | |
| packs: 1 | |
| size-pack: 574968 | |
| prune-packable: 0 | |
| garbage: 0 | |
| size-garbage: 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
| OAuth = require('oauth').OAuth | |
| _ = require 'underscore' | |
| class LinkedInClient | |
| @baseUrl: 'https://api.linkedin.com' | |
| @requestTokenUrl: "#{@baseUrl}/uas/oauth/requestToken" | |
| @accessTokenUrl: "#{@baseUrl}/uas/oauth/accessToken" | |
| @authorizeUrl: "#{@baseUrl}/uas/oauth/authorize" | |
| @profileFields: ['id', 'headline', 'first-name', 'last-name', 'public-profile-url', 'picture-url', 'educations', 'positions', 'email-address'] |
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/sh | |
| (echo stats; sleep 0.1) | telnet localhost 11211 2>&1 | awk '/STAT $1/ {print $NF}' |
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 -e | |
| if [[ "$1" == "all" || "$1" == "none" ]]; then | |
| echo -n -e "Setting cluster.routing.allocation.enable to \e[0;33m${1}\e[0m..." | |
| resp=$(curl -s -XPUT localhost:9200/_cluster/settings?pretty -d "{\"transient\":{\"cluster.routing.allocation.enable\":\"${1}\"}}" | awk -F: '/acknowledged/ {print $2}') | |
| if [[ "$resp" == " true," ]]; then | |
| echo "Done!" | |
| else | |
| echo "Failed!" | |
| echo $resp | |
| exit 1 |
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 | |
| ## Usage: swappy [-t|--total] | |
| ## Identify the processes that use swap | |
| # Usage | |
| test "$1" = "-h" -o "$1" = "--help" && { | |
| grep '^##' <"$0" | cut -c4- | |
| exit 2 | |
| } |
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
| list-series () { | |
| curl -s "localhost:8086/db/statsd/series?u=root&p=root&q=list+series" | python -mjson.tool | awk "/${1}/ {print \$2}" | sed -E 's/(\"|,)//g' | sort | |
| } |
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
| google.com | |
| yahoo.com | |
| amazon.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
| forge "http://forge.puppetlabs.com" | |
| mod "puppetlabs/apt" | |
| mod "puppetlabs/ntp" | |
| mod "puppetlabs/stdlib" | |
| mod "puppetlabs/postgresql" |
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 | |
| # This script cleans up your EC2 instance before baking a new AMI. | |
| # Run the following command in a root shell: | |
| # | |
| # bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh) | |
| function print_green { | |
| echo -e "\e[32m${1}\e[0m" | |
| } |