Skip to content

Instantly share code, notes, and snippets.

@jnsnco
Last active December 10, 2025 09:46
Show Gist options
  • Select an option

  • Save jnsnco/bb1d57b25d451575457e24c6385555f8 to your computer and use it in GitHub Desktop.

Select an option

Save jnsnco/bb1d57b25d451575457e24c6385555f8 to your computer and use it in GitHub Desktop.
computer notes - cool things I just learned + things I always forget
  1. get all kinds of neat metadata for GitHub repos (ref)

  2. show your IP Address, Linux CLI (RIP ifconfig 😢) (ref)

    • ip address (kinda embarassing how simple this is.. hopefully just writing this will help me remember)
  3. rotate the Linux CLI, if you have a monitor in portrait orientation (ref)

    • echo 1 | sudo tee /sys/class/graphics/fbcon/rotate
    • 0 = normal, 1 = clockwise, 2 = upside down, 3 = counter-clockwise
    • make it permanent
      • in /etc/default/grub: GRUB_CMDLINE_LINUX="fbcon=rotate:1"
      • sudo update-grub
  4. executing vs sourcing shell scripts (ref)

    • source command runs the script in your current shell instance, . <script> is equivalent to source
    • when you execute a script, it runs in its own shell instance with its own vars etc
    • exec command kills the current shell and replaces it with whatever script or command you supply
  5. Check which shell you're using (ref)

    • echo $0
    • Note that $SHELL needs to be manually updated (at least on Mac) so echo $SHELL isn't reliable
  6. If you have too many key files and ssh gets confused (ref)

    • vim ~/.ssh/config, add the following for each host
      Host SERVERNAME
         Hostname IP-OR-FQDN
         Port PORT (if needed)
         User USERNAME
         PubKeyAuthentication yes
         IdentityFile ~/.ssh/<keyfile>
      
  7. Key based SSH auth for Mac etc (ref)

    • From the Mac / client side
      • ssh-keygen
      • ssh-copy-id
      • to skip the passphrase each time, ssh-add (see ref link above)
  8. Boot from USB:

    • Mac: press & hold Option key when you see the Apple
    • Dell: F12 at logo (YMMV / WFM)
  9. Get Debian, Ubuntu etc to install all the packages: sudo apt-get --with-new-pkgs upgrade (ref)

    • NOTE: no need to worry about updates that aren't installed due to phasing
  10. Use multipass as non-root: (ref)

    • (as root) multipass set local.passphrase
    • (as user) multipass authenticate
  11. Use /home for multipass storage instead of /root

    • NOTE it has to be /home or a removable device b/c of snap confinement
    • this guide works, follow the instructions exactly
    • OR, instead of the cp commands at the end, you can also just reinsatll multipass, it will populate the storage dir
    • ? might be easier to just symlink data and cache dirs, something to try next time
  12. List contents of a local git repo (ref)

    • git ls-tree --full-tree -r --name-only HEAD
  13. Use git with GitHub: (ref)

    • ssh-keygen -t rsa -b 4096 -C "[email protected]"
    • copy the correct line from ~/.ssh/id_rsa.pub to https://github.com/settings/keys
    • (optional) test using ssh -T [email protected]
      • A message like this indicates success: "Hi <username>! You've successfully authenticated, but GitHub does not provide shell access."
    • IMPORTANT This command must be run for each repo you want to connect to GitHub
    • NOTE, ssh-add ~/.ssh/id_rsa doesn't seem to be necessary on Debian/Ubuntu
  14. Encrypted volumes, the systemd way (ref)

    • NOTE you don't need to be root to use the udisksctl command
    • mount
      udisksctl unlock -b /dev/sdb5
      udisksctl mount -b /dev/mapper/ubuntu--vg-root
      
    • unmount
      • If this is a volume group, you'll need to deactivate before locking it: sudo lvchange -an ubuntu-vg
        udisksctl unmount -b /dev/mapper/ubuntu--vg-root
        udisksctl lock -b /dev/sdb5
        
  15. Google & Gmail

  • filter by years, use these strings:
    after:2021-01-01 before:2022-01-01
    after:2022-01-01 before:2023-01-01
    after:2023-01-01 before:2024-01-01
    after:2024-01-01 before:2025-01-01
    after:2025-01-01 before:2026-01-01
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment