Skip to content

Instantly share code, notes, and snippets.

View quonic's full-sized avatar

Spyingwind quonic

  • Dallas
View GitHub Profile
@quonic
quonic / CheckMiniAudioResult.odin
Last active April 6, 2024 02:06
Helper function to check if the result from miniaudio functions where successful or not. Logs to raylib's TraceLog.
package main
// License: Do what ever you want with this.
// Example use case
// audioengineConfig = miniaudio.engine_config_init()
// result: miniaudio.result = miniaudio.engine_init(&audioengineConfig, &audioEngine)
// assert(checkAudioResult(result), "Failed to initialize audio engine")
import "vendor:miniaudio"
@quonic
quonic / checkAudioResult.odin
Created April 2, 2024 15:20
A helper function to trace errors when calling miniaudio functions in odin
package main
import "vendor:miniaudio"
import "vendor:raylib"
// Example use case:
// result: miniaudio.result = miniaudio.engine_init(&audioengineConfig, &audioEngine)
// assert(checkAudioResult(result), "Failed to initialize audio engine")
checkAudioResult :: proc(result: miniaudio.result) -> bool {
@quonic
quonic / upgrade.js
Last active March 22, 2024 02:06
Birburner Hacknet Node upgrade script. I found and converted this script from .script to .js.
const MoneyFormat = '$0.0a';
const TimeFormat = '00:00:00';
/** @param {import(".").NS } ns */
export async function main(ns) {
/*
ns.hacknet-auto.script for Bitburner v0.47.2
Winners don't use copyright
@quonic
quonic / Get-PackageUpdates.sh
Last active March 11, 2024 23:37
Get a list linux of packages ( apt, dnf, yum ) and containers ( flatpak, snap ) that have packages available to be updated and save them to custom fields. Mainly used with NinjaRMM.
#!/usr/bin/env bash
# Licence: MIT or use how you like
# Description:
# This script is used to get a list of system packages that can be updated and save them to a Custom Field.
# It also gets a list of snaps and flatpaks that can be updated and saves them to a Custom Field.
# Create the following Script Variables:
#
# packagesCustomField as a text field
@quonic
quonic / DivoomPixoo64.ps1
Last active February 21, 2024 16:38
Function to control Divoom's Pixoo 64 over the network. This presumes that you have PowerShell 7 installed. Examples at the bottom of the file. Sometime the Pixoo will reboot when sending a command. No way to fix this at the moment.
#Requires -Version 7
# Current API documentation
# http://doc.divoom-gz.com/web/#/12?page_id=143
function Invoke-PlayGif {
[CmdletBinding()]
param(
[Parameter()]
[string]
@quonic
quonic / Get-ProgramBit.ps1
Last active January 18, 2024 22:27
Get the bittness of an exe or dll.
function Get-ProgramBit {
[CmdletBinding()]
param ([string]$Path)
process {
if (-not $(Test-Path -Path $Path -ErrorAction SilentlyContinue)) {
Write-Error "Invalid Path"
return
}
$re32 = [regex]::new('PE\W\WL')
Get-Content -Path $Path -ReadCount 1 | ForEach-Object {
@quonic
quonic / Remove-XHunter1.ps1
Created March 11, 2023 01:26
Script to automate the removal of xhunter1.sys when found. Create a scheduled task that runs at start up as admin.
#Requires -Version 5.1 -RunAsAdministrator
function Remove-XHunter1 {
param ()
Stop-Service xhunter1 -Force -NoWait -Confirm:$false
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Services\xhunter1" -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Windows\xhunter1.sys" -Force -ErrorAction SilentlyContinue
}
function Test-XHunter1 {
@quonic
quonic / Preseed Debian 12
Created November 22, 2023 20:03
Preseed Provisioning Template in Forman for Debian 12. This fixes one deployment issue where the installer gets stuck trying to install python.
<%#
kind: provision
name: Preseed default
model: ProvisioningTemplate
oses:
- Debian
- Ubuntu
test_on:
- debian4dhcp
- ubuntu4dhcp
@quonic
quonic / install-pwsh.sh
Last active October 8, 2023 01:43
Install PowerShell 7 on Ubuntu (23.04/22.04/20.04/18.04), Debian (12/11/10/9) Fedora/RHEL(8/7), Alpine, or macOS(Intel/M1)
#!/usr/bin/env bash
# Check if user is root
if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root"
exit
fi
Use_Package_Manager=0
Help_Message=0
@quonic
quonic / Install-RustDesk.ps1
Created December 5, 2022 22:12
Simple install script for RustDesk to point to your own server. Can be used in a GPO startup script.
$ErrorActionPreference = 'SilentlyContinue'
#Region Settings
# IP address of our server
$IpAddress = "127.0.0.1"
# The public key for our server
$PublicKeyString = "12345678"
# The temporary folder where we will store and run the installer
$TempFolder = "C:\Temp\"
#EndRegion Settings