Skip to content

Instantly share code, notes, and snippets.

View sortedcord's full-sized avatar
:octocat:
Soo many things to do. Too little time to do them

Aditya Gupta sortedcord

:octocat:
Soo many things to do. Too little time to do them
View GitHub Profile
@sortedcord
sortedcord / toggle-audio.sh
Created February 16, 2026 10:43
Toggle Default Audio Devices
#!/bin/bash
HEADSET="alsa_output.usb-Generic_AB13X_USB_Audio_20210926172016-00.analog-stereo"
LAPTOP="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Headphones__sink"
CURRENT=$(pactl info | awk -F': ' '/Default Sink/ {print $2}')
if [ "$CURRENT" = "$HEADSET" ]; then
NEW="$LAPTOP"
MSG="Audio → Laptop"
@sortedcord
sortedcord / blinding_lights.swlrc.json
Created February 29, 2024 09:06
Example of enhaced lyrics as a json
{
"StartTime": 27.395,
"EndTime": 194.87,
"Type": "Syllable",
"VocalGroups": [
{
"Type": "Vocal",
"OppositeAligned": false,
"StartTime": 27.395,
"EndTime": 28.96,
@sortedcord
sortedcord / swing-truenas-setup.md
Last active February 26, 2024 09:24
Running Swing Music on TRUENAS Scale

Static Badge Static Badge

Setting Up Swing For Truenas Scale

This is a short and simple guide to setting up a Swing Instance on your Truenas (Scale) machine. Since there are no charts specifically for Swing, you would have to create a custom app and straight up the docker image.

1. Pulling the docker image

@sortedcord
sortedcord / models.py
Created November 18, 2021 05:28
List Fields in Django
from django.db import models
import ast
class ListField(models.TextField):
__metaclass__ = models.SubfieldBase
description = "Stores a python list"
def __init__(self, *args, **kwargs):
super(ListField, self).__init__(*args, **kwargs)