Skip to content

Instantly share code, notes, and snippets.

@asmagill
asmagill / moonscript_traceback.lua
Last active August 29, 2015 14:25
Hammerspoon debug.traceback modification for moonscript; minimally tested, so leave comments, if it does/doesn't work for you!
local module = {
--[=[
_NAME = 'moonscript.traceback.lua',
_VERSION = 'the 1st digit of Pi/0',
_URL = 'https://github.com/asmagill/hammerspoon-config',
_LICENSE = [[ See README.md ]]
_DESCRIPTION = [[
debug.traceback supplement for moonscript files
@asmagill
asmagill / gist:4b792359c7a01da46b2d
Last active November 19, 2021 10:14
Bash resize terminal function

I forget where I found this, so if anyone wants to claim attribution, let me know and I'll add a line here. If put into /etc/profile.d/serial-console.sh, the following will auto size a serial terminal windows size and create a function for manually adjusting later. Since I access RPIs and BBBs via the serial console, their tty names are already listed in the case statement; add others if your system is different. rsz helps when you later reconnect and minicom or screen is in a different sized window...

    rsz() {
        if [[ -t 0 && $# -eq 0 ]];then
                local IFS='[;' escape geometry x y
                echo -ne '\e7\e[r\e[999;999H\e[6n\e8'
                read -sd R escape geometry
                x=${geometry##*;} y=${geometry%%;*}
                if [[ ${COLUMNS} -eq ${x} && ${LINES} -eq ${y} ]];then

echo "${TERM} ${x}x${y}"