💾 Archived View for voidcruiser.nl › documentation.gmi captured on 2024-12-17 at 09:23:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-07-08)

🚧 View Differences

-=-=-=-=-=-=-

Documentation

Nix

I wish I knew about this command earlier:

nix why-depends

Docker/Podman

I keep forgetting the -p syntax

docker run -p <host-port>:<container-port> <container-name>

Latex

There is a way to get latex to insert empty lines automatically when starting a paragraph automatically. Just add the following to your preamble:

\usepacakge{parskip}

Haskell and adjacent languages

I keep forgetting the difference between foldl and foldr

The foldl function starts from the left of the given list and moves to the right.

foldr starts from the right and moves its way to the left.

fold(l|r)1 take the first encountered element in the given list as accumulator

scan(l|r)(1|) does the same as fold, but prints the intermediate steps

Development meta packages

Distros have meta packages with common development utilities like gcc, make and git. For some reason each distro has it's own idea on what it's meta package should be called. Here are some of the names I figured out so far.

PGP gripes

If you use pass as password manager install pinentry as well.

It'll make your life a lot easier.

It is a graphical interface for you to mash the passphrase for your PGP key into.

Android

Since Android 15 there is this "private space" feature. It allows you to have a seperate context for various apps besides using a completely different user profile. Or at least thats how it presents itself. This is all well and good and a really neat feature, but by default you are limited to installing apps using the default app source on your device.

Through some digging I found out that it is indeed just a different user profile but in a different coat of paint. With this knoweldge I figured out how you can install apps adb- and expose already-installed apps to the "private space" user using adb.

First you need to get the user ID of the private space.

You do this with the following command:

adb shell dumpsys user | grep Private

This will then output something like the following:

UserInfo{11:Private space:1010} serialNo=11 isPrimary=false parentId=0

The first field of the 'UserInfo' object is the user ID; 11 in the example above.

Armed with this knoweldge, you can install apks from your system using the '--user' flag:

adb install --user 11 /path/to/app.apk

Handy little blogpost I followed:

Android private space: How to install apps from other sources by René Mayrhofer

However, if you want to install an apk that already resides in any of the other profiles on your device, you will get an error. Instead you will have to expose the given app to the "Private space" user like you would with any other profile. To do this, you can use the following command:

adb shell pm install-existing --user 11 dev.imranr.obtainium

I have no idea about the privacy and security rammifications about this, so do this at your own risk.

In order to get the name of a currently-installed app, you can use the following oneliner:

adb shell pm list packages | awk -F':' '{print$2}' | grep <appname>

Windows is a terrible OS

Remove a bunch of its bloatware with this.

Get-AppxPackage -allusers | Remove-AppxPackage