A zine about Linux. That's all.
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.

286 lines
12 KiB

10 months ago
10 months ago
10 months ago
10 months ago
  1. \documentclass[twoside]{report}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage{amsmath}
  4. \usepackage{amssymb}
  5. \usepackage{makeidx}
  6. \usepackage{graphicx}
  7. \usepackage{kpfonts}
  8. \usepackage{float}
  9. \raggedbottom
  10. \usepackage{array}
  11. \usepackage{multirow}
  12. % Where are our images?
  13. \graphicspath{{images/}}
  14. % Let's set this as a half-letter sized sheet
  15. \usepackage{geometry}
  16. \geometry{
  17. paperheight=8.5in,
  18. paperwidth=5.5in,
  19. % heightrounded,
  20. margin=0.5in
  21. }
  22. % Adjust the top and bottom margins
  23. \addtolength{\topmargin}{0.4in}
  24. \addtolength{\textheight}{-0.75in}
  25. % Set the header style
  26. \usepackage{fancyhdr}
  27. \pagestyle{fancy}
  28. \fancyhf{}
  29. \fancyhead[LE,RO]{\textit{the codex}}
  30. \fancyhead[RE,LO]{Issue \#003}
  31. \cfoot{Page \thepage}
  32. \renewcommand{\footrulewidth}{0.5pt}
  33. % Includ two- or three-column sections
  34. \usepackage{multicol}
  35. % Stop resetting the footnote count after each chapter
  36. \counterwithout{footnote}{chapter}
  37. % Let's wrap some images
  38. \usepackage{wrapfig}
  39. % Use tab stops when we need to (especially in footnotes)
  40. \usepackage{tabto}
  41. % Define 18 tab stops (at 1/4" intervals)
  42. \NumTabs{18}
  43. % Make things neater. Thanks /u/-LeopardShark-
  44. \usepackage{microtype}
  45. % Make a nice border and box for the tops of our examples
  46. \newcommand\klab[3]{\vspace{#1}\noindent{}\hrulefill\fbox{\texttt{~#2~}}\hrulefill\vspace{#3}}
  47. % Add an \hrule with space above and below
  48. \newcommand\krule[2]{\vspace{#1}\hrule\vspace{#2}}
  49. % Make hrefs easier (must load package hyperref}
  50. \newcommand\kref[2]{\href{#1}{{\texttt{#2}}}}
  51. % Rotate text in tables easier
  52. % https://tex.stackexchange.com/questions/89115/how-to-rotate-text-in-multirow-table
  53. \newcommand\krot[3]{\parbox[t]{#1}{\multirow{#2}{*}{\rotatebox[origin=c]{90}{#3}}}}
  54. % Use line numbers with code samples
  55. % \begin{Verbatim}...\end{Verbatim} <-- Note the capitalization!
  56. \usepackage{fancyvrb}
  57. % Break lines inside this environment:
  58. \usepackage{fvextra}
  59. % Control spacing in lists
  60. \usepackage{enumitem}
  61. % Don't force text to fill page
  62. \raggedbottom
  63. % Better control over line-spacing
  64. \usepackage{setspace}
  65. % Use nice fractions
  66. \usepackage{nicefrac}
  67. % Keep the footnotes at the bottom of the page
  68. \usepackage[bottom]{footmisc}
  69. % Do we want to include URLs?
  70. % Yes, but we also want to hide the big red box it puts around them in the pdf. Thanks /u/0b0101011001001011
  71. \usepackage[hidelinks]{hyperref}
  72. %%%% Document Information %%%%%
  73. \author{Kenneth John Odle}
  74. \title{
  75. {\Huge the codex} \\
  76. {\footnotesize Life with Linux — A Zine \\
  77. \bigskip
  78. Typeset in \LaTeX{} \\
  79. Issue \#004}
  80. }
  81. \date{\begin{small}\today{}\end{small}}
  82. % Change the name of the TOC
  83. \renewcommand*\contentsname{In This Issue…}
  84. \begin{document}
  85. \maketitle
  86. \section*{Impressum}
  87. All contents \copyright2023 Kenneth John Odle
  88. Although this is now in your hands, and it's also on the web, so if you really wanted to steal this, I've made it pretty darn easy. I can't imagine why anyone would want to, though. However, you don't need to, because this is licenced under a CC BY-NA-SA 4.0 Creative Commons license. More information is at \href{https://creativecommons.org/licenses/by-nc-sa/4.0/}{\texttt{https://creativecommons.org/licenses/by-nc-sa/4.0/}} \includegraphics[scale=0.30]{ncsa4-0}
  89. FYI, this is made in \LaTeX \,using the report document class. It then gets exported to a letterhalf (5.5 in x 8.5 in) pdf, which then gets made into a booklet using PDF Booklet (\kref{https://pdfbooklet.sourceforge.io/wordpress/}{https://pdfbooklet.sourceforge.io/word\\press/}).
  90. The image of Linus Torvalds on the front cover is courtesy JericoDelayah from the WikiMedia Commons. The image is from \kref{https://commons.wikimedia.org/wiki/File:4_RETAT_04_Linus_Torvalds.jpg}{https://commons.wiki\\media.org/wiki/File:4\_RETAT\_04\_Linus\_Torvalds.jpg} where you can also find a link to the Creative Commons CC BY-SA 3.0 license there, as well.
  91. I'm pushing this to my own git server as I write this. You can find it \href{https://git.kjodle.net/kjodle/the-codex}{here}: \texttt{https://git.kjodle.net/kjodle/the-codex}. New issues will be pushed after they are complete.
  92. You can just skip over all the diversions in here if you want. It's just how my mind works. (And yes, there will be politics in this. \textit{You have been warned.}) Also, I use a lot of em-dashes, parentheses, and footnotes because that is also how my mind works. It's just one big long stream of consciousness up in here most days.
  93. \medskip
  94. \noindent \textbf{Errata:} To err is human, to document those errors is divine. A list of errata can be found at \kref{https://git.kjodle.net/kjodle/the-codex/wiki/Errata}{https://git.kjodle.net/kjodle/the-codex/wiki/Err\\ata}.
  95. \medskip
  96. \noindent \textbf{Credit where credit is due:} A lot of people have come forth (mostly from Reddit) to help me out in various ways. See the preamble to this document in the source code to see them. One aspect of our society is that nobody \textit{has} to help you. It is wonderful when it happens, and I am grateful for their help.
  97. \tableofcontents
  98. \chapter{The Final Salad Days}
  99. \section{College, 2008}
  100. Bush II decided to tank the economy for ordinary people so that rich people could get richer.\footnote{This is the second of three "once in a lifetime" recessions I have lived through. Yay, capitalism!} I decided to go back into teaching (which, thanks to current conservative political policies\footnote{Along with the asshole behavior of parents who approve of those policies.} there will always be a demand for), which meant I needed to go back to college to renew my teaching license. But this is a whole other story for which I have run out of space, so it will have to go in a future issue.
  101. \section{Today}
  102. \chapter{Math in \LaTeX{} with \texttt{align} and \texttt{array}}
  103. \chapter{Searching your Bash History}
  104. https://www.cyberciti.biz/faq/linux-unix-shell-history-search-command/
  105. https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps
  106. https://superuser.com/questions/7414/how-can-i-search-the-bash-history-and-rerun-a-command
  107. https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html\#Bindable-Readline-Commands
  108. https://stackoverflow.com/questions/7131670/make-a-bash-alias-that-takes-a-parameter
  109. https://tecadmin.net/how-to-create-bash-aliases-with-parameters/
  110. \chapter{Other Flavors of Linux}
  111. I admit, I am pretty invested in Ubuntu. But I don't have to be that way. There are \textit{lots} of ways to swim in the Linux pool. Just doing a quick search for ``linux flavors'' yields a lot of options:
  112. \begin{center}
  113. \fbox{\includegraphics[scale=1]{flavours2}}
  114. \end{center}
  115. This also omits Edubuntu which, as a former teacher, I am very interested in.
  116. \chapter{What's to Like About Linux}
  117. \section{bash Aliases for \texttt{git}}
  118. \chapter{The Right Ways vs The Wrong Ways}
  119. A lot of grew up hearing that ``there's a right way to do things and a wrong way to do things.'' I don't disagree that there is always a \textit{wrong} way to do things, but like house maintenance, working on computers quickly teaches you that there are a lot of wrong ways to do things.
  120. Experience has shown me that not all wrong ways are wrong in the same way or to the same degree, and that the same is true of right ways. There may be multiple right ways to get something done, but some require less work and some require more work. It is not just a black-and-white issue.
  121. In the past few years, I've started things less in terms of a particular ``right way'' opposed to a particular ``wrong way'', and started thinking in terms of a spectrum of choices, some of which are obviously wrong (but wrong to varying degrees) and some of which are right because they work, but you have to take different roads to get there.
  122. What I have tried to do here is to create a hierarchy of ``rightness'' and ``wrongness'' as a way to organize my thinking on this subject; I can then jump in and discuss why things fall the way they do. No doubt, other people might have more distinctions or fewer in their hierarchy, or might have things in a separate order, or might have different reasons.
  123. And, as we shall see, sometimes it's beneficial to do something the wrong way.
  124. \newpage % Move this list to a new page.
  125. \begin{itemize}[noitemsep]
  126. \item \textbf{Very Wrong}
  127. \begin{itemize}[noitemsep]
  128. \item It doesn't work and it breaks things in weird places.
  129. \item It doesn't work and it breaks almost everything.
  130. \item It doesn't work but it only breaks a few local things.
  131. \end{itemize}
  132. \item \textbf{Wrong}
  133. \begin{itemize}[noitemsep]
  134. \item It works, but it breaks things in weird places.
  135. \item It works, but it breaks almost everything else.
  136. \item It works, but it still manages to break a few local things.
  137. \end{itemize}
  138. \item \textbf{Wrong\textit{ish}}
  139. \begin{itemize}[noitemsep]
  140. \item It works in this specific instance, but not in all instances.
  141. \item It works, but it's far more work than it should be.
  142. \end{itemize}
  143. \item \textbf{Right\textit{ish}}
  144. \begin{itemize}[noitemsep]
  145. \item It works, but you have no idea why.
  146. \item It works, but it requires you to rework some other pieces.
  147. \item It works, but it's a bit of a kludge.
  148. \end{itemize}
  149. \item \textbf{Right}
  150. \begin{itemize}[noitemsep]
  151. \item It works, and is considered a best practice.
  152. \end{itemize}
  153. \item \textbf{Genius}
  154. \begin{itemize}[noitemsep]
  155. \item It's a true hack.
  156. \end{itemize}
  157. \end{itemize}
  158. \section*{Very Wrong Ways}
  159. Very wrongs ways are very wrong because not only do they not work, they take other things down with them.
  160. \paragraph{It doesn't work and it breaks things in weird places.}
  161. \paragraph{It doesn't work and it breaks almost everything else.}
  162. \paragraph{It doesn't work and it still manages to break a few local things.}
  163. \section*{Wrong Ways}
  164. Wrong ways may work, but they break other things along the way. As we shall see, this is not always a bad thing.
  165. \paragraph{It works, but it breaks things in weird places.}
  166. \paragraph{It works, but it breaks almost everything else.}
  167. \paragraph{It works, but it still manages to break a few local things.} Even though this is listed as a wrong way---you are still breaking things, after all---this is not always a bad outcome to experience. It's possible that those few things that are breaking are breaking because they are weak. If you strengthen those items and then apply this technique, it turns out that this isn't actually wrong after all, it only seemed wrong at the time. In the end, you have a much project that is much less fragile overall.
  168. \section*{Wrong\textit{ish} Ways}
  169. \paragraph{It works in this specific instance, but not in all instances.} It works, so why is this way still wrong? Because it's not \textit{universal} for all situations.
  170. \paragraph{It works, but it's far more work than it should be.}
  171. \section*{Right\textit{ish} Ways}
  172. \paragraph{It works, but you have no idea why.} I was very tempted to put this in the wrong\textit{ish} section, and in some cases it may certainly belong there. Quite frankly, you should know why a technique works. Not knowing why can be dangerous, because you assume too much about this particular technique. That may cause you to be a bit overconfident with it, and use it in a situation that doesn't really warrant its use.
  173. \paragraph{It works, but it requires you to rework some other parts of the project.}
  174. \paragraph{It works, but it's a bit of a kludge.} A kludge is not always a bad thing (sometimes you have to work with what you have) but they are at best, inelegant, and at worst weighty and ugly. But they work for now, they don't break things, and they will last until you learn or can afford a better way.
  175. \section*{Right Ways}
  176. \paragraph{It works, and is considered a best practice.}
  177. \section*{Genius Ways}
  178. \paragraph{It's a true hack.}
  179. \chapter{A \texttt{git} Workflow}
  180. \chapter{More about those folders in \texttt{root}}
  181. \chapter{Coda}
  182. \section{What I Learned About \LaTeX{} While Creating This Issue}
  183. \subsection{Page Count using \texttt{detex}}
  184. \subsection{How to Create Macros}
  185. \section{What I learned About \LaTeX{} While Creating Something Else}
  186. \end{document}