Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

  • 48°52.6′S 123°23.6′W
View GitHub Profile
dialog --textbox /Users/jhyland/CPU.txt 20 120
dialog --title "Dialog #1" \
--keep-window \
--begin 2 2 --yesno "" 0 0 \
--and-widget --clear --title "Dialog #2" --begin 4 4 --yesno "" 0 0 \
--and-widget --title "Dialog #3" --begin 6 6 --yesno "Yesno box" 20 40 \
--and-widget --clear --title "Dialog #4" --begin 4 4 --textbox content/CPU.txt 30 120 \
--add-widget --clear --title "Some Gauge" --gauge "Fooo" 20 100 30
#!/usr/local/bin/bash
declare -A cfg
cfg['app']='com.microsoft.Outlook'
cfg['limit']='20'
proc_pid=$(lsappinfo info ${cfg['app']} -only pid | cut -d '=' -f2)
if [[ -z ${proc_pid} ]]; then
echo "Unable to find Outlook running" 1>&2
function _err {
echo "${1}" 1>&2
[[ -n $2 ]] && exit $2
}
function trim {
if test -p /dev/stdin; then
data="$(</dev/stdin)"
function verify(button) {
document.getElementById('verify').innerHTML = 'Processing...';
aes_key_verify();
}
/*
* JavaScript AES implementation using Counter Mode
*
* Copyright (c) 2010 Robert Sosinski (http://www.robertsosinski.com)
* Offical Web Site (http://github.com/robertsosinski/js-aes)
function __trim {
if test -p /dev/stdin; then
data="$(</dev/stdin)"
elif test -n "${1}"; then
data="$*"
else
return 1
fi
echo "${data}" | sed -E -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g'
@jhyland87
jhyland87 / colors.sh
Last active September 29, 2022 00:41
declare -A _c
_c[reset]=$(tput sgr0)
_c[bold]=$(tput bold)
_c[red]=$(tput setaf 1)
_c[grn]=$(tput setaf 2)
_c[yel]=$(tput setaf 3)
_c[cya]=$(tput setaf 6)
#!/usr/bin/bash
function trim {
if test -p /dev/stdin; then
data="$(</dev/stdin)"
elif test -n "${1}"; then
data="$*"
else
return 1
fi
#!/usr/bin/python
import json
import os
import sys
ff_folder = None
for f in os.listdir('/home/guest/.mozilla/firefox'):
if f.endswith('.default'):
// ==UserScript==
// @name Miscellaneous Javascript utilities
// @namespace https://raw.githubusercontent.com/jhyland87/tampermonkey/master/common/utils.js
// @version 0.1
// @description Add some additional methods to the standard javascript prototypes
// @author Justin Hyland (j@linux.com)
// @include *
// @match *
// @homepage https://github.com/jhyland87/tampermonkey
// @grant none
@jhyland87
jhyland87 / get-session-cwd.sh
Created November 17, 2017 15:45
Parse the lsof output to display what users/ttys are in what directories
lsof | awk '$1 == "bash" && $4 == "cwd"'