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
$ echo "experimental-mode on; add server be_app/server10 10.0.1.5:80 check" |\ | |
socat stdio tcp4-connect:127.0.0.1:9999 |
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 | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 [filename] [etcd_version]" | |
exit 1 | |
fi | |
FILENAME=$1 | |
ETCD_VERSION=$2 | |
TIMESTAMP="$(date +%s)" |
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
" Specify a directory for plugins | |
call plug#begin('~/.vim/plugged') | |
Plug 'tpope/vim-sensible' | |
Plug 'pangloss/vim-javascript' | |
Plug 'mxw/vim-jsx' | |
call plug#end() | |
set nu | |
set encoding=utf-8 | |
let mapleader="," |
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 | |
set -e | |
repeat_char () { | |
printf '%0*d' "$2" 0 | sed 's/0/'"$1"'/g' | |
return 0 | |
} | |
if ! command -v lolcat; then |
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
sudo apt install -y rsyslog |
⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates
What this will cover
- Host a static website at S3
- Redirect
www.website.com
towebsite.com
- Website can be an SPA (requiring all requests to return
index.html
) - Free AWS SSL certs
- Deployment with CDN invalidation
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 | |
get_ms () { | |
date +'%s%N' | grep -oP '^[0-9]{13}' | |
} | |
show_usage () { | |
# ******************************************************************* | |
read -d '' help_text <<- EOF | |
vsleep - verbose sleep |
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
user web; | |
# One worker process per CPU core. | |
worker_processes 8; | |
# Also set | |
# /etc/security/limits.conf | |
# web soft nofile 65535 | |
# web hard nofile 65535 | |
# /etc/default/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
Code to change a request from / to /app1/ | |
reqirep ^([^\ :]*)\ /(.*) \1\ /app1/\2 | |
If urls in the response contain absolute urls it might be required to use this: | |
acl no_redir url_beg /app1/ | |
reqirep ^([^\ :]*)\ /(.*) \1\ /app1/\2 if !no_redir | |
The code makes sure that the method and url-path behind the / stays the same. Which method you need exactly might depend on the application thats running. | |
For readability of the above how change a request from /app1/ to /app1/app1redir/ | |
reqirep ^([^\ :]*)\ /app1/(.*) \1\ /app1/app1redir/\2 |
NewerOlder