You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linux.adoc 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. +++
  2. +++
  3. :source-highlighter: pygments
  4. :source-language: console
  5. == Linux
  6. === Dotfiles
  7. I store my dotfiles in Git so I can easily keep track of
  8. changes and sync them between devices.
  9. To do so I create a bare git repository in my home directory,
  10. and configure it to not show untracked files:
  11. [source]
  12. ----
  13. $ cd $HOME
  14. $ git init --bare $HOME/.dotfiles
  15. $ git --git-dir=$HOME/.dotfiles config --local status.showUntrackedFiles no
  16. ----
  17. I then have the following in my `.bash_aliases` to make it easier to
  18. interact with when I want to perform git operations:
  19. [source,bash]
  20. ----
  21. # dotfiles
  22. alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
  23. ----
  24. Some of my dotfiles have API keys and other semi-sensitive bits and bobs,
  25. so I encrypt the entire repository with
  26. https://github.com/spwhitton/git-remote-gcrypt[git-remote-gcrypt].
  27. === Random commands
  28. Split some pages from a PDF::
  29. [source]
  30. ----
  31. $ pdftk myoldfile.pdf cat 1 2 4 5 output mynewfile.pdf
  32. ----
  33. Resizing disks::
  34. [source]
  35. ----
  36. $ fdisk # delete and recreate the partition
  37. $ resize2fs # resize to the new partition
  38. ----
  39. Adjust IO priority::
  40. [source]
  41. ----
  42. $ iotop -c 3 pid # -c 3 is "when idle"
  43. ----
  44. Take a screenshot of an area::
  45. [source]
  46. ----
  47. $ scrot -s output.png
  48. ----
  49. === Alpine
  50. https://www.alpinelinux.org/[Alpine] is a lightweight linux distribution that
  51. uses musl libc and busybox. It is often used in docker images due to its
  52. relatively small footprint.
  53. ==== Notes
  54. * The equivalent of Ubuntu's `build-essential` is `build-base`