Skip to content

Instantly share code, notes, and snippets.

View quonic's full-sized avatar

Spyingwind quonic

  • Dallas
View GitHub Profile
#!/bin/bash
# License: MIT
# Author: Quonic/Spyingwind
# Description: This script installs or updates Discord on Linux.
# Version: 1.0
# Usage: ./update_discord.sh
# Dependencies: wget, tar
# Script to install or update Discord on Linux
@quonic
quonic / 00-rodecaster-duo-rename.conf
Last active February 20, 2025 21:48
RODECaster Duo ALSA Audio Position mappings
{
"monitor.alsa.rules": [
{
"actions": {
"update-props": {
"alsa.card_name": "RODECaster Duo Chat",
"alsa.long_card_name": "RODECaster Duo Chat",
"device.description": "RODECaster Duo Chat",
"device.name": "RODECaster Duo Chat",
"node.description": "RODECaster Duo Chat",
@quonic
quonic / update-factorio.sh
Last active October 27, 2024 23:04
Updates Factorio Linux server along with any mods added via git.
#!/usr/bin/env bash
# This script will update a Factorio server mods that where installed via git
# and update the Factorio server via LinuxGSM if updates are available
# Requirements:
# * jq, git, and curl packages
# * Factorio server installed via LinuxGSM or web-lgsm
# * Change the factorio_dir variable to your Factorio server directory
# * Run as the same user that runs the Factorio server
@quonic
quonic / press-all-notes.odin
Last active October 15, 2024 01:49
Talk to a Launchpad Mini via portmidi in Odin and press all the notes and draw a check box!
package main
import "core:fmt"
import "core:time"
import "vendor:portmidi"
// Launchpad Mini
// https://fael-downloads-prod.focusrite.com/customer/prod/s3fs-public/downloads/Launchpad%20Mini%20-%20Programmers%20Reference%20Manual.pdf
note_matrix: [8][8]i32 = {
@quonic
quonic / example_thread_pool.odin
Created October 13, 2024 12:08
A simple custom Odin hello world thread pool example
package main
import "core:fmt"
import "core:thread"
// Array of threads
threads: [dynamic]^thread.Thread
// Pool of data that each thread can access
Pool :: struct {
@quonic
quonic / Reset-ValuesInLoop.ps1
Created August 16, 2024 23:47
How to abuse a for loop to reset a value on each iteration
for ($($i = 0; $j = 0); $i -lt 3; $($i++; $j = 0)) {
# What is $j?
Write-Host "$j"
$j++
Write-Host "$j"
}
@quonic
quonic / Get-AllInstalledApps.ps1
Created July 23, 2024 00:37
Get Microsoft Store Apps with ID when Get-AppxPackageManifest does not return results when running under the System context
$InstalledAppxPackages = Get-AppxPackage -AllUsers
$AumidList = foreach ($app in $InstalledAppxPackages) {
# Get the AppId from the manifest file
try {
$ManifistPath = Join-Path -Path $app.InstallLocation -ChildPath "AppxManifest.xml"
$ManifestPathLeaf = Split-Path -Path $app.InstallLocation -Leaf
if ($(Test-Path -Path $ManifistPath -ErrorAction SilentlyContinue)) {
[xml]$Manifest = Get-Content -Path $ManifistPath -ErrorAction Stop
$Name = $Manifest.Package.Identity.Name
$Publisher = @(
@quonic
quonic / xiao_esp32c6_example.yaml
Last active December 11, 2024 14:37
Getting a Seeed XIAO ESP32C6 to work in Home Assistant under ESPHome
# Found working config here: https://github.com/esphome/issues/issues/5864
# From my testing it does compiles, uploads, and runs with out issues.
esphome:
name: my-esp32c6
friendly_name: My ESP32C6
platformio_options:
platform: https://github.com/platformio/platform-espressif32/archive/refs/tags/v6.7.0.zip
board_build.f_cpu: 160000000L
board_build.f_flash: 80000000L
board_build.flash_size: 4MB
@quonic
quonic / temp-monitor.yaml
Created June 13, 2024 04:07
ESPHOME: esp32 + DHT (AM2302) temp monitor for an odd esp32 found on Amazon
esphome:
name: temp-monitor
friendly_name: Temp Monitor
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
@quonic
quonic / Get-TMI.ps1
Last active May 24, 2024 03:12
Randy Marsh's TMI formula in PowerShell
function Get-TMI {
<#
.SYNOPSIS
Calculates the TMI of a given object.
.DESCRIPTION
Calculates the TMI of a given object.
.PARAMETER Length
The length of the object
.PARAMETER Diameter
The diameter of the object