Skip to content

Instantly share code, notes, and snippets.

@metrofx
metrofx / check-http-resp-code.sh
Created March 6, 2014 10:33
I'm tired of waiting for DNS Propagation, so I created this script and put it in crontab. Then I leave my desk for pingpong session...
#!/bin/bash
TOKEN=<your Pushover token>
USER=<generated by Pushover>
MSG="Udah up nih bro!"
URL="url-you-need-to-check"
out=$(curl --write-out "%{http_code}\n" --silent --output /dev/null $URL)
if [ $out = '200' ] ; then
curl -s \
-F "token=$TOKEN" \
-F "user=$USER" \
@metrofx
metrofx / glog
Created February 12, 2014 07:56
Pretty git log, displays 20 last commits.
#!/bin/sh
git --no-pager log -n 20 --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative