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
func textualUtf8Resolver(textual []byte) ([]byte, error) { | |
var t map[string]interface{} | |
_ = json.Unmarshal(textual, &t) | |
response, err := json.Marshal(t) | |
if err != nil { | |
return nil, err | |
} | |
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
machines=($(docker-machine ls | sed '1d' | awk '{print $1}')) | |
for i in "${machines[@]}" | |
do | |
: | |
docker-machine ssh $i sudo docker login -u XXXXXXX -p XXXXXXXXXXXXXXX [REGISTRY]; | |
docker-machine ssh $i sudo docker pull [REGISTRY]/[IMAGE]:latest & | |
done |
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 | |
# relaunch with sudo if we aren't root | |
if [[ $EUID -ne 0 ]]; then | |
echo "$0: relaunching as sudo $0 $1 $USER" | |
sudo "$0" $1 $USER | |
exit $? | |
fi | |
real_user=$USER |
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 | |
PARAMETERS=`aws ssm get-parameters-by-path --path ${1} --with-decryption` | |
for row in $(echo ${PARAMETERS} | jq -c '.Parameters' | jq -c '.[]'); do | |
KEY=$(basename $(echo ${row} | jq -c '.Name')) | |
VALUE=$(echo ${row} | jq -c '.Value') | |
KEY=`echo ${KEY} | tr -d '"'` | |
VALUE=`echo ${VALUE} | tr -d '"'` |
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
git filter-branch --index-filter 'git rm --cached --ignore-unmatch blah.jar' -f --tag-name-filter cat -- --all | |
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch folder/' -f --tag-name-filter cat -- --all |
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
require 'mechanize' | |
require 'open-uri' | |
require 'rubygems' | |
require 'work_queue' | |
wq = WorkQueue.new 1000 | |
(1..5000).each do |number| | |
#beginning = Time.now | |
wq.enqueue_b 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
#!/usr/bin/env ruby | |
require 'net/smtp' | |
unless (2..3).include? ARGV.length | |
puts 'Usage: mail.rb SUBJECT TO [FROM]' | |
exit 1 | |
end | |
subject, to, from_ = ARGV |
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
# | |
# Sets Prezto options. | |
# | |
# Authors: | |
# Sorin Ionescu <sorin.ionescu@gmail.com> | |
# | |
# | |
# General | |
# |
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
def humanize secs | |
[[60, :seconds], [60, :minutes], [24, :hours], [1000, :days]].map{ |count, name| | |
if secs > 0 | |
secs, n = secs.divmod(count) | |
"#{n.to_i} #{name}" | |
end | |
}.compact.reverse.join(' ') | |
end | |
p humanize 1234 |
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
### Start Piperita Theme ### | |
# Theme by Jacob Tomlinson | |
# https://github.com/killfall/terminal-piperita | |
# Aliases to make ls easier to use in different modes, taken from Red Hat EL 6 | |
alias ls='ls -GFh' | |
alias ll="ls -l" | |
alias lo="ls -o" | |
alias lh="ls -lh" | |
alias la="ls -la" |
NewerOlder