Skip to content

Instantly share code, notes, and snippets.

@imjosh
imjosh / explanation.md
Created June 10, 2024 14:48
ffmpeg text scrolling
  • Input:

    • -f lavfi -i color=c=black:s=1280x720:d=%duration%: Generates a video of a black color with a resolution of 1280x720 and a duration specified by the duration variable (140 seconds in this case).
  • Video Filter (-vf):

    • "drawtext=fontfile=C\\:/path/to/font.ttf:: Specifies the font file to be used for the text.
    • textfile=C\\:/path/to/input.txt:: Specifies the file containing the text to be overlaid on the video.
    • fontcolor=white:: Sets the font color to white.
    • fontsize=%fontsize%:: Sets the font size using the fontsize variable (38 in this case).
  • x=(w-text_w)/2+%xoffset%:: Sets the horizontal position of the text. It centers the text horizontally by calculating (w-text_w)/2 and adjusts it with the xoffset variable. If xoffset is 0, the text will be exactly centered.

@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: