Skip to content

Instantly share code, notes, and snippets.

View bng44270's full-sized avatar

Andy Carlson bng44270

View GitHub Profile
@bng44270
bng44270 / bootiso.sh
Last active August 5, 2022 12:57
Shell script wrapper easily booting ISO images with qemu
#!/bin/bash
#######################################
#
# Installation:
# <ROOT>/bin/bootiso.sh
# <ROOT>/etc/bootiso.conf
#
# Config file format (bootiso.conf)
#
@bng44270
bng44270 / jscron.js
Created July 28, 2022 16:18
Cron-ish scheduler framework in Javascript
/*
Requires range.js - https://gist.github.com/bng44270/36f42505c98b4277c608694cf0c93245
usage:
> var cron = new JSCron(false,true);
> cron.addJob(function() {
console.log("This runs every minute " + new Date().getMinutes());
},'This is a test job');
> cron.addJob(function() {
@bng44270
bng44270 / range.js
Created July 28, 2022 16:15
Quick and dirty Javascript range object (similar to Python range)
/*
usage:
> var thisRange = new Range(1,6);
> thisRange
[1, 2, 3, 4, 5, 6]
*/
class Range extends Array {
constructor(first,last) {
@bng44270
bng44270 / imagemap.js
Created July 20, 2022 15:23
Create an image/image map using Javascript
/*
ImageMap - Create an linked image/image map
Usage:
HTML:
<div id="headerspace"></div>
JS:
@bng44270
bng44270 / foscam.py
Created July 11, 2022 20:02
Capture images from multiple Foscam cameras
# Tested wtih Foscam Fi8910w camera
from os import listdir, remove as remove_file
from re import match as regex_match, sub as regex_sub
from random import random as gen_random
import requests
class Foscam:
def __init__(self, cachedir='/tmp', host='', user='', passwd=''):
@bng44270
bng44270 / servicenow_table.ps1
Last active May 23, 2022 14:23
ServiceNow Table API Library for Powershell
####################
# ServiceNow Table API Library for Powershell
#
# Usage:
# 1. Define connection (host, user, password):
#
# $conn = (New-ServiceNowConnection)
#
# 2. If performing an query, setup the query:
# (set the "IsOr" argument to $True for New-ServiceNowQueryBuilder function if query is using boolean OR):
@bng44270
bng44270 / password.ps1
Created March 21, 2022 15:40
Generate Random passwords using PowerShell
###########################
# Generate Random Passwords in Powershell
#
# Usage:
# 1. Load password.ps1 into memory (run ". password.ps1")
#
# If this command returns a policy error, the contents of
# password.ps1 may be copied and pasted into the Powershell
# command line.
#
@bng44270
bng44270 / dragdoc.js
Created March 15, 2022 17:45
Implement Drag-Scroll functionality for a DOM container
/*
Make content within a DOM container dragable
Usage:
<div id="content"></div>
var container = new DragDoc('content');
@bng44270
bng44270 / kpcli.py
Created March 11, 2022 16:06
KeePass CLI
#####################
# KeePass CLI
#
# Return passwords, create, list, and delete groups and entries from KeePass database files
#####################
from pykeepass import PyKeePass
from arguments import Arguments
from getpass import getpass
@bng44270
bng44270 / vimrc
Last active March 11, 2022 16:49
Custom config for vim and gvim including Git and Filesystem functions
" Standard settings
set number
set autoindent
syntax on
colorscheme slate
set laststatus=2
" Keyboard shortcuts
nnoremap <C-l> :tabnext<CR>
nnoremap <C-a> :tabprevious<CR>