This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Swap the endian-ness of bits (bitLen=1), bytes (bitLen=8), or whatever bitLen you want | |
* | |
* Inspired by: https://stackoverflow.com/a/47668549 | |
*/ | |
function swapEndian(num, bitLen){ | |
// Takes num, transform to binary string | |
let bin = num.toString(2); | |
let len = bin.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# This is a template for bash scripts | |
# | |
## | |
# usage() will be run when this script is run with the -h (help) options or when | |
# incorrect arguments are passed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
GAM=./gam.symlink | |
CLIENTS=$(ls $GAMCFGDIR) | |
for DIR in $CLIENTS; do | |
if [[ $DIR == $1 ]]; then | |
export GAMCFGDIR=$GAMCFGDIR/$DIR | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to create ansible playbook directories | |
# With thanks to https://gist.github.com/skamithi/11200462 for giving me the idea | |
# We attempt to lay everything out according to Ansible best practices: | |
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#playbooks-best-practices#directory-layout | |
gitinit(){ | |
# Start with sensible .gitignore defaults |