Skip to content

Instantly share code, notes, and snippets.

View utternerd's full-sized avatar

Matt Freitag utternerd

View GitHub Profile
@utternerd
utternerd / gist:550681cc16a3066b9c1799b270401679
Created March 12, 2022 06:56
Get Public IP in single command (IPv6)
dig @ns.sslip.io txt ip.sslip.io +short -6
@utternerd
utternerd / gist:b41b5468fa59a90f681bbf6f8f61f99b
Created March 12, 2022 06:55
Get Public IP in a single command (IPv4)
dig @ns.sslip.io txt ip.sslip.io +short -4
@utternerd
utternerd / AutoHotkey.ahk
Last active October 17, 2023 17:36
Elder Scrolls Online Macro
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Elder Scrolls Online, Healing Templar Rotation Macro
; @utternerd on NA Server, matt@utternerd.org
; This works well, but could be improved.
; == Functionality ==
@utternerd
utternerd / .inputrc
Last active May 4, 2016 17:08
BASH Page Up / Page Down History Search and Completion
"\e[5~": history-search-backward
"\e[6~": history-search-forward
@utternerd
utternerd / gist:387adf1d594bf5cf5cb1
Created October 16, 2015 04:33
Insert character at beginning of line
Use Ctrl+V to select the first column of text in the lines you want to comment.
Then hit Shift+i and type the text you want to insert.
Then hit Esc, wait 1 second and the inserted text will appear on every line.
@utternerd
utternerd / .inputrc
Last active August 23, 2016 17:29
ZSH Page Up / Page Down History Search and Completion
bindkey "^[[5~" history-beginning-search-backward
bindkey "^[[6~" history-beginning-search-forward
@utternerd
utternerd / top_cmd.sh
Last active August 29, 2015 14:11
Show top shell commands from current history
history | awk '{h[$2]++}END{for(i in h){print h[i],i|"sort -rn|head -20"}}' |awk '!max{max=$1;}{r="";i=s=60*$1/max;while(i-->0)r=r"#";printf "%15s %5d %s %s",$2,$1,r,"\n";}'
@utternerd
utternerd / .bashrc
Created December 7, 2014 21:57
Set Window Title in Bash
# change window title
echo -ne "\033]0; ${USER}@${HOSTNAME} +${SHLVL} @${SSH_TTY/\/dev\/} - `uptime` \007"
@utternerd
utternerd / sshconfig
Last active August 29, 2015 14:10
SSH Tunneling Configuration
Host mysql-tunnel
HostName example.com
IdentityFile ~/.ssh/some.key
LocalForward 3306 localhost:3306
@utternerd
utternerd / .bashrc
Last active August 29, 2015 14:10
Less verbose BASH Prompt
PROMPT_COMMAND='history -a;echo -en "\033[m\033[38;5;2m"$(( `sed -n "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo`/1024))"\033[38;5;22m/"$((`sed -n "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo`/1024 ))MB"\t\033[m\033[38;5;21m$(< /proc/loadavg)\033[m"'
PS1='\n\e[1;34m\][\e[1;37m\]\u@\H\[\e[1;37m\]:\e[0;34m\] \[\e[1;37m\]\w\[\e[0;37m\] (\t)\$ '