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 / vwlc-on-kvm.md
Last active December 29, 2023 07:01
How to install the Cisco vWLC on KVM using virt-install

Installing the Cisco vWLC on KVM using virt-install

Cisco has a few different guides for installing their vWLC on KVM, but most of them focus on oVirt-style installations that are heavy on hand-crafted XML and [what appears to be] the use of OpenStack. If you're just using a plain single-host KVM setup and want to install the vWLC in a VM, this guide is for you.

Instructions

First, download the vWLC KVM installation image appropriate for your setup. I'm going to use version 8.5.171.0 (you'll have to create an account to download it), and then transfer it to your KVM server:

AndrewBobulskys-MacBook-Pro:~ andrewbobulsky$ scp ~/Downloads/MFG_CTVM_LARGE_8.5.171.0.iso 10.0.25.2:/tmp                   100%  367MB  40.7MB/s   00:09    
@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 / 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 / readme.md
Last active June 29, 2023 04:30
Chef fails with 'No candidate version available' when using amazon-linux-extras on Amazon Linux 2

The Problem

We have a few packages we like to install through Amazon Linux Extras repo, but we discovered that this doesn't work right:

execute 'Enable java 11 via amazon-linux-extras' do
  command 'amazon-linux-extras enable java-openjdk11'
end

package 'java-11-openjdk'
@RulerOf
RulerOf / ec2-exec.sh
Created November 16, 2021 10:05
Synchronously run commands on an SSM-managed EC2 instance
#!/bin/bash
which jq > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
>&2 echo Error: this script requires jq; exit 1
fi
which aws > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
>&2 echo Error: this script requires awscli; exit 1
@RulerOf
RulerOf / README.md
Last active May 3, 2023 18:18
Using a different shell without running `chsh`

Problem

I wanted to create a jumpbox where the default shell was zsh, but I couldn't actually change the default shell of the users that would be connecting to the box. I also wanted to manage some symlinks in the user profile dynamically with Dotbot.

My initial idea was to add a script to /etc/profile.d that would just dump users into /bin/zsh, but this had several different problems, including the all-important question of "But what if I want to run Bash on purpose?"

Solution

Through a little bit of trial and error, I settled on this script located at /etc/profile.d/dotbot.sh

@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 / centos-extras-on-OEL7.md
Last active October 29, 2022 17:17
Adding Centos Extras repo to Oracle Enterprise Linux 7

Adding CentOS Extras to Oracle Enterprise Linux

If you want to install a package like Docker Community Edition on OEL, you'll have to add the CentOS Extras repo, which as of release 7 is built-in to CentOS and not added on later like EPEL is. As a result, instructions for adding it to EL7 are hard to find. This should work for any build of Enterprise Linux that does not already include the CentOS Extras repo. I have absolutely no idea if it's apporpriate to use this repo on a build of Linux other than CentOS, but it should be.

This was tested on Oracle Enterprise Linux 7, but should be copy-pastable on any version or EL build assuming things don't change too much.

Download the CentOS GPG Key

# Get OS Release number
@RulerOf
RulerOf / fusion-io-on-oracle-linux-7.md
Last active April 11, 2022 17:37
Installing drivers for ioDrive Duo on Oracle Linux 7

Installing drivers for ioDrive Duo on Oracle Linux 7

This process is an outline of the steps I followed to get my two first-gen 640GB ioDrive Duo cards working on Oracle Linux 7. After we install the driver, we're going to perform the optional step of formatting the cards to use native 4k sectors, since it offers marginally better throughput and a decent reduction to memory usage.

Download Driver binary and support tools tarball

Go to the SanDisk support site and download the packages that correspond to your device and kernel. I'm using 64-bit Oracle Linux 7.

On the support site, we pick out our device,