Skip to content

Instantly share code, notes, and snippets.

View chaorace's full-sized avatar

Christopher Crockett chaorace

View GitHub Profile
@chaorace
chaorace / direcpathspeedtest.log
Created February 19, 2017 19:03
DirecPath Speedtests
The following info was collected using speedtest-cli version 1.0.2 at the demarcation point between my LAN and Direcpath's WAN
Wed 8 Feb 00:04:25 EST 2017
Ping: 68.945 ms
Download: 10.10 Mbit/s
Upload: 2.81 Mbit/s
Wed 8 Feb 01:00:01 EST 2017
Ping: 52.566 ms
Download: 8.55 Mbit/s
Upload: 2.42 Mbit/s
Param([switch]$l)
$raw = arp -a | Select-String 'dynamic'
[regex]$rgx = '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
[regex]$arprgx = '\w{2}-\w{2}-\w{2}-\w{2}-\w{2}-\w{2}'
$ips = $rgx.Matches($raw) | %{$_.Value}
$hosts = $ips | % {
try{
@chaorace
chaorace / gist:f4d5dce9000edf89713918d4bc380fdb
Last active February 6, 2018 09:41
surfingKeys Config
//Custom surfingkeys mappings by chaorace
//Makes basic navigation more cVim-like
//Some comfort tweaks for aceVim
//Some custom bindings for my common sites
//Regular mappings
map("K", "R");
map("J", "E");
map("u", "e");
@chaorace
chaorace / DSRExtractor.ps1
Last active November 12, 2019 14:15
DSR powershell CSV data extractor
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]$csvPath
)
#HACK: DSR's CSV export has redundant headers by default. This overrides them.
$fixedHeader = 'record_number','project_id','flag','process1_completed','process1_processing','recheck_date','expire_date','dt_added','dt_archived','attempt_count','ordered','warning_count','error_count','email_sent','service_flag','Site_Name','Site_Id','address1','address2','city','state','zipcode','country','service_phone','contact_name','Site_Manager_Phone','contact_phone_alt','contact_email','contact_name2','District Manager Phone','contact_email2','email','id','dt_order_complete','approved','archived','selected_service','decline_description','more_phones','alarm_system','add_site_nidloc','add_site_installtime','add_site_wiring','add_site_dwellingtype','date','order_id','approver_name','approver_email','changed_values','dt_ordered','dt_approved','dt_declined','request_dial','result_check_timed_out','network_userid','branch_number','branch_manager_name
@chaorace
chaorace / botfile.sh
Last active October 25, 2019 21:06
Dotfile Bootstrapper
#!/usr/bin/env sh
# Reminder: curl -sL dot.chray.cc | bash
git clone --separate-git-dir=$HOME/.dotfiles https://github.com/chaorace/.dotfiles.git tmpdotfiles
rsync --recursive --verbose --exclude '.git' tmpdotfiles/ $HOME/
rm -rf tmpdotfiles
source $HOME/.bashrc
dotfiles config --local status.showUntrackedFiles no
@chaorace
chaorace / status.js
Created January 31, 2020 20:00
ATT Express Ticketing Javascript dump
var outage = 0,
ticketStatus = 0,
ticketTypeID = 3,
counter = 0,
ticketInfo = {},
ticketData = {},
currentDate = new Date(),
copyYear = currentDate.getFullYear(),
chatAvail = 1,
attESHr,
@chaorace
chaorace / sound-switcher.js
Created June 10, 2020 02:53
Linux pacmd (PulseAudio) output device sink toggler script
#!/usr/bin/node
// You will need node.js installed to run this!
// Invoke this script to toggle between the two configured devices
// Make sure the following is configured in /etc/pulse/default.pa:
// load-module module-stream-restore restore_device=false
// Configure the two devices to toggle between here
// Use "pacmd list-sinks" to find device names to use here, the script won't work if you don't!
@chaorace
chaorace / Base Files
Created July 30, 2020 03:39
Linux Civ6 file trees (10.0.3.31)
~/steam/SteamLibrary/steamapps/common/Sid Meier's Civilization VI/steamassets/base/assets λ tree -P '*.xml|*.lua'
.
├── arx
├── benchmark
│   └── saves
├── civ6_22dc49ee484bf6d6.xml
├── civ6_82813892b635e346.xml
├── civ6_829a766ba6fe2e17.xml
├── civ6_88046f9c02be9843.xml
├── civ6_885bb9ad2b28bac3.xml
@chaorace
chaorace / gist:c25a18612cbdfbd5cacafcd52f2375c1
Created August 4, 2020 19:15
ServiceNow GlideElement to JS native data conversion function (Global Scope)
/**
* Processes a given GlideElement into the closest available JS type
*
* Will return null if the value is empty or if the field is misconfigured.
* Will return undefined if value is exactly equal to undefined.
*
* Note that journals will only yield HTML output if both preferFullJournal and preferHtml options are true.
*
* @param {GlideElement_proto} value The GlideElement to convert
* @param {Object} [options] Options container. All provided options are off by default
@chaorace
chaorace / gist:f34db6fbcb273b787089257d77227d29
Last active August 27, 2020 14:34
ServiceNow Babel Helpers
/* eslint-disable */
var babelHelpers = (function() {
var decoratorsApi = {
elementsDefinitionOrder: [["method"], ["field"]],
initializeInstanceElements: function (O, elements) {
["method", "field"].forEach(function (kind) {
elements.forEach(function (element) {
if (element.kind === kind && element.placement === "own") {
this.defineClassElement(O, element);
}