Skip to content

Instantly share code, notes, and snippets.

@phoenixthrush
phoenixthrush / set-mic.sh
Last active April 29, 2025 19:34
Fixing Sound BlasterX G6 Microphone on Linux
#!/usr/bin/env bash
cardNumber=$(aplay -l|grep 'Sound BlasterX G6'|cut -d' ' -f 2 |tr -d ':')
amixer -c "$cardNumber" -q set "PCM Capture Source" "External Mic"
if [ $? -eq 0 ]; then
echo "PCM Capture Source successfully changed to 'External Mic'"
else
echo "Failed to configure PCM Capture source for Sound BlasterX G6"
fi
@triadmoko
triadmoko / oauth2_integration.go
Created July 16, 2022 14:23 — forked from tuxlinuxien/oauth2_integration.go
gin gonic oauth2 integration
package main
import (
"bytes"
"encoding/json"
"github.com/gin-gonic/gin"
"golang.org/x/oauth2"
"golang.org/x/oauth2/bitbucket"
"golang.org/x/oauth2/github"
"golang.org/x/oauth2/google"
@mbforbes
mbforbes / ecs-dirty-aspects.ts
Created January 4, 2022 22:22
TypeScript ECS w/ dirty Component optimization and Aspects
/**
* An entity is just an ID. This is used to look up its associated
* Components.
*/
export type Entity = number
/**
* A Component is a bundle of state. Each instance of a Component is
* associated with a single Entity.
@qcasey
qcasey / README.md
Last active May 8, 2025 15:43 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Ubuntu / Debian for non-raspbian SBCs (ODROID, Orange Pi, Armbian, etc)

About

This gist will show how to setup a generic SBC Debian / Ubuntu install as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

This is forked from another gist specific to the Raspberry Pi on Stretch. A required package isn't in Ubuntu's repos, so in this gist we build it from scratch.

Tested to be working on Armbian/Ubuntu/Debian images of the Orange Pi Zero, ODROID XU4, ODROID N2, and Atomic Pi.

Prerequisites

@cfra
cfra / pulseaudio-u44.md
Last active July 31, 2023 14:57
Zoom U-44 PulseAudio Setup

Zoom U-44 PulseAudio Setup

Problem Statement

The Zoom U-44 works out of the box with recent Linux versions.

By default, PulseAudio will register it as a single sink with 4 output channels. As the U-44 is organized to have two stereo pairs for outputs, there are situations where it is more useful to have 2 separate sinks available, each playing back to one of the two stereo pairs.

@nmarley
nmarley / README.md
Last active March 31, 2025 22:32
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
###############################################
# TX SX OS unpacker - by hexkyz and naehrwert #
###############################################
from Crypto.Cipher import AES
from Crypto.Util import Counter
import os
import struct
"""

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.

Important

  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

@tuxlinuxien
tuxlinuxien / oauth2_integration.go
Last active October 18, 2023 10:50
gin gonic oauth2 integration
package main
import (
"bytes"
"encoding/json"
"github.com/gin-gonic/gin"
"golang.org/x/oauth2"
"golang.org/x/oauth2/bitbucket"
"golang.org/x/oauth2/github"
"golang.org/x/oauth2/google"
@samiraguiar
samiraguiar / MC Cheat Sheet
Last active May 10, 2025 19:55 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
---------------------------------------------------------------
- File/directory operations