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

\documentclass[twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{kpfonts}
\usepackage{float}
\raggedbottom
\usepackage{array}
\usepackage{multirow}
% Where are our images?
\graphicspath{{images/}}
% Let's set this as a half-letter sized sheet
\usepackage{geometry}
\geometry{
paperheight=8.5in,
paperwidth=5.5in,
% heightrounded,
margin=0.5in
}
% Adjust the top and bottom margins
\addtolength{\topmargin}{0.4in}
\addtolength{\textheight}{-0.75in}
% Set the header style
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\textit{the codex}}
\fancyhead[RE,LO]{Issue \#003}
\cfoot{Page \thepage}
\renewcommand{\footrulewidth}{0.5pt}
% Includ two- or three-column sections
\usepackage{multicol}
% Stop resetting the footnote count after each chapter
\counterwithout{footnote}{chapter}
% Let's wrap some images
\usepackage{wrapfig}
% Use tab stops when we need to (especially in footnotes)
\usepackage{tabto}
% Define 18 tab stops (at 1/4" intervals)
\NumTabs{18}
% Make things neater. Thanks /u/-LeopardShark-
\usepackage{microtype}
% Make a nice border and box for the tops of our examples
\newcommand\klab[3]{\vspace{#1}\noindent{}\hrulefill\fbox{\texttt{~#2~}}\hrulefill\vspace{#3}}
% Add an \hrule with space above and below
\newcommand\krule[2]{\vspace{#1}\hrule\vspace{#2}}
% Make hrefs easier (must load package hyperref}
\newcommand\kref[2]{\href{#1}{{\texttt{#2}}}}
% Rotate text in tables easier
% https://tex.stackexchange.com/questions/89115/how-to-rotate-text-in-multirow-table
\newcommand\krot[3]{\parbox[t]{#1}{\multirow{#2}{*}{\rotatebox[origin=c]{90}{#3}}}}
% Use line numbers with code samples
% \begin{Verbatim}...\end{Verbatim} <-- Note the capitalization!
\usepackage{fancyvrb}
% Break lines inside this environment:
\usepackage{fvextra}
% Control spacing in lists
\usepackage{enumitem}
% Don't force text to fill page
\raggedbottom
% Better control over line-spacing
\usepackage{setspace}
% Use nice fractions
\usepackage{nicefrac}
% Keep the footnotes at the bottom of the page
\usepackage[bottom]{footmisc}
% Do we want to include URLs?
% Yes, but we also want to hide the big red box it puts around them in the pdf. Thanks /u/0b0101011001001011
\usepackage[hidelinks]{hyperref}
%%%% Document Information %%%%%
\author{Kenneth John Odle}
\title{
{\Huge the codex} \\
{\footnotesize Life with Linux — A Zine \\
\bigskip
Typeset in \LaTeX{} \\
Issue \#004}
}
\date{\begin{small}\today{}\end{small}}
% Change the name of the TOC
\renewcommand*\contentsname{In This Issue…}
\begin{document}
\maketitle
\section*{Impressum}
All contents \copyright2023 Kenneth John Odle
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}
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/}).
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.
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.
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.
\medskip
\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}.
\medskip
\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.
\tableofcontents
\chapter{The Final Salad Days}
\section{College, 2008}
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.
\section{Today}
\chapter{Math in \LaTeX{} with \texttt{align} and \texttt{array}}
\chapter{Searching your Bash History}
https://www.cyberciti.biz/faq/linux-unix-shell-history-search-command/
https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps
https://superuser.com/questions/7414/how-can-i-search-the-bash-history-and-rerun-a-command
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html\#Bindable-Readline-Commands
https://stackoverflow.com/questions/7131670/make-a-bash-alias-that-takes-a-parameter
https://tecadmin.net/how-to-create-bash-aliases-with-parameters/
\chapter{Other Flavors of Linux}
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:
\begin{center}
\fbox{\includegraphics[scale=1]{flavours2}}
\end{center}
This also omits Edubuntu which, as a former teacher, I am very interested in.
\chapter{What's to Like About Linux}
\section{bash Aliases for \texttt{git}}
\chapter{The Right Ways vs The Wrong Ways}
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.
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.
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.
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.
And, as we shall see, sometimes it's beneficial to do something the wrong way.
\newpage % Move this list to a new page.
\begin{itemize}[noitemsep]
\item \textbf{Very Wrong}
\begin{itemize}[noitemsep]
\item It doesn't work and it breaks things in weird places.
\item It doesn't work and it breaks almost everything.
\item It doesn't work but it only breaks a few local things.
\end{itemize}
\item \textbf{Wrong}
\begin{itemize}[noitemsep]
\item It works, but it breaks things in weird places.
\item It works, but it breaks almost everything else.
\item It works, but it still manages to break a few local things.
\end{itemize}
\item \textbf{Wrong\textit{ish}}
\begin{itemize}[noitemsep]
\item It works in this specific instance, but not in all instances.
\item It works, but it's far more work than it should be.
\end{itemize}
\item \textbf{Right\textit{ish}}
\begin{itemize}[noitemsep]
\item It works, but you have no idea why.
\item It works, but it requires you to rework some other pieces.
\item It works, but it's a bit of a kludge.
\end{itemize}
\item \textbf{Right}
\begin{itemize}[noitemsep]
\item It works, and is considered a best practice.
\end{itemize}
\item \textbf{Genius}
\begin{itemize}[noitemsep]
\item It's a true hack.
\end{itemize}
\end{itemize}
\section*{Very Wrong Ways}
Very wrongs ways are very wrong because not only do they not work, they take other things down with them.
\paragraph{It doesn't work and it breaks things in weird places.}
\paragraph{It doesn't work and it breaks almost everything else.}
\paragraph{It doesn't work and it still manages to break a few local things.}
\section*{Wrong Ways}
Wrong ways may work, but they break other things along the way. As we shall see, this is not always a bad thing.
\paragraph{It works, but it breaks things in weird places.}
\paragraph{It works, but it breaks almost everything else.}
\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.
\section*{Wrong\textit{ish} Ways}
\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.
\paragraph{It works, but it's far more work than it should be.}
\section*{Right\textit{ish} Ways}
\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.
\paragraph{It works, but it requires you to rework some other parts of the project.}
\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.
\section*{Right Ways}
\paragraph{It works, and is considered a best practice.}
\section*{Genius Ways}
\paragraph{It's a true hack.}
\chapter{A \texttt{git} Workflow}
\chapter{More about those folders in \texttt{root}}
\chapter{Coda}
\section{What I Learned About \LaTeX{} While Creating This Issue}
\subsection{Page Count using \texttt{detex}}
\subsection{How to Create Macros}
\section{What I learned About \LaTeX{} While Creating Something Else}
\end{document}