Skip to content

Instantly share code, notes, and snippets.

View franklinmoy3's full-sized avatar
🗿

Franklin Moy franklinmoy3

🗿
View GitHub Profile
@franklinmoy3
franklinmoy3 / update-cursor-editor.sh
Last active November 1, 2024 22:57
Update Cursor Editor
# This script assumes that you want it downloaded to /opt
curl -o /opt/cursor-editor/cursor.appimage https://downloader.cursor.sh/linux/appImage/x64
@franklinmoy3
franklinmoy3 / steam_deck_vscode_no_flatpak.md
Last active June 30, 2024 09:02
VSCode on SteamOS without Flatpak

Installing VSCode on SteamOS without Flatpak

Notes

  • SteamOS locks down basically all directories outside of the /home directory
    • Hence, installs via pacman or the AUR are disabled by default, and will be deleted after each SteamOS upgrade
  • The installation steps below will install VSCode without Flatpak
  • Some things might not work well, such as browser hooks when logging into external services and extensions

Installation Steps

@franklinmoy3
franklinmoy3 / split_contacts.py
Created July 15, 2023 22:29
Split Google Contacts VCF file containing multiple contact cards
import os
END_VCARD = "END:VCARD\n"
in_file = "./contacts.vcf"
out_file_format = "./contacts_out/contact_{}.vcf"
with open(in_file, "r") as input_file:
contents_as_string = input_file.read()
arr = [e+END_VCARD for e in contents_as_string.split(END_VCARD) if e]
@franklinmoy3
franklinmoy3 / Get-InstalledProgramList.ps1
Last active December 9, 2023 20:04
List Installed Windows Programs
function AnalyzeReg($p, $f) {
Get-ItemProperty $p | ForEach-Object {
if (($_.DisplayName) -or ($_.version)) {
[PSCustomObject]@{
Name = $_.DisplayName;
Bitness = $f;
Version = $_.DisplayVersion;
InstallDate = $_.InstallDate
}
}
@franklinmoy3
franklinmoy3 / openwrt_wireguard_setup.md
Last active March 15, 2024 17:23
OpenWRT Wireguard setup

Step-by-step guide to set up full tunnel Wireguard server on OpenWRT

  • opkg install wireguard luci-app-wireguard
  • Reboot router
  • Generate server keys (one-liner)
    • wg genkey | tee mywgserver.privatekey | wg pubkey > mywgserver.publickey
  • Generate a new client key (one-liner)
    • wg genkey | tee [NAME].privatekey | wg pubkey > [NAME].publickey
  • Add new interface wg0 in LuCI (Network->Interfaces->Add new interface)
    • Proto: Wireguard VPN
  • Private Key: Fill with content of mywgserver.privatekey
@franklinmoy3
franklinmoy3 / opkg_restore.sh
Last active January 2, 2025 06:42
OpenWRT restore installed packages
#!/bin/sh
# Assumes backup was made using sysupgrade -k -b <name>
# Paste package list into /etc/backup/installed_packages.txt
# Reinstalls packages (ignoring source descriptors "overlay" and "rom" using awk)
opkg update
cat /etc/backup/installed_packages.txt | awk 'gsub(/overlay|rom/, ""){print}' | xargs opkg install
# Clean up duplicate conffiles generated by OPKG
rm /etc/*/*-opkg
echo "Done. Any duplicate conffiles created by OPKG have been deleted"
@franklinmoy3
franklinmoy3 / opkg_updater.sh
Last active April 14, 2025 00:41
OpenWRT OPKG update all installed packages
#!/bin/sh
# Example of job definition (as add job using crontab -e):
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
# 30 02 15,28 * * /root/opkg_updater.sh
@franklinmoy3
franklinmoy3 / openwrt_backup.sh
Last active January 8, 2022 05:38
OpenWRT backup including installed OPKG packages
#!/bin/sh
date=$(date '+%Y-%m-%d-%H-%M')
backup_name="backup-FLMWRL-$date.tar.gz"
sysupgrade -k -b $backup_name
echo "Done. Backup stored at $(pwd)/$backup_name"