Skip to content

Instantly share code, notes, and snippets.

@disaac
disaac / jopbuild.sh
Created April 12, 2023 16:46
Download and Build Joplin Desktop for MacOS arm64
#!/usr/bin/env bash
# Modified from https://github.com/laurent22/joplin/issues/6052#issuecomment-1356864011
# Tested on latest dev branch as of 20213-04-12
function initVars() {
REPO="${JOP_REPO:-"laurent22/joplin"}"
repoUrl="https://github.com/${REPO}.git"
srcBaseDir="joplin"
appDesktopPath="packages/app-desktop"
packageJsonPath="${appDesktopPath}/package.json"
dmgPath="node_modules/dmg-builder/out/dmg.js"
@disaac
disaac / isomnt.sh
Last active November 16, 2021 16:54
isomnt - mount iso files easily on macos 10.13 and greater
#!/usr/bin/env bash
function initVars () {
ENVFILE=${ISOMNT_ENVFILE:-"${HOME}/bin/.isomnt_env"}
if [[ -s "${ENVFILE}" ]]; then
# Import all the environment variables for envfile
source "${ENVFILE}"
fi
MNT_BASE_DIR=${MNT_BASE_DIR:-/var/tmp}
MNT_SUB_DIR=${MNT_SUB_DIR:-iso_mnt}
MNT_DIR_SUFFIX=${MNT_DIR_SUFFIX:-$(date +"%Y%m%H%M%S")}
@disaac
disaac / bash-template
Created April 13, 2021 13:05 — forked from rkottmann/bash-template
A template bash script based on google style guide with some little improvements
#!/bin/bash
# Here short description of this script
# This is just a template to be used for writing new bash scripts
###
# Based on Google Style Guide: https://google.github.io/styleguide/shell.xml
# General remarks
# * Executables should have no extension (strongly preferred) or a .sh extension.
# * Libraries must have a .sh extension and should not be executable
@disaac
disaac / bash_get_options_template.sh
Created January 15, 2021 14:44 — forked from jefferys/bash_get_options_template.sh
A template for a bash function parsing CLI options and arguments into global variables, including short, long, repeated, counted, and --.
###############################################################################
# DESC: Parses arguments with the bash built-in getopts, but allows for
# long options too. This only works when each long option has a short option,
# although short options need not have long ones. Designed to create global
# variables named opt_<option> containing the parsed command line options, and
# an array variable called opt_args with any additional non-option arguments.
# This is all hard coded, but simple to modify for local use. See the ###
# sections for what needs to be changed to create your own option variable set.
# Supports bundled options and the use of "--" to signal end of options.
# Does not support negated options. You can always just declare "myFlag" and
@disaac
disaac / config.tf
Created February 14, 2020 18:02 — forked from kerr-bighealth/config.tf
iam-user module
terraform {
required_version = ">=0.12, <0.13"
}
@disaac
disaac / config.sh
Created February 3, 2020 18:52 — forked from joseluisq/config.sh
Bash script for executing MySQL query strings
# Database configuration
########################
# Use this file as database custom configuration file
DB_NAME='mydb'
DB_HOST='127.0.0.1'
DB_USER='usr'
DB_PASSWD='pwd'
@disaac
disaac / viscosity-to-ios-connect.rb
Created June 5, 2018 15:18 — forked from iMerica/viscosity-to-ios-connect.rb
Quickly convert all of your Viscosity connections into OVPN configuration files for OpenVPN for iOS (bundles certificates and keys in the files too)
Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf").each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).lines.each do |line|
line.strip!
if line.start_with?('#viscosity name')
### Keybase proof
I hereby claim:
* I am disaac on github.
* I am sdunixgeek (https://keybase.io/sdunixgeek) on keybase.
* I have a public key ASC_xQP7y6b6T33NMjdnSmny_cmTLdqcMWsHiuasNYwRzgo
To claim this, I am signing this object:
@disaac
disaac / gist:52356cb35f1a6a815da4248d80bc5665
Created June 30, 2017 16:45
cisco csr 1000v user-data example
ios-config-0001="hostname testcsr"
ios-config-0002="logging trap debugging"
ios-config-0003="logging facility syslog"
........
ios-config-0149="end"
ios-config-0150="write memory"