Dotfiles, utilities, and other apparatus.
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.

247 lines
10 KiB

5 years ago
5 years ago
5 years ago
  1. bpb-kit
  2. =======
  3. **If you're reading this on GitHub, it may be out of date. The canonical copy
  4. of this repository [lives on code.p1k3.com][bpb-kit].**
  5. This repo is for dotfiles, utility scripts, and other things in my personal
  6. setup. Ideally, it includes most of the bits and pieces that make a personal
  7. machine usable for me. It may occasionally serve as a testbed for things that
  8. will eventually become standalone projects.
  9. I generally use Debian and Debian-like GNU/Linux systems (including Ubuntu),
  10. with the [xmonad][xmonad] tiling window manager rather than a full desktop
  11. environment like Gnome or KDE. I usually edit text in Vim, with
  12. [Vimwiki][vimwiki] for notes. I maintain a blog called [p1k3][p1k3] using
  13. [wrt][wrt].
  14. I have a [partially-finished book about the command line][userland] which may
  15. be relevant.
  16. status
  17. ------
  18. As of February 2020, this collection is actively maintained, although it
  19. doesn't meet the standards of quality, consistency, or documentation you might
  20. want from a real software project.
  21. (Then again, neither do most software projects.)
  22. copying
  23. -------
  24. Except as noted below or in the body of specific files, and to the extent
  25. possible under law, I, Brennen Bearnes, waive all copyright and related or
  26. neighboring rights to the contents of bpb-kit. Go to town.
  27. Exceptions:
  28. - `home/bin/grab`, written Tyler Cipriani, is probably GPLv3 or later,
  29. I'll clarify that.
  30. a philosophical note about copying
  31. ----------------------------------
  32. In the _general case_, I am a firm believer in Free Software, and
  33. correspondingly in the pragmatic value of strong copyleft licenses like the GNU
  34. General Public License. Where I have the option, I'll generally license more
  35. substantial projects under the GPL, with a view towards impeding the corporate
  36. capture of every available computational resource and generally throwing a
  37. little grit in the gears of capital in these latter days before it finishes
  38. murdering the entire biosphere. (As no one uses my software, this is a purely
  39. symbolic gesture, but what the hell.)
  40. People have invested a lot of time and effort in telling us the GPL is uncool,
  41. just as they've invested a lot of time and effort in promoting the practical
  42. business-friendly benefits of "Open Source" as a development methodology while
  43. tucking the political implications of Free Software away out of sight so as not
  44. upset the billionaires. These are not unrelated phenomena.
  45. All that said, this is a trivial repository of configuration fragments and
  46. small utility scripts for a very limited audience. It seems likely to do the
  47. most good if nobody has to worry about the bureaucracy of grabbing bits and
  48. pieces of it.
  49. From time to time, I _may_ incorporate code from other sources in this
  50. collection, as long as it's in the public domain or under a license that meets
  51. the Debian Free Software Guidelines. In those cases, I'll do my best to ensure
  52. that said code is clearly marked.
  53. sources
  54. -------
  55. I have thiefed ideas and bits of configuration from the following projects and
  56. people:
  57. - [Advanced Bash Scripting Guide][bash-guide], Mendel Cooper
  58. - [Learn Vimscript the Hard Way][vimscript], Steve Losh
  59. - [ArchWiki][archwiki]
  60. - [Alan][alan]
  61. - [Ben][ben]
  62. - [Casey][casey]
  63. - [Chris][chris]
  64. - [Dave][dave]
  65. - [Jacky][jacky-alcine]
  66. - [Leah][leah]
  67. - [Rob][rob]
  68. - [Todd][todd]
  69. - [Tyler][tyler]
  70. contents
  71. --------
  72. ### shell stuff
  73. These days I use ZSH on personal systems and Bash when writing tutorials, doing
  74. tech support, or working on production server systems. I like to keep lots and
  75. lots of history. I think shell scripting is a nightmare for most real tasks,
  76. but I do it sometimes anyway.
  77. - [`.bashrc`](home/.bashrc)
  78. - [`.zshrc`](home/.zshrc) - nothing fancy
  79. - [`.sh_common`](home/.sh_common) - aliases and variables for both Bash and ZSH;
  80. no Bash compatibility guarantees here, since I mostly don't use custom
  81. aliases in Bash
  82. ### scripts in [home/bin/](home/bin)
  83. Scripts here fall into a handful of categories:
  84. - Short wrappers for getting (or remembering) specific behavior from other
  85. tools
  86. - Screenshot and screencast tools used in my work as a writer for
  87. DigitalOcean and Adafruit
  88. - Things for working with the [p1k3][p1k3] repo and site
  89. - Text filters and template fragments, mostly for use with Vim aliases
  90. - Miscellaneous utilities
  91. Many of these are unlikely to be portable, useful, or documented.
  92. - `cheat`: a place to hang a personal cheatsheet of sorts
  93. - `chrome-incognito`: run Google Chrome in incognito mode
  94. - `dmenu_unique`: run dmenu with big fonts and vertical, only showing each entry once
  95. - `dog`: concatenate argument strings with stdin
  96. - `edit-clipboard`: edit the current text selection in `$EDITOR` (requires `xclip`)
  97. - `enterprise`: play a sound like the _USS Enterprise_ engines in TNG
  98. - `filter-decorate`: splat some text dingbats into HTML I write sometimes
  99. - `filter-exec`: replace text in-between markers with result of shell-script execution
  100. - `filter-exec-raw`: like above, but different
  101. - `filter-exec-stdin`: feed text in-between markers to standard input of a command, replace it with output
  102. - `filter-markdownify`: convert a few things in old DigitalOcean tutorials to Markdown
  103. - `filter-vertical`: verticalize a string
  104. - `firefox-fromselection`: open a selected url in firefox
  105. - `fragment-bullet`: print out a "random" dingbat character
  106. - `fragment-entry`: stub blog entry
  107. - `fragment-entry-gallery`: stub blog entry with gallery
  108. - `fragment-entry-poem`: stub blog entry with poem
  109. - `get-external-ip`: print public IP address
  110. - `gif-sel`, `gif-sel-4`, `gif-sel-15`: take an animated gif of selected screen region
  111. - `git-diff-wrapper`: use vim with `git-diff-tool`
  112. - `git-local-to-remote-status`
  113. - `grab`, `grab-sel`: take a screenshot, take a screenshot of a selected region
  114. - `json_decode.php`: decode JSON into PHP data structures
  115. - `jsonprint.pl`: pretty-print JSON with Perl
  116. - `jump-to-window`: use `wmctrl` and `dmenu` to pick a window to jump to
  117. - `listusers`: print an HTML list of users
  118. - `lynx-wrapper-edit`: edit a p1k3 entry in vim and re-render everything
  119. - `machine-status`: use `dsh` to check status on a list of machines (stub)
  120. - `mostrecent`: print the name of newest file in the current directory
  121. - `notesession`: start a tmux named session for notes
  122. - `photocp`: copy photos from various media to a home directory location
  123. - `pmwhich`: find the on-filesystem location of a Perl module
  124. - `rightnow`: print the current time in a variety of formats
  125. - `saytime`: speak the time with Festival
  126. - `snowday`: is it a snow day for the Boulder Valley School District?
  127. - `ssh-nofucks`: SSH to an address, I don't really care if the key has changed
  128. - `st`: get status using myrepos
  129. - `timelog`: parse a timelogging format (I use this to bill for contracting)
  130. - `timeslice`: aggregate some data for a given date range or file's implied date
  131. - `today`: print a date
  132. - `todaydir`: find a p1k3 dir for the current date
  133. - `uni`: search unicode codepoint names (via @chneukirchen)
  134. - `unsorted-unique`: print all lines of input once (just an `awk` one-liner)
  135. - `wip`: move a p1k3 file into a work-in-progress directory
  136. - `words`: split input into individual words
  137. - `wthr`: use unicode snowflakes to display CPU load
  138. - `xm`: call xmodmap
  139. - `xmonad.start`: personal version of xmonad startup script
  140. - `xtfix`: do a subtle color shift within the current xterm
  141. - `yank`, `put`, `put-mv`: stash a file path, copy or move it to the current directory
  142. ### fragments
  143. The [fragments](home/fragments) directory is for code snippets that I write in the
  144. course of testing some idea, checking a technique, or trying to solve a problem
  145. posed by friends on IRC.
  146. They're typically the kind of thing I'd throw in a random file called something
  147. like `test.sh` and overwrite later. It seemed useful to start collecting these
  148. instead.
  149. ### cheatsheets
  150. The [cheatsheets](home/cheatsheets) directory is mostly empty, but may become a
  151. repository of useful shorthand documentation for the increasingly-many things I
  152. use that are not discoverable or memorable enough for my deteriorating
  153. long-term memory.
  154. ### tmux
  155. I use `tmux` for terminal multiplexing (i.e., most of what GNU Screen does).
  156. In practice, this means that I rely on it for
  157. - persistent shell sessions, sometimes attached to multiple machines
  158. - putting a bunch of shell / editor buffers inside one `ssh` or `mosh`
  159. session
  160. - capturing and scrolling back through a bunch of output
  161. My [`.tmux.conf`](home/.tmux.conf) is brief, but does contain one useful
  162. snippet for correcting weird Esc-key behavior in Vim.
  163. ### vim config
  164. - [`.vimrc`](home/.vimrc) - see file for installation details
  165. - uses [Vundle][vundle] to manage plugins and such
  166. - pulls in a ton of plugins, some more useful than others
  167. ### window management
  168. - `.xmodmap`
  169. - capslock -> ctrl
  170. - `.xinitrc`
  171. - sources `.hacksrc` if it exists
  172. - `.Xresources` tweaks xterm behavior and a number of fonts
  173. - behavior changes depending on whether `.hacksrc` is linked to
  174. `.hacksrc_hi_dpi`
  175. - XMonad config -
  176. - `.xmobarrc`, `.xmonad/`
  177. - see [`bin/xmonad.start`](bin/xmonad.start) for a drop-in replacement for
  178. default XMonad startup on some Debian-like systems, including Gnome/Unity
  179. stuff and the like. Perpetually not-quite-right.
  180. building a debian package for dependencies
  181. ------------------------------------------
  182. See instructions in [ns-control](ns-control).
  183. [alan]: https://github.com/acg
  184. [archwiki]: https://wiki.archlinux.org/
  185. [bash-guide]: http://www.tldp.org/LDP/abs/html/
  186. [ben]: https://github.com/benlemasurier
  187. [bpb-kit]: https://code.p1k3.com/gitea/brennen/bpb-kit
  188. [code]: https://code.p1k3.com/
  189. [casey]: https://github.com/caseydentinger/
  190. [chris]: https://github.com/frencil
  191. [dave]: https://stilldavid.com/
  192. [leah]: https://github.com/chneukirchen/
  193. [p1k3]: https://p1k3.com/
  194. [rob]: https://github.com/robacarp/
  195. [todd]: https://uniontownlabs.org/
  196. [tyler]: https://tylercipriani.com/
  197. [jacky-alcine]: https://jacky.wtf/
  198. [userland]: https://p1k3.com/userland-book/
  199. [vimscript]: http://learnvimscriptthehardway.stevelosh.com/
  200. [vimwiki]: https://github.com/vimwiki/vimwiki
  201. [vundle]: https://github.com/VundleVim/Vundle.vim
  202. [wrt]: https://code.p1k3.com/gitea/brennen/wrt
  203. [xmonad]: http://xmonad.org/