- Run vim without loading ~/.vimrc:
vim -u NONE
- Add quotes around a select word (Requires vim-surround):
S"
- Select entire word no matter where the cursor is:
viw
- Select entire word including trailing space no matter where the cursor is:
vaw
- Enclose entire line in quotes (Needs vim-surround plugin):
yss”
- Comment out paragraph (Requires vim-commentary):
gcap
- Delete quotes around a string:
ds"
- Convert buffers to tabs:
:tab ball
- Close buffer:
:bd
- Uppercase selection:
gU
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 | |
meta_url="http://169.254.169.254/latest/meta-data" | |
instance_id=$(curl -sf ${meta_url}/instance-id) | |
role=$(aws ec2 describe-tags --filters \ | |
"Name=resource-type,Values=instance" \ | |
"Name=resource-id,Values=${instance_id}" \ | |
"Name=key,Values=role" \ | |
| jq -r .Tags[].Value) |
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 | |
# | |
# SSH to an EC2 instance by name | |
# | |
# You need the AWS cli (pip install awscli) | |
# | |
if [[ -z $1 ]]; then | |
echo 'You must specify an instance name!' | |
exit 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
# tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo | |
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes | |
14:32:33.525122 IP 127.0.0.1.49777 > 127.0.0.1.9200: Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980 | |
E...^.@[email protected]#...}L............... | |
..#...#.GET /index/_search HTTP/1.1 | |
Host: 127.0.0.1:9200 | |
Accept: */* | |
Content-Length: 845 | |
Content-Type: application/x-www-form-urlencoded |
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
# http://replygif.net/about | |
# You need jq and rl | |
if which rl >/dev/null; then | |
replygif_api_key='39YAprx5Yi' | |
tags=(pleased approval excited party clapping dance happy) | |
random_tag=${tags[$RANDOM % ${#tags[@]} ]} | |
gif=$(curl -s http://replygif.net/api/gifs?api-key=${replygif_api_key}\&tag=${random_tag} | jq .[].file -r | rl -c1) | |
hipchat_message="(success) -> ${gif}" | |
fi |
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
Create the XML plist file ~/Library/LaunchAgents/net.syncthing.plist: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>net.syncthing</string> | |
<key>Program</key> | |
<string>/Users/zombie/bin/syncthing</string> |
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
### Keybase proof | |
I hereby claim: | |
* I am z0mbix on github. | |
* I am z0mbix (https://keybase.io/z0mbix) on keybase. | |
* I have a public key whose fingerprint is 310E C49B 374C EE0B 5A53 DB8E FFCE 5C10 5D81 AB88 | |
To claim this, I am signing this object: |
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
I have exported SDK_USERNAME, SDK_PASSWORD and SDK_PROVIDER=rackspace-uk | |
I already use these credentials with other rackspace API tools like pyrax. | |
$ packer validate staging-web-rackspace.json | |
Template validated successfully. | |
$ cat staging-web-rackspace.json | |
{ | |
"builders": |
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
# cat /etc/redhat-release | |
CentOS release 6.5 (Final) | |
golang from EPEL: | |
# rpm -qi golang | |
Name : golang Relocations: (not relocatable) | |
Version : 1.1.2 Vendor: Fedora Project | |
Release : 4.el6 Build Date: Fri 20 Sep 2013 16:21:49 BST | |
Install Date: Thu 09 Jan 2014 15:14:13 GMT Build Host: buildvm-17.phx2.fedoraproject.org |