Skip to content

Instantly share code, notes, and snippets.

View MLSci's full-sized avatar
💭
Preparing for the Turing test

MLSci

💭
Preparing for the Turing test
View GitHub Profile
1.When there are a lot of packages upgradable, don't `apt upgrade`, which will cause freeze. Instead, do `apt install x y z` in small batches.
2
@MLSci
MLSci / gist:6ab4aa6f33f38dcba02fae7c9a7d329c
Last active January 8, 2025 04:35
Optimize Windows 11
0.9 Install Windows with a local account so as to edit the name of the %USER% folder
1. Prevent Edge from using system resources
Open Edge, then click the 3 dots and select Settings
Search for boost in Edge settings
Turn off Startup Boost setting and also the one that allows background extensions and apps when Edge is not running
It is not safe to remove Edge from Windows because its functionality is used in many other built in-apps
1.5 Set up Dev Home

Ctrl+backspace

funced fish_default_key_bindings

and add bind \cH backward-kill-word to the body of the function, save and

funcsave fish_default_key_bindings

You can also use fish_key_reader to test different key combos.

Homebrew

Don't use ujust to install on host despite the first-timer welcome message suggests so. Install in distrobox if you need

Because of all sort of issues with nvidia+wayland (e.g. can't enable hw acceleration in chrome), I decided to use my Intel iGPU as the source of video output to my monitor. Simply plugging the HDMI cable in it doesn't work - the screen remains black most of the time, if getting any signal at all.

The correct solution is bios -> internal graphic -> enable

The pitfall to avoid is bios -> display priority. Leave it at PCI 1 and don't change it to iGPU. Otherwise it still doesn't work.

When running docker-compose, an error "conflicting options: port publishing and the container type network mode"

The issue is caused by it attempting to map a container port to a host port so that it can connect. Unfortunately, Docker doesn't support port mapping on containers launched in the network stack sharing mode (i.e. the ones using --network container: option). In order to achieve the desired effect the port mapping must be specified on the container whose network stack is being shared (the "Server" container in the description above) instead.

Solution: When your qbittorrent service uses the network namespace of the gluetan service, the owner of the network namespace is gluetan. As such, ports must be published on the gluetan service, no on the qbittorrent service.

TLS handshake timeout near finish of composing

Caused by the NordVPN still connected.

Solution: nordvpn disconnect

Symptom

The HDD stops spinning a few seconds after powered on.

Cause

Previously I need to connect the Pi to my computer in order to use the computer's LAN network. To achieve this I edited the /boot/config.txt by adding the dwc2 control and commenting out the otg_mode.

Solution

Reverse the two, so otg_mode is used.

How to use this?

  1. Install the USB drivers for your device (Google has a list of some universal USB drivers here)
  2. Download the ADB binary for your particular OS (Windows, Mac, Linux)
  3. Extract the zip file into a folder that you can quickly access.
  4. On your phone, go to Settings and tap on About Phone. Find the Build Number and tap on it 7 times to enable Developer Options.
  5. Now enter Developer Options and find USB Debugging. Enable it.
  6. On your computer, browse to the directory where you extracted the ADB binary.
  7. Launch a Command Prompt in your ADB folder. For Windows users, this can be done by holding Shift and Right-clicking then selecting the “open command prompt here” option.
  8. Once you’re in the command