start new:
tmux
start new with session name:
tmux new -s myname
server { | |
listen 80; | |
listen 443 ssl; | |
server_name $server_name; | |
# Don't send the nginx version number in error pages and server header. | |
server_tokens off; | |
# HSTS - HTTP > HTTPS redirect | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; |
var arr = [], l = document.links; | |
for(var i=0; i<l.length; i++) { | |
arr.push(l[i].href); | |
} | |
arr.forEach(function (e) {console.log(e)}); |
for container in $(docker images | awk '{ print $1 }' | grep -v 'REPOSITORY'); do docker pull $container; done |
# ping until host is up, then ssh to host. | |
until ping -c1 $hostname >/dev/null 2>&1; do ssh $hostname; done |
#!/usr/bin/bash | |
# this one liner searches for a value recursively in cloudtrail logs, to output | |
# a json structure that can be parsed back through jq later for further slicing | |
# and dicing of the data. | |
zgrep -Rhi "$VALUE" . | jq -c '.[]' | awk '{ print $0, "\n" }' > results.json |
$!/bin/bash | |
# if imagemagick is not installed, install it. | |
if ! command -v mogrify &> /dev/null | |
then | |
brew install imagemagick | |
fi | |
# convert heic files to jpg | |
mogrify -format jpg *.heic |
#!/bin/bash | |
# say -v ? lists the voices available | |
for voice in $(say -v ? | awk '{ print $1 }') | |
do | |
echo "==> ${voice}" | |
say -v $voice "hello this is ${voice}" | |
sleep 1 | |
done |
# requires pup, and jq to be installed | |
# this is likely to break based on the css selector, but a quick hack for now. | |
curl "https://docs.aws.amazon.com/general/latest/gr/rande.html" | pup "#w420aac12b7b9c13 > tbody > tr json{}" | jq '.[].children | { region: .[1].text, name: .[0].text} ' | sed -e '$!s/"$/",/' | sed -e 's/}/},/' |
#!/usr/bin/bash | |
cat .env | awk -F"\=" '{ print $1 }' | grep -v -e '^$' | while read line; do echo "ENV $line=\"\""; done |