Skip to content

Instantly share code, notes, and snippets.

View HikariKnight's full-sized avatar
💭
I may be slow to respond.

HikariKnight HikariKnight

💭
I may be slow to respond.
  • /home
View GitHub Profile
@HikariKnight
HikariKnight / proxmox-nginx-subdir-proxy.md
Last active April 26, 2024 03:38
proxmox nginx proxy subdirectory

So I have spent my last 4 days to try get proxmox working with an nginx proxy. Due to how proxmox is built up I had to get clever with some rewrite, break some nginx rules and spend sleepless nights awake to try figure this out (to be honest I am no genius on web servers as I rarely have to touch them). Plus it seems like nobody (from my googling) had managed to set proxmox up to work behind a proxied subdir, understandably so as some of the html generated uses absolute paths for sources instead of relative paths and you need to deal with that.

This is the proxmox.conf file i ended up making (Replace all instances of pve.local:8006 with your internal proxmox ip and port) And replace publicwebsite.com with your website domain

NOTE: THIS IS FOR PVE6 and I have no plans to fix for PVE7 as I do not need it behind a reverse proxy anymore.

@HikariKnight
HikariKnight / virtual-channels.conf
Created April 30, 2023 15:53
Place this file inside ~/.config/pipewire/pipewire.conf.d/ to create virtual channels for different applications for streaming or for audio isolation
context.modules = [
{ name = libpipewire-module-loopback
args = {
node.description = "Game"
capture.props = {
node.name = "game_output"
media.class = "Audio/Sink"
audio.position = [ FL FR ]
}
playback.props = {
@HikariKnight
HikariKnight / KH3.gamecontroller.amgp
Last active June 7, 2022 07:27
AntimicroX profile for Kingdom Hearts 3 on PC (for use to add "controller support" in linux)
<?xml version="1.0" encoding="UTF-8"?>
<gamecontroller configversion="19" appversion="3.2.3">
<!--The SDL name for a joystick is included for informational purposes only.-->
<sdlname>Xbox One S Controller</sdlname>
<!--The Unique ID for a joystick is included for informational purposes only.-->
<uniqueID>030000005e040000fd020000000068001118765</uniqueID>
<stickAxisAssociation index="2" xAxis="3" yAxis="4"/>
<stickAxisAssociation index="1" xAxis="1" yAxis="2"/>
<vdpadButtonAssociations index="1">
<vdpadButtonAssociation axis="0" button="12" direction="1"/>
@HikariKnight
HikariKnight / pxeboot.mas
Last active March 6, 2022 14:01
pxeboot.mas file to include in /usr/share/zentyal/stubs/dhcp/subnet.mas for when you use fog server for pxe booting
<%doc>
This template generates a better tftp filenames based on architecture
for PXE booting.
Place this file in /usr/share/zentyal/stubs/dhcp
Include it by adding
<& pxeboot.mas, options => \%options &>
into the "if ($options{filename}) {" section of subnet.mas and comment out the
filename "<% $options{filename} %>"; line
</%doc>
@HikariKnight
HikariKnight / snapshot_take
Last active January 21, 2022 06:50
Custom btrfs snapshots for when you need different naming schemes than timeshift or snapper and keep them for 1 month
#!/bin/bash
TIMESTAMP=`date +"%Y.%m.%d-%H.%M.%S"`
SNAP="btrfs subvolume snapshot -r"
SOURCE_DIR="/Tank/data"
SNAP_DIR="/Tank/data/.snapshots"
SNAP_NAME="@GMT_$TIMESTAMP"
$SNAP $SOURCE_DIR $SNAP_DIR/$SNAP_NAME
rm -rf $SNAP_DIR/.snapshots/@SNAP_NAME/.snapshots/*
@HikariKnight
HikariKnight / pkexec
Last active September 5, 2021 01:45
A "pkexec" replacement for use in wsl2 until microsoft fixes policykit in wsl2 (DO NOT USE FOR PRODUCTION)
#!/bin/bash
# Dependencies: zenity
#
# Installation: download the file, name it "pkexec" and make it executable, then put it in /usr/local/bin
# This should in theory auto "fix" programs like synaptic which launches using pkexec from its desktop file.
#
# THIS SCRIPT IS NOT A PROPER REPLACEMENT, SENDING THE PASSWORD THROUGH SUDOS STDIN IS NOT SECURE!
# THIS IS MEANT AS A TEMPORARY WORKAROUND, DO NOT USE IN PRODUCTION!
exec sudo -HSkp '' -- $@ <<<$(zenity --password --title=Authentication) 2>/dev/null
@HikariKnight
HikariKnight / pachannels
Created December 25, 2020 19:50
a login script i run on login to load separate audio channels i defined in ~/.pulse/default.pa
#!/bin/bash
# Unload any loaded loopback modules (start with blank slate)
pacmd unload-module module-loopback
####
# The comments below are the definitions from ~/.pulse/default.pa
# Followed by the "pacmd" command used to load that specific sink as a loopback module
####
## Make a dummy sink for voice
@HikariKnight
HikariKnight / .bashrc
Last active July 11, 2020 09:36
personal bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@HikariKnight
HikariKnight / emoji-toggle.md
Last active July 5, 2020 18:06
ibus emoji toggle
#!/bin/bash
#### CONFIG
ibus_default_layout="xkb:no::nor"
layout="no"
#### END OF CONFIG

ibus_layout=$(ibus engine)
if [[ "$ibus_layout" == $ibus_default_layout ]]; then
 echo Setting ibus to uniemoji
@HikariKnight
HikariKnight / Split audio guide.md
Last active May 14, 2020 19:18
Split audio from programs in pulseaudio

First copy default.pa to ~/.pulse if you do not have it there already

mkdir ~/.pulse
cp /etc/pulse/default.pa ~/.pulse/

Open ~/.pulse/default.pa in a text editor and add this for each audio channel you want

# Make a dummy sink for split audio
load-module module-null-sink sink_name=sinkname