SqlSugar: Connection open error . The given key '25971' was not present in the dictionary.

Solution: put charset=utf8mb4 into the connection string.

My New Productivity Hacks

Muscle Memory Makeover

Docker just streamlined Docker Compose by integrating it as a plugin. Great news, but it means us old hats need to retrain our fingers. Here's a quick fix for your .bashrc to keep things smooth:

alias docker-compose='docker compose'

MySQL in a Flash

As a programmer and Linux admin, I juggle multiple MySQL servers with different group suffixes. Typing --defaults-group-suffix every time was a drag. This handy bash function saves the day:

m() {
  mysql --defaults-group-suffix=$1
}

Now, connecting to a database is as easy as:

m specific-suffix

This keeps your workflow concise and saves you precious keystrokes. Put them into you .bashrc or .zshrc now and let our life easier!

Conquering GitHub with Your Keyboard: The Power of "gh"

Tired of that browser tab switcheroo just to manage your GitHub tasks? Enter "gh", the command-line superhero that streamlines your workflow.

Why "gh" Rocks

For us command-line ninjas, "gh" is a game-changer. Ditch the endless tab dance! Create a pull request, find yours, it's all right there in your terminal.

Gettin' Started with "gh"

Installation's a breeze, no matter your OS:

  • Windows: Chocolatey to the rescue! Run choco install gh in your command prompt.
  • Linux: Package manager to the rescue! For Ubuntu/Debian, use sudo apt install gh.
  • macOS: Homebrew's your friend. Just run brew install gh in your terminal.

"gh" Setup: Simple as Can Be

Windows users might need to add gh.exe to their PATH for easy access, but Linux and macOS users can just dive right in. No extra setup, just pure productivity.

Exploring "gh"'s Awesomeness

Ready to unleash the power? Here's a taste:

  • See Your Pull Requests: gh pr view keeps you in the loop, no browser needed.
  • Create Pull Requests in a Flash: gh pr create gets things rolling directly from your terminal.

These are just a peek – "gh" has tons more to offer. Explore the docs and discover features that fit your workflow perfectly.

The Verdict

In our time-crunched world, tools like "gh" are golden. By harnessing the command line, you can streamline your GitHub tasks and focus on the real prize: killer code. Give "gh" a try and see how it transforms your development game!

Chromebook / Macbook Pro (mid 2010) setup xubuntu 22.04 note

  1. Download xubuntu 22.04 iso
  2. insert usb stick
  3. sudo fdisk -l to check usb stick device name /dev/sdx
  4. Make a bootable usb drive by running
    • dd if=xubuntu.iso of=/dev/sdx bs=1M status=progress
  5. booting from the usb stick and install
  6. Booting into recovery and disable Journal feature if you use a SDCard as your hard disk (important!)
  7. Adding noatime option to disk partitions to improve performance & save your disk's life
  8. Changing font size to 11
  9. Setting the touchpad: disable touchpad while typing
  10. Installing the following packages (use wired network)
    1. sudo apt install firmware-b43-installer curl git vim htop autojump ncdu fonts-inconsolata fonts-ricty-diminished fcitx fcitx-rime
    2. fc-cache -f -v # let new fonts available immediately for applications
    3. install tailscale
    4. install brave browser # the fastest browser on low memory laptop
    5. install neofetch
    6. install Rider Rider can run but it runs so slowly on this aged laptop.
    7. rustdesk

The simplest way to change visudo editor from nano to vi

If you are using ubuntu or debian, the answer is

sudo apt purge nano

It is not a joke, it works! Reference

Surely there is a regular way

sudo update-alternatives --config editor

which is also good. But I love the former way, as it also removes the nano editor, which I nearly never use.

how to do sudo without asking a password

sudo visudo, then add a line at the end of the editor

your-user-name ALL=(ALL:ALL) NOPASSWD:ALL

save and exit, done!