Skip to content

Instantly share code, notes, and snippets.

@RulerOf
RulerOf / pfsense-on-centos-8.md
Last active January 9, 2024 22:18
Installing pfSense on KVM in CentOS 8

Installing pfSense on KVM in CentOS 8

We download the latest release of pfSense as a gzipped ISO, then extract it and pass it to virt-install to get the VM up and running. Interactive portions of setup are done with virt-install's native console redirection. This guide assumes you've already installed and configured KVM, and that you've created network bridges already.

Instructions

Find the latest release here.

Download the gzipped memstick-serial image from a mirror into a directory that KVM can access, then unzip it:

@RulerOf
RulerOf / README.md
Created June 30, 2020 01:48
Bookmarklet to make a youtube video fill the window

Use the minified code inside of a bookmarklet. You can test it directly in your browser console on any YouTube video page. It ought to work anywhere but was only tested in Chrome 83.

When you're on a YouTube page, click the bookmarklet and it'll take you to the embedded version of the player that fills the entire window without requiring you to go to full screen mode. This is particularly useful if you have a 16:10 monitor.

The non-minified code is included as a reference to show how it works. There are other window-filling bookmarklets out there. I made this one because I wanted to write it.

@RulerOf
RulerOf / README.md
Last active November 30, 2022 21:20
Dynamic DNS Script I used for Google Domains with DD-WRT

DD-WRT Dynamic DNS for Google Domains

Create a Synthetic Record for Dynamic DNS. Copy the script and substitute your synthetic record's username, password, and FQDN in the config section.

Go to Administration > Commands tab and paste the code into the Command box, then click Save Custom Script.

Go to Administration > Management tab. Scroll down to the Cron section, and toggle Cron: Enable

In the Additional Cron Scripts section, put:

@RulerOf
RulerOf / example.tf
Created August 12, 2019 23:01
Turning two lists of maps into a single map output
variable "map1" {
default = [
{
name = "map1name1",
default_ip_address = "map1addr1"
},
{
name = "map1name2",
default_ip_address = "map1addr2"
}
@RulerOf
RulerOf / arn_parse.rb
Last active January 31, 2020 20:58
Parse an AWS ARN with Ruby
class Arn
attr_accessor :partition
attr_accessor :service
attr_accessor :region
attr_accessor :account
attr_accessor :resource
def initialize(partition, service, region, account, resource)
@partition = partition
@service = service
@RulerOf
RulerOf / plex-streaming-quality-settings.md
Last active October 16, 2023 03:53
Adjusting Plex Media Player streaming quality defaults and per-stream

Setting a default quality in Plex Media Player desktop

The Plex Media Player desktop application's default quality setting is in different places depending on the interface you're using. The Plex Web UI is used as a point-and-click interface, whereas the Plex Media Player TV UI is used as a remote-friendly interface.

Plex Web UI Plex Media Player TV UI
@RulerOf
RulerOf / get-sshfingerprint.ps1
Created January 31, 2019 20:49
Get SSH host key fingerprint using PowerShell. Requires the WinSCP .Net assembly.
function Get-SshFingerprint {
param( [string]$ssh_server )
# Load WinSCP .NET assembly
Add-Type -Path "${env:ProgramFiles(x86)}\WinSCP\WinSCPnet.dll"
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = $ssh_server
@RulerOf
RulerOf / content-engine-update.sh
Last active May 17, 2018 09:52
Short description of service backup setup
#!/bin/bash
# content-engine-update.sh pulls new container images and starts those images
# if there are any updates to be found. The "proper" way to do this is with
# the v2tec/watchtower docker image, but I prefer this method because of the
# logging output I get with this single-host setup
# Get the script name
scriptName="$(basename $0)"
@RulerOf
RulerOf / vbox-install.sh
Created February 21, 2018 15:43
Install or auto-update VirtualBox for Mac OS
#!/usr/bin/env bash
# shellcheck disable=SC2046
# We're catching errors manually here
set +e
# Start off the output formatting for this whole thing
echo "----"
if command -v VBoxManage >/dev/null 2>&1 ; then
@RulerOf
RulerOf / bash-delete-iam.sh
Last active January 14, 2018 10:27
Bash to delete an IAM user (missing Certificate removal and MFA removal)
# Set a user to delete
targetUser = ThisGuy
# Set the name of our awscli profile
aws_profile = prod
# Get all the keys that the user has on its account
userKeys=$(aws iam list-access-keys --user-name $targetUser --profile $aws_profile | jq -r '.AccessKeyMetadata[].AccessKeyId')
# Delete the keys