Skip to content

Instantly share code, notes, and snippets.

@rma92
rma92 / readme.md
Last active March 27, 2024 05:07
Videos for Legacy Computers

Download from youtube

yt-dlp <url> --check-all-formats

Make raw avi to convert for Video for Windows:

ffmpeg -i "Skibidi Toilet Full Song Music Video [6dMjCa0nqK0].webm" -vf "scale=320:240" -c:v rawvideo -c:a pcm_s16le skibidi_320_raw.avi

Make raw quicktime to convert with Quicktime Pro:

@rma92
rma92 / out.txt
Created November 26, 2023 19:05
WinSAT - Vultr Bare Metal $120/mo
C:\windows\system32>winsat prepop
Windows System Assessment Tool
> Running: Feature Enumeration ''
> Run Time 00:00:00.00
> Running: WinSAT Direct3D Assessment '-aname DWM -time 10 -fbc 10 -disp off -normalw 1 -alphaw 2 -width 1280 -height 1024 -winwidth C(1144) -winheight C(915) -rendertotex 6 -rtdelta 3 -nolock'
> Assessing Desktop Graphics Performance
> Run Time 00:00:10.47
> Running: WinSAT Direct3D Assessment '-aname Batch -time 5 -fbc 10 -disp off -animate 10 -width 1280 -height 1024 -totalobj 300 -batchcnt C(10) -objs C(26) -rendertotex 6 -rtdelta 3 -texpobj C(1)'
> Assessing DirectX Batch Performance
@rma92
rma92 / readme.md
Created November 13, 2023 04:49
Multi-Retroboot ThinkPad 600X

ThinkPad 600X Retro Multiboot

We will boot the following operating systems on the same machine:

  • Windows XP
  • Windows Server 2003
  • Windows 2000
  • Windows NT 4.0
  • Windows 98
  • MS-DOS 6.22 / Windows 3.1

Required tools

@rma92
rma92 / harden.md
Last active May 9, 2024 20:11
Unifi controller on OpenBSD using Ports

Attempt at a hardened one on OpenBSD on Vultr

  • Upload install.iso for OpenBSD to Vultr, create a new VM using the ISO. You need the ISO to create full disk encryption. Also this eliminates any potential security issues cloud-init can cause.
  • Set a full disk encryption key, set a root password that is strong, set a user that doesn't match anyone's name with a good password.
  • Start sshd by default, don't allow root logins.
  • Install the entire system to a single / partition (for disk usage reasons)

Each time the VM boots, someone will need to manually enter the encryption key at the prompt.

Initial setup: enable doas, change SSH port, pubkey auth only

Enable doas

@rma92
rma92 / bloomberg_terminal_memory_usage.ps1
Created September 17, 2023 19:05
Get total RAM memory usage of Bloomberg Terminal
# Define the process names
$processNames = @("wintrv", "bplus.wtk2", "bplus64")
# Initialize a variable to store the total memory usage
$totalMemoryUsageBytes = 0
# Loop through each process name
foreach ($name in $processNames) {
# Get the processes with the current name
$processes = Get-Process | Where-Object { $_.ProcessName -eq $name }
@rma92
rma92 / readme.md
Last active September 15, 2023 04:26
SSH proxy to make a local resource available on the Internet

Use an SSH proxy to make a server on your local machine available on the Internet

You can use any random cloud host with an SSH server to make a server on your local computer available on the internet. The process described here is not reliable enough to be used for productive use, but can be useful for testing.

There's a setting in sshd that allows reverse SSH tunnels to optionally accept connections from other hosts: GatewayHosts. By default, this is disabled. Set it to enabled, and reload the SSH configuration.

  • On OpenBSD, edit /etc/ssh/sshd_config, add the line GatewayPorts yes (or uncomment and edit the existing no line).
  • Reload the sshd config by running sh -c 'kill -HUP $(cat /var/run/sshd.pid)' as root. (This only reloads the configuration, and can be done through SSH)
  • The port you want exposed needs to be allowed through the firewall.
    • doas vi /etc/pf.conf
  • add the relevant line, something like: pass out proto tcp to port 8080 (note this will be different on FreeBSD)
@rma92
rma92 / cleanup.sql
Last active August 20, 2023 04:58
Florida Parcel data preprocessing in Spatialite
--run `spatialite newdb.db`, fix the attach line to be the parcel data as converted by GDAL. If you select by zip code, use the commented line to convert the zip code to an integer to speed up searching.
PRAGMA synchronous=OFF;
PRAGMA count_changes=OFF;
PRAGMA journal_mode=OFF;
PRAGMA temp_store=OFF;
attach database 'parcels2022.db' as p;
--update p.parcels_2020 set phyzip = cast(phyzip as integer);
-- Create the new table 'parcels_x'
CREATE TABLE 'parcels_x' (
@rma92
rma92 / gist:c2518917833c75f1b509a3697081e724
Created August 20, 2023 03:12
Google Maps Layers in QGIS
The Google Maps layers can be added using the XYZ tiles functionality.
Create a new XYZ Tiles connection, and use the following URLs:
Roadmap
http://mt0.google.com/vt/lyrs=m&hl=en&x={x}&y={y}&z={z}
Terrain
http://mt0.google.com/vt/lyrs=p&hl=en&x={x}&y={y}&z={z}
Altered roadmap
@rma92
rma92 / gist:3dc8de340ad9404e9ca0be8b6e33c86b
Created July 2, 2023 18:01
Setting up WinFrame Cleint for DOS/286 on PCem with Microsoft LANMAN DOS TCP/IP
For testing, I used a 486 AMI WinBIOS 486 machine.
* Install DOS (I used a disk image that already contained DOS 6.22)
* Install (edit config.sys, add DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF, or wherever HIMEM.SYS is located).
* Use WinImage to copy the [Microsoft Lan Manager 2.2c|https://archive.org/details/microsoft-lan-manager-microsoft-network-client] disks into a folder on the DOS hard drive. I used C:\setup\lanman.
* Use a Microsoft mouse driver (I used Microsoft Mouse 6.26). CuteMouse worked in the text mode settings screen, but it was not possible to actually connect to the server if CtMouse was loaded.
* CD to DISK1
* Run Setup
* Installation is simple, use the default directory. Enhanced or Basic doesn't seem to matter unless your computer is really slow or memory limited. Use the Novell NE2000 driver.
* Either use DHCP, or set the IP address to 10.0.2.15, the gateway to 10.0.2.2, and the netmask to 255.255.255.0.
@rma92
rma92 / run.md
Last active May 1, 2023 01:07
pfSense 2.6: make realtek ethernet work

Download

fetch -v https://pkg.opnsense.org/FreeBSD:12:amd64/snapshots/latest/All/realtek-re-kmod-196.04.txz
pkg install -f -y realtek-re-kmod-196.04.txz

Add the following to /boot/loader.conf.local (create file if needed)

if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"