12/17/2024

Set up a Mac computer

  1.  Setup various shortcuts
    • Lock: ctrl + cmd + L (Use Shortcut app)
    • Slack: ctrl + alt + A (Use Shortcut app)
    • Onenote: ctrl + alt + S (Use Shortcut app)
    • Screenshot: cmd + shift + S (Settings | Keyboard shorts | screenshots)
    • Wechat: ctrl + alt + W (Wechat app built in)
    • Switch Sougou EN/CN: ctrl + , (Settings | Keyboard shorts | Input Sources | Select next source ...)
    • Left mouse click: cmd + ; (Shortcut app | Run Shell Script Click | /opt/homebrew/bin/cliclick c:.)
    • English dictionary: ctrl + cmd + 2 (Use Shortcut app)
    • Terminal: ctrl + alt + T (Use Shortcut app)
    • Netease Music: ctrl + alt + M (Use Shortcut app)
    • Symbol picker: ctrl + shift + Z (Settings | Keyboard shorts | App Shortcuts | All Applications | Add 'Emoji & Symbols' to ctrl + shift + Z
  2. Setup Keyboard layout
    • Use customized keyboard layout: https://stackoverflow.com/questions/11876485/how-to-disable-generating-special-characters-when-pressing-the-alta-optiona
    • Disable the default ABC keyboard layout:
      • Change the current input source to your custom keyboard layout.
      • Open ~/Library/Preferences/com.apple.HIToolbox.plist (in 10.9) or ~/Library/Preferences/ByHost/com.apple.HIToolbox.*.plist (in 10.8 and earlier). You can convert the plist to XML with plutil -convert xml1.
      • Remove the input source or input sources you want to disable from the AppleEnabledInputSources dictionary. If there is an AppleDefaultAsciiInputSource key, remove it.
      • Restart.
  3. Use iTerm2 for Terminal
    • Instal Brew
    • brew install bash (Use bash instead of zsh)
    • brew install emacs (Need to modify keyboard: Settings | Profiles | Keys | Key Mappings | Natural Text Editing | Add \033[1;5A (Send Text with vim special chars to ctrl + up | Add \033[1;5B for ctrl + down)
  4. Use Doll for Slack notification in the menu bar 
  5. brew install --cask notunes (To disable Music to launch automatically when the bluetooth headphone is picked up)

12/10/2024

How to fix Windows boot issues

What worked on my Alienware Windows 10:
  1. Use Windows Media creation tool to create a bootable USB Windows 10
  2. Boot to repair my computer and start a terminal
  3. Run:
    1. diskpart
    2. sel disk 0
    3. sel volume 0 ------`#mycomment (The system EFI volume)`
    4. assign letter S:
    5. exit
  4. Run:
    1. S:
    2. cd EFI\Microsoft\Boot\
    3. ren BCD BCD.bak
    4. bcdboot C:\Windows /s S: /f ALL
    5. bootrec /rebuildbcd
    6. exit
  5. Restart the computer and it should boot

12/09/2024

PDF merge command on Linux

 pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf