Skip to content

Instantly share code, notes, and snippets.

@shaon
shaon / tmux.md
Created Jul 25, 2019 — forked from andreyvit/tmux.md
tmux cheatsheet
View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
View keybase.md

Keybase proof

I hereby claim:

  • I am shaon on github.
  • I am iamshaon (https://keybase.io/iamshaon) on keybase.
  • I have a public key ASBLbA7iOFgUvGn2CLgunTfMrbTuJas42jIiZVfS2WUf7Ao

To claim this, I am signing this object:

View aws-install-ssm-agent
#!/bin/bash
# This is an updated version of the aws-install-ssm-agent
# script that supports SUSE.
function die() {
echo "$@, exiting." >&2
exit 1
}
View My-UpdateSuseAmi.json
{
"schemaVersion":"0.3",
"description":"Updates AMI with Linux distribution packages and Amazon software. For details,see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sysman-ami-walkthrough.html",
"assumeRole":"{{AutomationAssumeRole}}",
"parameters":{
"SourceAmiId":{
"type":"String",
"description":"(Required) The source Amazon Machine Image ID."
},
"InstanceIamRole":{
View aws-update-linux-instance
#!/bin/bash
# This is an updated version of the aws-update-linux-instance
# script that supports SUSE.
PRE_UPDATE_SCRIPT_URL=''
POST_UPDATE_SCRIPT_URL=''
INCLUDE_PACKAGES=''
EXCLUDE_PACKAGES=''
View user-data
#!/bin/bash
function get_contents() {
if [ -x "$(which curl)" ]; then
curl -s -f "$1"
elif [ -x "$(which wget)" ]; then
wget "$1" -O -
else
die "No download utility (curl, wget)"
fi
View aws-install-ssm-agent
#!/bin/bash
# This is an updated version of the aws-install-ssm-agent
# script that supports SUSE.
function die() {
echo "$@, exiting." >&2
exit 1
}
@shaon
shaon / reinvent-2017-youtube.md
Created Dec 7, 2017 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions
View reinvent-2017-youtube.md

| Title | Description

View dnsupdate.sh
#!/bin/bash
echo "zone euca.example.net" > /tmp/dnsupdate
echo "server 10.17.198.5" >> /tmp/dnsupdate
echo "update delete `hostname`" >> /tmp/dnsupdate
echo "update add `hostname` 86400 A `hostname -I`" >> /tmp/dnsupdate
echo "debug yes" >> /tmp/dnsupdate
echo "send" >> /tmp/dnsupdate
/usr/bin/nsupdate -v /tmp/dnsupdate
View fwd.euca.example.net
;; filepath: /var/named/fwd.euca.example.net
$ORIGIN .
$TTL 86400 ; 1 day
euca.example.net IN SOA aoe-08-5.euca.example.net. root.euca.example.net. (
2011071306 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)