Skip to content

Instantly share code, notes, and snippets.

Alec WM alecdwm

Block or report user

Report or block alecdwm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alecdwm
alecdwm / server_name.sh
Created Mar 12, 2018
My preferred method of connecting to personal servers
View server_name.sh
# On the first attempted connection since an ssh-agent restart,
# you will be prompted for your ssh key's passphrase.
#
# On the first attempted connection since a server restart,
# a new tmux session will be created.
#
# On subsequent connections, the existing tmux session will
# be used.
#
# Usage:
@alecdwm
alecdwm / countdown.sh
Last active Mar 12, 2018
A small countdown timer in bash
View countdown.sh
#!/bin/bash
# Usage: countdown --help
while test $# -gt 0; do
case "$1" in
"-h"|"--help")
showhelp="true"
shift; continue;;
"-v"|"--version")
@alecdwm
alecdwm / get-sha256-fingerprint.sh
Created Mar 12, 2018
Fetch the sha256 fingerprint of a TCP server's TLS cert
View get-sha256-fingerprint.sh
#!/bin/bash
# Works for any TLS-enabled TCP server, but originally intended for
# fetching the sha256 fingerprint of an irc server's TLS cert
# when the server refuses to use certificates from a trusted CA.
#
# Example:
# $ get-sha256-fingerprint.sh irc.owls.io:6697
openssl s_client -connect "$1" < /dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin | sed -e "s/://g"
@alecdwm
alecdwm / freem.sh
Last active Mar 12, 2018
A quick script to check whether your system's current memory usage could fit entirely inside its swap space
View freem.sh
#!/bin/bash
# A quick script to check whether your system's current memory
# usage could fit entirely inside its swap space.
#
# Might be useful in determining the likelihood of a
# successful suspend to disk operation.
MEM_USED=$(free -m | grep Mem | awk '{print $3}')
SWAP_FREE=$(free -m | grep Swap | awk '{print $4}')
View keybase.md

Keybase proof

I hereby claim:

  • I am alecdwm on github.
  • I am alecdwm (https://keybase.io/alecdwm) on keybase.
  • I have a public key ASDO3_Yrr2zxqQQD8nJBfpZg4gcmOzOzKEz0BABoyXXStQo

To claim this, I am signing this object:

You can’t perform that action at this time.