Skip to content

Instantly share code, notes, and snippets.

View divinehawk's full-sized avatar

DivineHawk divinehawk

View GitHub Profile
@divinehawk
divinehawk / mypay-findleave.js
Last active July 1, 2025 08:54
mypay-findleave.js
/* mypay-findleave.js
Javascript Snippet to find source of leave balances
*/
var docs = new Array();
var leaves = new Map();
var balances = new Map();
var gains = new Map();
async function getLes() {
#!/usr/bin/python3
# Update or add an AAAA record for your local machine using cloudflare API
# Required: Set DOMAIN to your domain and KEY to your cloudflare API token
# Note: This uses Linux iproute2 for getting the IPv6 address
import requests
import xml.etree.ElementTree as ET
import socket
import os
import sys
import json
@divinehawk
divinehawk / aetna-eob.js
Last active September 11, 2024 10:05
Download Aetna EOBs
/* aetna-eob.js
Javascript Snippet to bulk download Aetna EOB
to a ZIP file
*/
const LIMIT=-1; // set -1 for no limit (2 years on server)
/* JSZip */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=t()}}(function(){return function s(a,o,h){function u(r,t){if(!o[r]){if(!a[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=o[r]={exports:{}};a[r][0].call(n.exports,function(t){var e=a[r][1][t];return u(e||t)},n,n.exports,s,a,o,h)}return o[r].exports}for(var l="function"==typeof require&&require,t=0;t<h.length;t++)u(h[t]);return u}({1:[function(t,e,r){"use strict";var c=t("./utils"),d=t("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.enc
@divinehawk
divinehawk / DisableProxy.ps1
Last active August 23, 2024 20:35
Disable Windows Proxy
# Disables proxy
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name AutoConfigURL
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0
# From https://github.com/majkinetor/posh/blob/master/MM_Network/Update-Proxy.ps1:
# The registry changes aren't seen until system is notified about it.
# Without this function you need to open Internet Settings window for changes to take effect. See http://goo.gl/OIQ4W4
function refresh-system() {
$signature = @'
[DllImport("wininet.dll", SetLastError = true, CharSet=CharSet.Auto)]
@divinehawk
divinehawk / mikrotik-backup-to-oracle.txt
Last active July 29, 2024 20:53
Mikrotik config backup to Oracle bucket
# Script to export config (with secrets) to Oracle Cloud bucket
:local oracleurl "https://XXXXX.oci.customer-oci.com/p/XXX/XXXX/o/"
:local hostname ([/system identity get name])
:local date [/system clock get date]
:local time [/system clock get time]
:local filename ($hostname . "-" . $date . "-" . [:pick $time 0 2] . [:pick $time 3 5] .[:pick $time 6 8] . ".rsc")
:local url ($oracleurl . $hostname . "/" . $filename )
/export file=$filename show-sensitive
:delay 1000ms
:local data [/file get [/file find name=$filename] contents];
@divinehawk
divinehawk / mypay.js
Last active April 26, 2024 10:19
Download (almost) everything in MYPAY
/* mypay.js
Javascript Snippet to bulk download everything in MYPAY
to a ZIP file
*/
/* JSZip */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=t()}}(function(){return function s(a,o,h){function u(r,t){if(!o[r]){if(!a[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=o[r]={exports:{}};a[r][0].call(n.exports,function(t){var e=a[r][1][t];return u(e||t)},n,n.exports,s,a,o,h)}return o[r].exports}for(var l="function"==typeof require&&require,t=0;t<h.length;t++)u(h[t]);return u}({1:[function(t,e,r){"use strict";var c=t("./utils"),d=t("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,n,s,a,o,h=[],u=0,l=t.len
@divinehawk
divinehawk / updatemycert.ps1
Last active March 8, 2024 20:18
Synchronizes smartcard email certificate to AD
[System.DirectoryServices.DirectorySearcher] $searcher = New-Object System.DirectoryServices.DirectorySearcher
$user = $env:UserName
$now = Get-Date
function UpdateCert($username, $newcert) {
$searcher.Filter = "(&(objectCategory=User)(sAMAccountName=$username))"
$searchresults = $searcher.FindAll()
if($searchresults.Length -ne 1)
@divinehawk
divinehawk / updatemycert2.ps1
Last active March 8, 2024 20:18
Synchronizes smartcard email certificate to AD (beta)
[System.DirectoryServices.DirectorySearcher] $searcher = New-Object System.DirectoryServices.DirectorySearcher
$user = $env:UserName
$now = Get-Date
function UpdateCert($username, $newcert) {
$searcher.Filter = "(&(objectCategory=User)(sAMAccountName=$username))"
$searchresults = $searcher.FindAll()
if($searchresults.Length -ne 1)
@divinehawk
divinehawk / js-totp-9.2.2.html
Last active February 27, 2024 21:51
Javascript TOTP (with otpauth 9.2.2)
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head><title>JS TOTP</title>
<style>
.styled-table {
border-collapse: collapse;
margin: 25px 0;
font-size: 1.2em;
font-family: monospace;
min-width: 400px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
#!/usr/bin/python3
# Update or add an AAAA record for your local machine using namesilo API
# Required: Set DOMAIN to your domain and KEY to your Namesilo API key
# Note: This uses Linux iproute2 for getting the IPv6 address
# Usage: ./namesilo-update46.py
# -4 for IPv4, -6 for IPv6, or both <hostname - optional>
import requests
import xml.etree.ElementTree as ET
import socket
import os