See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443 | |
sudo sh -c "iptables-save > /etc/iptables.rules" | |
sudo apt-get install iptables-persistent | |
#allows localhost traffic to connect to 443 from 8443 | |
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 443 -j REDIRECT --to-port 8443 |
Reference https://stackoverflow.com/a/34407620/13287790
$ printf %s 'encode this'|jq -sRr @uri
encode%20this
$ jq -rn --arg x 'encode this' '$x|@uri'
encode%20this
# -r (--raw-output) outputs the raw contents of strings instead of JSON string literals. -n (--null-input) doesn't read input from STDIN.
# Sometimes after a sprint, all the remaining branches are just taking up space. | |
# Here's a small snippet to remove all your local branches in one go. | |
git branch | grep -v "master" | xargs git branch -D |
function bashLogger() { | |
local logLevel="INFO" | |
local logMessage="" | |
[[ $# -ge 1 ]] && { logMessage=$1;shift;} | |
[[ $# -ge 1 ]] && { logLevel=${logMessage}; logMessage=$1; shift;} | |
local additionalMessages="$@" | |
local timestamp=$(TZ=UTC-1 date +'%Y-%m-%d %H:%M:%S,%3N') |
Here are several different ways to test a TCP port without telnet.
Source: https://gist.github.com/Khoulaiz/41b387883a208d6e914b
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
# Remove all untagged images | |
docker rmi $(docker images | grep "^<none>" | awk '{print $3}') | |
# | |
docker container prune | |
# clean up all "Exited" containers | |
docker rm $(docker ps -a | grep Exited | awk '{ print $1 }') |
# Lists one line per Java environment installed (and known to the /usr/bin/java command). | |
# You can still have e.g. Zulu installations which are not registered | |
/usr/libexec/java_home -V |