Skip to content

Instantly share code, notes, and snippets.

@Trogious
Trogious / 51-alsa-multichannelAudioInterface.lua
Created March 9, 2024 19:14
Pipewire channels configuration
-- /etc/wireplumber/main.lua.d/51-alsa-multichannelAudioInterface.lua
rule = {
matches = {
{
{ "node.name", "matches", "alsa_input.usb-Generic_USB_Audio-00.HiFi_5_1__hw_Audio__sink" },
},
{
{ "node.name", "matches", "alsa_output.usb-Generic_USB_Audio-00.HiFi_5_1__hw_Audio__sink" },
},
@Trogious
Trogious / mkbootable_dmg.sh
Created March 27, 2022 13:35
Create bootable Montenery install DMG
hdiutil create -o Montenery -size 15000m -volname Montenery -layout SPUD -fs HFS+J
mkdir /Volumes/Montenery
hdiutil attach Montenery.dmg -noverify -mountpoint /Volumes/Montenery
/Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Montenery --nointeraction
@Trogious
Trogious / github_latest_release_version_java.md
Last active April 25, 2020 15:03
Get latest release version of a GitHub repo's release (Android Java)

Gets the latest release version (based on tag name) for a given GitHub repo. (requires Guava due to usage of CharStreams).

    private static class VersionTask extends AsyncTask<String, String, String> {
        @Override
        protected String doInBackground(String... strings) {
            String result = null;
            URL url;
            HttpURLConnection connection = null;
            try {
@Trogious
Trogious / git_tag_or_version_gradle.md
Last active August 6, 2024 06:29
How to get latest git tag or commit ID (gradle)

How to get latest git tag or commit ID (gradle)

The following will give you the latest git tag name (if the HEAD is tagged) or latest commit ID otherwise. The getAppVersion function returns the end value.

Why is this useful?

I use it to name packages of my builds and other versioning purposes in my Android projects.

The code:

def getAppVersion = { ->
 def stdout = new ByteArrayOutputStream()
@Trogious
Trogious / git_tag_or_version_sh.md
Last active April 23, 2020 11:59
How to get latest git tag or commit ID (shell)

How to get latest git tag or commit ID (shell)

The following will give you the latest git tag name (if the HEAD is tagged) or latest commit ID otherwise. After execution the X_VERSION variable holds the end value.

Why is this useful?

I use it to name packages of my builds and other versioning purposes. See example here.

The script:

X_GIT_COMMITID=`git rev-parse --short HEAD | tr -d "\n" | sed 's/ //g'`
X_GIT_TAG=`git tag --points-at $X_GIT_COMMITID | tr -d "\n" | sed 's/ //g'`
@Trogious
Trogious / vobsub2srt.md
Last active February 27, 2020 19:57
VobSub2SRT static build

VobSub2SRT

Fully static build of VobSub2SRT can be found here.

compiled with:

tesseract-4.1.1
glibc-2.30

...and all other required libs.

@Trogious
Trogious / rtorrent.md
Last active February 27, 2020 15:37
rtorrent static builds