Skip to content

Instantly share code, notes, and snippets.

@elliotwutingfeng
elliotwutingfeng / fix-protonvpn-broken-connection.sh
Created February 13, 2024 06:34
Fix broken network connection after unclean termination of ProtonVPN connection
!#/usr/bin/sh
# List all active connections
nmcli connection show --active
# Delete any dangling connections that are related to protonvpn
# Usually it is `pvpn-ipv6leak-protection`
nmcli connection delete pvpn-ipv6leak-protection
@elliotwutingfeng
elliotwutingfeng / GPG_credentials_Manjaro.md
Created January 6, 2024 02:17
Retrieving GPG credentials from old Manjaro installation

Retrieving GPG credentials from old Manjaro installation

So it was time for a clean install on a larger SSD as my old system became completely unbootable (persistent initramfs uncompression error 😧).

However, I did not back up my GPG credentials 🤦.

I learned that retrieving them from the old system drive via chroot was technically possible but not a straightforward process.


@elliotwutingfeng
elliotwutingfeng / download_from_internet_archive.py
Created March 24, 2023 08:09
Simple script for multithreaded downloading from archive.org
"""
BSD Zero Clause License
Copyright (c) 2023 Wu Tingfeng
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@elliotwutingfeng
elliotwutingfeng / LUKS_decryption_mistype_recovery_instructions.md
Last active November 30, 2023 20:04
These are the decryption instructions for if you mistype your passphrase (and end up in GRUB rescue mode) when logging in to a LUKS encrypted Linux installation.

LUKS decryption mistype recovery instructions

These are the decryption instructions for if you mistype your passphrase (and end up in GRUB rescue mode) when logging in to a LUKS encrypted Linux installation.

Tested on Manjaro Linux.

grub rescue> ls # look for encrypted partition to mount, for example (hd0,gpt2)
grub rescue> cryptomount (hd0,gpt2) # mount the encrypted partition
Attempting to decrypt master key..
@elliotwutingfeng
elliotwutingfeng / Restore the GRUB Bootloader.md
Last active September 5, 2023 19:39 — forked from dianjuar/Restore the GRUB Bootloader.md
Restore the GRUB Bootloader on Manjaro Linux. Useful when your fresh windows install eats your GRUB and cannot boot into your linux installation, or if your GRUB is missing

Restoring the GRUB Bootloader on Manjaro Linux

Manjaro Linux GRUB (especially on dual-boot systems with Windows) may sometimes get corrupted and fail to boot. Possible error messages include

Reboot and select proper Boot Device

or

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@elliotwutingfeng
elliotwutingfeng / gitBash_windows.md
Created July 17, 2022 15:54 — forked from evanwill/gitBash_windows.md
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@elliotwutingfeng
elliotwutingfeng / setting_up_tokei_mirror.md
Last active February 17, 2024 06:55
How to set up your own mirror for tokei web service

How to set up your own mirror for tokei web service

  • Create a free Render account
  • Go to Dashboard
  • Click on New Web Service
  • Paste https://github.com/XAMPPRocky/tokei_rs into the Enter a public repository URL field
  • Fill in these fields with the following values
    • Name : tokei
    • Environment : Rust
  • Region : ``
@joaquinicolas
joaquinicolas / gist:b7d0a0869485bca5156d0d4be87820f4
Created December 15, 2021 02:59
Setup flutter environment in arch linux
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
yay -S flutter
java -version
sudo pacman -S jre8-openjdk
@timbryandev
timbryandev / gist:07f7f7bc1ae4d1856e864bc41b2c9d66
Last active December 25, 2023 14:27
NVME SSD Freezing on Linux

https://esc.sh/blog/nvme-ssd-and-linux-freezing/

nvme_core.default_ps_max_latency_us=5500

How to update the Kernel parameter

First of all, figure out if you are using Grub or systemd boot. If you are using Pop OS!, you are most probably using systemd-boot. I believe Ubuntu is still using Grub2, please do your research.

For Grub