Skip to content

Instantly share code, notes, and snippets.

@Hobadee
Hobadee / create-ansible-playbook.sh
Last active April 25, 2023 05:41 — forked from skamithi/create-ansible-playbook-template.sh
script to create ansible playbook structure
#!/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
@Hobadee
Hobadee / gam
Created February 25, 2022 23:47
#!/usr/bin/env bash
GAM=./gam.symlink
CLIENTS=$(ls $GAMCFGDIR)
for DIR in $CLIENTS; do
if [[ $DIR == $1 ]]; then
export GAMCFGDIR=$GAMCFGDIR/$DIR
shift
@Hobadee
Hobadee / bundleID.sh
Created May 12, 2022 05:52
Script to pull a BundleID for a given app in the Apple App store
#!/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.
/**
* 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;