Skip to content

Instantly share code, notes, and snippets.

View lg's full-sized avatar

Larry Gadea lg

View GitHub Profile
@lg
lg / discord-dl.sh
Last active April 22, 2024 04:14
Download channels from Discord and save as a webarchive for offline reading
#!/bin/bash
#
# Make sure to have a .env with `DISCORD_TOKEN=your_token_here` in the same directory as this script.
# Get your token as per: https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md
dce() {
docker run -it --rm --env-file .env --volume "$(pwd)/out":/out tyrrrz/discordchatexporter:latest "$@"
}
ffmpeg() {
@lg
lg / adding-tailscale-to-edgerouter.md
Last active April 11, 2024 07:44
Add tailscale to an EdgeRouter and surviving system upgrade

Adding tailscale to an EdgeRouter (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipself)
sudo bash    # if you havent already
@lg
lg / unattend.xsd
Created August 11, 2023 04:51
unattend.xsd / autounattend.xsd taken from Windows ADK as per https://schneegans.de/windows/unattend-schema/
<?xml version="1.0" encoding="ASCII"?>
<xsd:schema targetNamespace="urn:schemas-microsoft-com:unattend" xmlns="urn:schemas-microsoft-com:unattend"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<!--Root Elements-->
<xsd:element name="unattend">
<xsd:annotation>
<xsd:documentation>Unattend</xsd:documentation>
</xsd:annotation>
@lg
lg / shoppers-drug-mart-covid-tests.sh
Created December 25, 2021 22:03
Checks all Shoppers Drug Marts for if they have COVID antigen tests available on a specific day
# make sure to change:
# '2021-12-25' to the date you're looking for, and
# '45.000000; -75.11111' to your latitude and longitude
# '100' to the amount of km thats max for your roadtrip out to get tested
# curl command taken from https://shoppersdrugmart.medmeapp.com/schedule/groups/Covid-19-Rapid-Screening (and removed the x-pharmacyid header)
curl 'https://gql.medscheck.medmeapp.com/graphql' \
-X 'POST' \
-H 'Content-Type: application/json' \
-H 'Accept: */*' \
@lg
lg / angry_wifi.sh
Last active November 28, 2023 23:56
auto disconnects clients with a low signal strength on LEDE / OpenWRT
#!/bin/ash
#
# angry_wifi.sh
#
# auto disconnects clients with a low signal strength on LEDE / OpenWRT. great
# for clients who hold onto a lower-signal-strength accesspoint instead of
# roaming. before running, make sure to download the latest MAC addresses with:
#
# wget --no-check-certificate -O - 'https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=apple' | cut -d, -f2 > apple_mac_addresses
#
@lg
lg / paperspace-gaming.ps1
Last active October 31, 2023 17:24
A script to provision a new Paperspace machine for gaming
# init stuff
Install-PackageProvider -Name NuGet -Force
mkdir c:\cloudygamer\downloads
Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DontUsePowerShellOnWinX" -Value 0
################
# install steam first since windows updates will take forever (and you can install games)
(New-Object System.Net.WebClient).DownloadFile("https://steamcdn-a.akamaihd.net/client/installer/SteamSetup.exe", "c:\cloudygamer\downloads\steamsetup.exe")
@lg
lg / uap-ac-lite-openwrt.txt
Last active October 22, 2023 12:16
making the ubnt wifi awesome (uap ac lite) w/ openwrt
making the ubnt wifi awesome (uap ac lite) w/ lede (openwrt)
the reasons you would do this:
- you get 802.11r
- you get better roaming
- you get access to some new 5ghz channels
I AM NOT TO BE HELD RESPONSIBLE FOR ANYTHING IN HERE. DO AT YOUR OWN RISK. THANK YOU AND HAVE A LOVELY DAY.
** note that though we're using Lede, it's essentially openwrt minus the drama
@lg
lg / amc.sh
Created July 23, 2023 09:01
amc tickets
function runcheck() {
while true; do curl -s "$1" | pup 'script#apollo-data json{}' | jq '.[] | .text | fromjson | .[] | select(.__typename=="Seat" and .available==true and .type != "Wheelchair" and .type != "Companion") | .column' | awk '{if (p == $1 - 1) {print "Found: " $1 " and " p}; p = $1}' | grep Found && say "go buy tickets $2"; sleep 5; done
}
runcheck "https://www.amctheatres.com/movies/oppenheimer-66956/showtimes/oppenheimer-66956/2023-07-23/amc-metreon-16/all/111398221" "tomorrow 2:30pm"
@lg
lg / extensions.json
Created June 30, 2023 03:30
vscode launch.json to start a server in docker and debug it (originally from awardwiz)
{
"recommendations": [
"spadin.memento-inputs"
]
}
@lg
lg / Dockerfile
Last active February 12, 2023 23:36
Dockerfile to download and build firefox for multiple architectures (run on x86_64 host/platform)
FROM ubuntu:jammy as builder
ARG FIREFOX_REF=FIREFOX_109_0_1_RELEASE
# download firefox and its build dependencies
WORKDIR /usr/local/src/firefox
ARG DEBIAN_FRONTEND="noninteractive"
RUN apt update && apt install --no-install-recommends -y mercurial python3-pip build-essential \
binutils-aarch64-linux-gnu curl rsync
RUN hg --config format.generaldelta=true init mozilla-unified \
&& echo "\n[paths]\ndefault = https://hg.mozilla.org/mozilla-unified\n\n[format]\nmaxchainlen = 10000\n" >> mozilla-unified/.hg/hgrc \