Skip to content

Instantly share code, notes, and snippets.

View frabarz's full-sized avatar

Francisco frabarz

View GitHub Profile
@frabarz
frabarz / local-datetime.lua
Created April 24, 2022 06:48
Quick OBS script in lua to write the local date/time to a text source.
obs = obslua
module_description = "Sets a text source to act as a digital clock."
source_name = ""
date_format = "%c"
last_text = ""
last_timer = 30
@frabarz
frabarz / Firefox-DirIndexMusicPlayer.user.js
Created September 14, 2021 04:09
Userscript to add basic music player functionality to the directory index page generated for local file:// URLs. Is enabled only if it finds at least one .mp3 file in the list.
// ==UserScript==
// @name Firefox Directory Index Music Player
// @namespace Generic scripts
// @match file:///C:/Users/**/*
// @grant none
// @version 1.1
// @author frabarz
// ==/UserScript==
const entries = Array.from(document.querySelectorAll("a.file[href$='.mp3']"), node => {
@frabarz
frabarz / datawheel_white.svg
Created August 6, 2021 06:16
Quick SVG uploads
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@frabarz
frabarz / ssl.conf
Created July 6, 2020 21:57
An optimal SSL configuration for nginx servers.
# Sources:
# - https://cipherli.st/
# - https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
# - https://haydenjames.io/nginx-tuning-tips-tls-ssl-https-ttfb-latency/
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_session_cache shared:SSL:10m;
@frabarz
frabarz / Load-DotEnv.ps1
Created February 11, 2020 19:06
Loads the environment variables in a .env file (intended for bash) into the current terminal session.
function Load-DotEnv {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param(
[Parameter(Position = 0)]
[string]
$Path = ".\.env"
)
if (Test-Path $Path) {
$content = Get-Content $Path -ErrorAction Stop
@frabarz
frabarz / Load-SSHAgent.ps1
Last active September 16, 2019 15:23
Loads SSH Agent on Windows so you have to input a passphrase only once.
function Load-SSHAgent {
$registryPath = "HKCU:\Volatile Environment"
$registryItem = Get-ItemProperty -Path $registryPath
if ( !$registryItem.SSH_AGENT_PID ) {
Write-Host "Initiating a new SSH Agent instance"
[string]$output = ssh-agent
$lines = $output.Replace("/", "\").Replace("\tmp", $env:TEMP).Split(";")