Skip to content

Instantly share code, notes, and snippets.

@imjosh
imjosh / gist:9abb019d919d437a4fbce27c68571d93
Created April 10, 2024 16:53
Enumerate Windows Data Providers/Drivers with PowerShell
# run in 32/64-bit powershell for 32/64bit providers/drivers
foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator())
{
if ($provider.GetValue(0) -like "*")
{
$v = New-Object PSObject
Add-Member -in $v NoteProperty "Provider Name" $provider.GetValue(0)
Add-Member -in $v NoteProperty "Description" $provider.GetValue(2)
$v
}
@imjosh
imjosh / shutdown.py
Created January 31, 2019 22:59
Raspberry Pi Safe Shutdown + Restart Switches
# Safe Shutdown/Restart Switches
# untested
shutdownPin = 5
restartPin = 15
GPIO.setup(shutdownPin, GPIO.IN)
GPIO.setup(restartPin, GPIO.IN)
shutdownStatePrev = True
@imjosh
imjosh / encodings.js
Created January 28, 2019 07:41
Messing around with hex and base36 character encodings
/* Messing around with character encodings */
/* notes:
http://www.i18nguy.com/unicode/supplementary-test.html
https://stackoverflow.com/questions/6063148/java-unicode-where-to-find-example-n-byte-unicode-characters
https://stackoverflow.com/a/37954501/2034089
https://unicode-table.com/
*/
// Adapted from https://stackoverflow.com/a/21648161/2034089
@imjosh
imjosh / getYouTubeMp4Link.js
Created January 3, 2019 17:27
Get a direct MP4 link for a YouTube video
version: "3.6"
services:
portainer:
image: portainer/portainer
command: --ssl --sslcert /path/to/certificate.crt --sslkey /path/to/certificate.key --admin-password-file '/path/to/password.txt'
ports:
- "9000:9000"
networks:
- portainer-net
volumes: