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 bash | |
# Example | |
# find ./ -type f -iname '*.jpg' | ./fix_date '+1388 days+9 hours' | |
set -o pipefail | |
set -o nounset | |
set -o errexit | |
# time difference |
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
# Turn on "three finger drag" | |
# https://support.apple.com/en-us/HT204609 | |
# Get back three finger tap to lookup the text | |
# http://notebooks.com/2015/10/05/how-to-get-back-three-finger-tap-os-x-el-capitan/ | |
# OS X per windows language | |
# http://superuser.com/questions/33741/os-x-per-windows-language | |
### Install brew |
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
Problems: | |
- lack of group nesting. Scope of group vision is flat due to ini format. | |
- problem with handling SSH host key prompts http://toroid.org/ansible-ssh-locking |
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
# Add item to runlist | |
export item='recipe[job::redis]' | |
knife exec -E 'nodes.find("chef_environment:staging") {|n| puts n.run_list << ENV["item"] unless n.run_list.include?(ENV["item"]); n.save }' | |
# Delete item from runlist | |
export item='recipe[job::redis]' | |
knife exec -E 'nodes.transform("chef_environment:staging") {|n| puts n.run_list.remove(ENV["item"]); n.save }' | |
# Replace item in runlist | |
export item_from='recipe[base::nginx]' |
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
yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install | |
sysctl -w net.ipv4.ip_forward=1 | |
http://wiki.hetzner.de/index.php/Netzkonfiguration_CentOS/en#Routed_.28brouter.29 | |
http://docs.openstack.org/image-guide/content/ch_modifying_images.html | |
https://github.com/clauded/virt-tools/blob/master/virt-install-cloud.sh |
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
PPA=() | |
PKG=() | |
PKG+=( | |
pv | |
mc | |
wget | |
curl | |
whois | |
vim-nox |
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 -o pipefail | |
set -o errtrace | |
set -o nounset | |
set -o errexit | |
exec 1> >(while IFS= read -r line; do echo "$(date) [DEBUG] $line"; done >>/tmp/test) | |
exec 2> >(while IFS= read -r line; do echo "$(date) [ERROR] $line"; done >>/tmp/test) | |
date | |
function finish { |
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 | |
# Usage: | |
# cat some.json | ruby -e "$(curl -s https://gist.githubusercontent.com/kam1kaze/5002bd42e07694251c4b/raw/json_to_line)" | |
require 'json' | |
r = JSON.parse(ARGF.read) | |
def extract(hash, parent) |
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
sysdig -s 2000 -A -c echo_fds proc.name=chef-client and fd.type=ipv4 | |
chef-shell> node.run_list.expand(node.chef_environment).run_list_trace.each { |k,v| puts "#### " + k.to_s + "\n"+ v.join("\n") if v.grep(/___PATTERN___/).any? } | |
# Disable the stupid auto-logout (https://stackoverflow.com/questions/17397069/unset-readonly-variable-in-bash/21294582#21294582) | |
unset TMOUT &> /dev/null | |
if [[ $? -ne 0 ]]; then | |
comm=$(echo -e "attach $$\ncall unbind_variable(\"TMOUT\")\ndetach\nquit") | |
gdb="gdb -q -n" |
NewerOlder