Skip to content

Instantly share code, notes, and snippets.

View culyun's full-sized avatar

Steve Simpson culyun

  • Leeson Consulting Ltd.
View GitHub Profile
@culyun
culyun / hex-to-code-words.sh
Last active October 6, 2021 09:57
Shell script to massage hex-encoded ascii data into an English code-phrase using the BIP-0039 word list.
#!/usr/bin/env bash
#
# vim:set filetype=bash ai shiftwidth=2 softtabstop=2 expandtab:
#
# Copyright © 2021 Steve Simpson
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
@culyun
culyun / archive-bash-history
Last active April 24, 2018 03:09
archive bash history
#!/bin/bash
# bash history management
# The bash reference manual says
# <quote>
# [At startup] The file named by the value of HISTFILE is truncated, if necessary,
# to contain no more than the number of lines specified by the value of HISTFILESIZE.
# </quote>
#
@culyun
culyun / mount-secrets
Created April 24, 2018 03:01
veracrypt mount helper
#!/usr/bin/env bash
mkdir -p "${HOME}/secrets"
# The following arguments are included to prevent spurious prompts from veracrypt,
# and should suffice for the simple use case:
# -t ==> Use text interface (-t)
# -k "" ==> Do not use key files
# --pim=0 ==> Use default "Personal Iterations Multiplier"
# --protect-hidden=no ==> Do not mount any hidden volumes read-only
@culyun
culyun / splitDesk
Created April 24, 2018 02:52
Tile windows with xrandr and wmctrl
#!/bin/bash
ICON=0
GapX=1
GapY=0
TOP_MARGIN=0
BOTTOM_MARGIN=46
LEFT_MARGIN=0
RIGHT_MARGIN=$ICON
@culyun
culyun / auto-refresh-chromium
Created April 24, 2018 02:41
Example of how to trigger actions with inotifywatch
#!/bin/bash
if [ "$1" == 'stop' ] ; then
watch-path stop refresh-chromium;
else
# Whenever "$PWD" changes, find the Chromium browser window with xdotool and force a page refresh
watch-path refresh-chromium "$PWD" -r -e modify --exclude '^.+\.(swp|svn|git|hg)' -- xdotool search --onlyvisible --class 'Chromium-browser' key --clearmodifiers ctrl+r ;
fi
@culyun
culyun / keybase.md
Created April 23, 2018 23:43
claim for keybase proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: