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
tfswitch 0.12.31 | |
terraform plan # should show no changes | |
tfswitch 0.13.7 | |
terraform 0.13upgrade | |
terraform state replace-provider -- -/aws hashicorp/aws | |
tfswitch 1.5.7 | |
terraform init | |
terraform plan # should show no changes | |
rm versions.tf | |
terraform apply # store new version to tfstate |
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
# vim: filetype=dosini: | |
add_newline = false | |
[username] | |
show_always = true | |
format = '[$user](bold green)' | |
[hostname] | |
ssh_only = false | |
format = '[@$hostname](bold green):' |
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
# after this commnad you can query https://localhost which will actually serve https://localhost:4200 | |
sudo iptables -t nat -A OUTPUT -s localhost -p tcp --dport 443 -j REDIRECT --to 4200 | |
# to view the rules | |
sudo iptables -L -t nat | |
# to remove the rule: | |
sudo iptables -t nat -D OUTPUT -s localhost -p tcp --dport 443 -j REDIRECT --to 4200 | |
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
# when run on localhost, you can see on localhost:1234 what remote_machine sees on 172.31.26.6:2345 | |
ssh remote_machine -fnNTL 1234:172.31.26.6:2345 |
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 is intended for forcing initial resync of mongo secondary | |
read -p "This will DELETE ALL data on the machine! If you wish to continue then type: 'sure'> " | |
if [[ ! $REPLY == 'sure' ]] | |
then | |
echo "Okay, bye!" | |
exit 1 | |
fi |
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
# print help | |
help: ## list available targets (this page) | |
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | |
clean:: ## clean all compiled files | |
find . -name '*.pyc' -delete |
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 | |
COMMAND=./test.sh | |
STDERR=./test.err | |
STDOUT=./test.out | |
# prepend timestamp followed by given string before each line of the output | |
IFS='' # preserve whitespaces | |
timestamp(){ while read line; do echo `date "+%Y-%m-%d %H:%M:%S"` $1 $line; done } | |
{ $COMMAND 2>&3 | timestamp "[$COMMAND]:" > $STDOUT; } \ |
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
# -*- coding: utf-8 -*- | |
from contextlib import contextmanager | |
from timeit import default_timer | |
@contextmanager | |
def elapsed_timer(): | |
start = default_timer() | |
elapser = lambda: default_timer() - start | |
yield lambda: elapser() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-pip/v0.0.2/leaflet-pip.js'></script> | |
<script type='text/javascript'> | |
window.onload=function(){ | |
var map = new L.Map('map', {center: new L.LatLng(49.1, -122.5), zoom: 10}); |
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
include/image | |
Edit=/usr/bin/kolourpaint %f | |
Open=/usr/lib/mc/ext.d/image.sh open ALL_FORMATS | |
View=%view{ascii} /usr/lib/mc/ext.d/image.sh view ALL_FORMATS | |
# vim sessions | |
shell/.vim | |
Open=/usr/bin/vim -S %f | |
NewerOlder