280 lines
18 KiB
TeX
280 lines
18 KiB
TeX
\documentclass[twoside]{report}
|
|
\usepackage[utf8]{inputenc}
|
|
\usepackage{amsmath}
|
|
\usepackage{amssymb}
|
|
\usepackage{makeidx}
|
|
%\makeindex
|
|
\usepackage{graphicx}
|
|
\usepackage{kpfonts}
|
|
\usepackage{float}
|
|
\raggedbottom
|
|
|
|
% Where are our images?
|
|
\graphicspath{{images/}}
|
|
|
|
% Let's set this as a half-letter sized sheet
|
|
% https://tex.stackexchange.com/questions/338789/how-to-set-paper-size-to-half-letter-5-5-x-8-5-in-in-amsbook
|
|
\usepackage{geometry}
|
|
\geometry{
|
|
paperheight=8.5in,
|
|
paperwidth=5.5in,
|
|
% heightrounded,
|
|
margin=0.5in
|
|
}
|
|
|
|
% Adjust the top and bottom margins
|
|
% http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3907057
|
|
\addtolength{\topmargin}{0.4in}
|
|
\addtolength{\textheight}{-0.75in}
|
|
|
|
% Set the header style
|
|
% https://www.overleaf.com/learn/latex/Headers_and_footers
|
|
\usepackage{fancyhdr}
|
|
\pagestyle{fancy}
|
|
\fancyhf{}
|
|
\fancyhead[LE,RO]{\textit{the codex} -- Advanced Reading Copy}
|
|
\fancyhead[RE,LO]{Issue \#002}
|
|
\cfoot{Page \thepage}
|
|
\renewcommand{\footrulewidth}{0.5pt}
|
|
|
|
% Include sections and subsections in the TOC
|
|
% https://latex-tutorial.com/tutorials/table-of-contents/
|
|
% \setcounter{tocdepth}{2}
|
|
|
|
% We will probably want some 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}
|
|
|
|
% 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}
|
|
|
|
% Use tab stops when we need to (especially in footnotes)
|
|
\usepackage{tabto}
|
|
% Define 18 tab stops (at 1/4" intervals)
|
|
\NumTabs{18}
|
|
|
|
% Use strikethrough
|
|
\usepackage{ulem}
|
|
|
|
% Style a blockquote
|
|
% See https://tex.stackexchange.com/questions/325695/how-to-style-blockquote
|
|
\usepackage{etoolbox}
|
|
\usepackage{setspace} % for \onehalfspacing and \singlespacing macros
|
|
% See also https://www.overleaf.com/learn/latex/Typesetting_quotations
|
|
|
|
% Make things neater. Thanks /u/-LeopardShark-
|
|
%\usepackage{microtype}
|
|
|
|
\author{Kenneth John Odle}
|
|
\title{
|
|
{\Huge the codex} \\
|
|
{\footnotesize Life with Linux — A Zine \\
|
|
\bigskip
|
|
Typeset in \LaTeX{} \\
|
|
Issue \#002}
|
|
}
|
|
\date{\begin{small}2021.10.01\end{small}}
|
|
|
|
\begin{document}
|
|
\maketitle
|
|
|
|
\section*{Impressum}
|
|
All contents \copyright2021 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. You don't need to, however, since 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/}{https://creativecommons.org/licenses/by-nc-sa/4.0/}. \includegraphics[scale=0.35]{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 (\href{https://pdfbooklet.sourceforge.io/wordpress/}{\texttt{https://pdfbooklet.sourceforge.io/wordp \\ ress/}}).
|
|
|
|
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.
|
|
|
|
\tableofcontents
|
|
|
|
\chapter{The Later Salad Days}
|
|
Boring, early life stuff when my world smelled like sweat and disinfectant and room temperature bologna. Feel free to skip this. I wish I could.
|
|
|
|
\section{The Joy of Commodore 64}
|
|
|
|
\section{High School Computer Class}
|
|
|
|
\chapter{A Scanner Clearly, or More Thoughts on Being an Archivist}
|
|
|
|
In the first issue of this zine, I wrote about a basic workflow for archiving books through scanning them into pdf files. While I covered about everything I wanted to cover on the computer end of things, I barely talked at all about the physical labor that goes into scanning this book. For those who are interested, here's what happens behind the scenes before you even get to the computer.
|
|
|
|
\section{The Non-Computer Stuff}
|
|
|
|
First, you have to cut the book apart, and then separate the pages from the bindings. Older books are generally signature bound, and so it's simply a matter of cutting the backing off the signatures, cutting any strings holding them together, and then separating the signatures. This sounds easy, but it's a lot of work. If the book is perfect bound (i.e., individual pages are glued together, rather than signatures), it's just a matter of separating the pages very carefully a few pages at a time.
|
|
|
|
Second, you then have to trim the bound edges, so that the pages are separate. Perfectly bound books tend to have glue creeping up between each page, whereas signature bound books tend to have glue only creeping up between the signatures. I have paper trimmer that allows me to clamp the pages down so that they don't move as I cut them, and I highly recommend this. It also has a measured grid to the left, so that I can ensure I'm cutting all the pages to the same width. (\textbf{Protip:} Put a piece of painter's tape on the grid to make this even easier.)
|
|
|
|
After that, separate your pages into groups that you will scan. This should be however many sheets your scanner can handle easily at one time, and will depend largely on the kind of paper the book was printed on. I generally find ten sheets work well, and make it easier for me to count. Smaller groups means more work up front, but it also means that it is easier to fix things when (not \textit{if}) something goes wrong.
|
|
|
|
\begin{wrapfigure}[]{R}{0.6\textwidth}
|
|
% \raisebox{0pt}[\dimexpr\height-1\baselineskip\relax]{\includegraphics[scale=0.4]{number_your_sections}}
|
|
\vspace{-\intextsep}
|
|
\includegraphics[scale=0.45]{number_your_sections}
|
|
\end{wrapfigure}
|
|
|
|
Number all of your groups with the filename they will eventually have. I use a pencil and mark this lightly (or not so lightly, depending on the day) in the lower right corner of the first page:
|
|
|
|
This is all about workflow for me. Since my scanner (a Brother MFC-J8050DW) scans whatever is facing \textit{down} in the document feeder, after I scan the first side, I should see odd numbers facing up in the ADF. I then know that I need to scan the side that is now facing down, which means that I don't turn them over, I just rotate them 180\textdegree{} in the \textit{xy}-plane.
|
|
|
|
Most books have unnumbered pages. This should go without saying, but it's one of those things that you don't think about until after it becomes an issue: \textit{number all the blank pages:}
|
|
|
|
\begin{center}
|
|
\includegraphics[scale=0.5]{number_blank_pages}
|
|
\end{center}
|
|
|
|
Once you do all of this, you're ready to scan. You should have a pile of stuff that looks something like this:
|
|
|
|
\begin{center}
|
|
\includegraphics[scale=0.4]{ready_to_scan}
|
|
\end{center}
|
|
|
|
As it turns out, if you have a couple of pages that bleed to the middle\footnote{Generally because of a photograph or illustration that continues across both the left and right pages.}, you can pretend that they don't and simply trim those pages the same size as all your other pages. Or, if you want to preserve that bleed, you'll have to remove those sheets \textit{before} you trim the edges, and separate them very carefully down the middle. If you are lucky, they are in the middle of a signature, and you can separate them with a sharp knife. If you are not lucky, they will be somewhere else, and may have glue holding them together, meaning you have to very carefully prise them apart. No matter how carefully you do this, you will inevitably lose some data.
|
|
|
|
You will end up with two sheets (i.e., four pages) that are a different size, and which will need to be scanned separately. In which case, it's good to use a cheat sheet to keep track of which groups are which sizes and how many pages are contained in each. I like to just jot this down on an index card, but if the book you are scanning is complex, you'll need a bigger sheet of paper.
|
|
|
|
\begin{center}
|
|
\includegraphics[scale=0.4]{cheat_sheet}
|
|
\end{center}
|
|
|
|
\section{What Does This Have to do With Linux?}
|
|
|
|
You may be wondering why I am spending so much time talking about using scissors and pencils and rulers when this is a zine about Linux. Sure, this is what I need to do to get ready to scan and put all those scans together using the command line application \texttt{pdftk}, but what is the point here?
|
|
|
|
If you recall back in the first issue, I said that doing things on the command line makes you think about \textit{outcomes}. Thinking about outcomes doesn't matter just on the computer. Like I said earlier, there is no ``undo'' button in real life.\footnote{Although I sometimes think that lawyers are just rich people's undo buttons.} Once you've cut something apart, there's no putting it back together. You \textit{have} to think about what you want the next step of the process to be so that you don't do something in this step that makes the next step difficult or even impossible. You have to think ahead about what you want to end up with.
|
|
|
|
I sometimes think that a GUI is like the menu at the McDonald's drive through.\footnote{It's no wonder that the menu in a GUI is called a menu, when you think about it.} If you are lucky, you are behind the person that knows what they want. They planned ahead. They thought about the outcome they wanted (full stomach, happy taste buds) and chose something ahead of time that would get them to that outcome. But a lot of people (too many people, in my opinion\footnote{Just one of many reasons I don't eat fast food any more.} get up to that order screen and \textit{that's} when they decide to start thinking about outcomes. They are so used to seeing a menu in front of them that they can't even begin making a decision without seeing it.
|
|
|
|
And let's face it: the menu at McDonald's has not really changed in years. Yes, they have new things, but they also advertise the hell out of them when they do. How can you \textit{not} know about their new menu item if you watch more than 30 minutes of television a day? But again, a GUI does not encourage you to think. The command line does. And let's face it: most people just don't like to think. They like the \textit{illusion} of choice, and that is what substitutes for thinking most of the time. ``What are you getting at McDonald's?'' is too often followed by ``I don't know; I'll think about it when we get there.''
|
|
|
|
Of course, if you are thinking about outcomes, chances are you don't eat fast food very often anyway, because the long term outcomes are obesity, heart disease, and hypertension. But damn, those fries are good!
|
|
|
|
\section{A GUI Solution}
|
|
|
|
For what it's worth, there is a GUI for \texttt{pdftk}. It's called PDF Chain and you can find it at \href{https://pdfchain.sourceforge.io/}{\texttt{https://pdfchain.sourceforge.io/}}.
|
|
|
|
Despite all my prattling on about the many advantages the command line has for your brain, I'm not opposed to using a GUI, actually. (I mean, I have Ubuntu installed on two machines and Kubuntu on a third.) A GUI does make life easier in many ways, and what I like about one in a case like this is that if you're someone who has to manipulate pdf files rarely or only once, it's probably easier to just use a GUI than it is to learn the command line. Efficiency plays a role here, as well. If I'm going to use this all the time, it's definitely more efficient for me to learn the command line approach. But once or twice a year? Or only once? A GUI is much more efficient.
|
|
|
|
\begin{center}
|
|
\includegraphics[scale=0.4]{pdfchain_-_title}
|
|
\end{center}
|
|
|
|
\chapter{Make Life Easier with bash Aliases}
|
|
|
|
I'm not going to get into the difference between the command line, the terminal, and bash (the Bourne Again Shell, if you are interested\footnote{You may not be, but after all, you are reading \textit{this} so you very well may be. I'll talk about that in a future issue.}) For now, let's just assume that you know about \texttt{ctrl alt t} opening a terminal window to get you access to the command line.
|
|
|
|
If you are used to using the command line, chances are that you have a certain set of commands that you use a lot. For example, if you're pushing to your Github repos all the time, you probably are typing \verb=git push origin main= quite often. You can create a bash alias that makes your life a lot easier.
|
|
|
|
Chances are, you will open the terminal in the root of your \texttt{Home} directory. You can tell by typing
|
|
|
|
\begin{verbatim}
|
|
$ pwd
|
|
\end{verbatim}
|
|
|
|
\texttt{pwd} stands for ``Print Working Directory'' and shows you where you are. If you're in the home directory, you'll get something that looks like this:
|
|
|
|
\begin{verbatim}
|
|
/home/username
|
|
\end{verbatim}
|
|
|
|
\noindent{}where ``\texttt{username}'' is your login name. If you're \textit{not} in your home directory, you can get there with this command:
|
|
|
|
\begin{verbatim}
|
|
$ cd ~
|
|
\end{verbatim}
|
|
|
|
\noindent{}The \verb|~| is shorthand for your home directory. We are looking for an invisible file, so execute this command:
|
|
|
|
\begin{verbatim}
|
|
$ ls -a
|
|
\end{verbatim}
|
|
|
|
\noindent{}The \texttt{ls} command will list visible files, the \texttt{-a} option shows all files, including the invisible ones.
|
|
|
|
We are looking for a file called \texttt{.bashrc}. If you have a lot of stuff installed, you may have to scroll around to find it. Once you find it, open it in a text editor. This is in your home directory, so you can use whatever text editor you want and no \texttt{sudo} privileges should be required.
|
|
|
|
If you want, scroll through it. There is some interesting stuff there. But we want to create aliases, so go to the end, and type
|
|
|
|
\begin{verbatim}
|
|
# my aliases
|
|
\end{verbatim}
|
|
|
|
\noindent{}The \verb=#= means that this line is a comment. We'll add our aliases beneath this line.\footnote{Let's stop and reflect for a moment on how important it is to add comments to whatever we work on. When you come back to this file in six months or two years and ask yourself ``Why is this here? Who wrote this?'' your comment will tell you. I often find it handy to include the date as well, and any url where I found something useful. Check the source code of the preamble to this document for examples.}
|
|
|
|
Let's use our Github example. Add the following line:
|
|
|
|
\begin{verbatim}
|
|
alias gpush="git push origin main"
|
|
\end{verbatim}
|
|
|
|
\noindent{}Save the file, and then go to one of your git repos, make some changes, and commit them. Then, when you want to push the changes to the remote repository, instead of typing \texttt{git push origin main} just type \texttt{gpush}. Your terminal will do the rest for you.
|
|
|
|
You can also execute bash scripts as well. In addition to a local backup on an external drive, I also backup the directories in my home drive to a remote storage location. To make life easy, I created a script (called, naturally, \texttt{backup.sh}) in each of those directories to back them up. To execute those backup scripts, I just need to go to that directory, open the directory in a terminal and type \texttt{./backup.sh}.
|
|
|
|
The problem here is that a lot of times, I'm not even in those directories when I'm saving files to them. I'm somewhere else. And to open the directory in my GUI and then open it in a terminal, or to open a terminal and then navigate to that directory, is a little \textit{too} much when I want to run that backup script. Remember, you want to back up soon, and you want to back up often. Backing up on that basis is a good habit to have. So let's remove as many obstacles to that habit as possible. In this case, we'll add an alias to run those backup scripts.
|
|
|
|
This is what I have in my \texttt{.bashrc} aliases:
|
|
|
|
\begin{verbatim}
|
|
alias kdoc="bash $HOME/Documents/backup.sh"
|
|
alias kdow="bash $HOME/Downloads/backup.sh"
|
|
alias kpic="bash $HOME/Pictures/backup.sh"
|
|
alias krec="bash $HOME/Recordings/backup.sh"
|
|
alias ktem="bash $HOME/Templates/backup.sh"
|
|
alias kvid="bash $HOME/Videos/backup.sh"
|
|
\end{verbatim}
|
|
|
|
Let's look at the first one. \texttt{kdoc} is the name of the alias. Since my first name is Ken, I prefix these with the letter \texttt{k} so I don't get them mixed up with something else. \texttt{bash} means to run this as a bash script. \texttt{\$HOME/Documents/backup.sh} means ``go to the home directory, then go to the Documents directory, and run this script called \texttt{backup.sh}''.
|
|
|
|
We can do other things as well. Log into your webhost via ssh a lot? Try this one:
|
|
|
|
\begin{verbatim}
|
|
alias kssh="ssh username@webhost.com"
|
|
\end{verbatim}
|
|
|
|
\noindent{}Type this, and it will ask for your password. You've now typed four characters instead of 24.
|
|
|
|
This is probably my favorite, though:
|
|
|
|
\begin{verbatim}
|
|
alias kls="ls -Ahl"
|
|
\end{verbatim}
|
|
|
|
\noindent{}This gives us a directory listing, but with this flags:
|
|
|
|
\begin{itemize}
|
|
\itemsep-0.4em
|
|
\item \texttt{A} lists all files and directories, including invisible ones (but excluding the . and .. directories).
|
|
\item \texttt{h} gives us file sizes in human readable sizes (i.e., ``4.0K'') instead of bytes.
|
|
\item \texttt{l} gives us the listing as a list, because I find that's more readable, especially with a directory that contains a lot of stuff.
|
|
\end{itemize}
|
|
|
|
And that's it. Just about anything you type often on the command line can be turned into a bash alias to save you time.
|
|
|
|
\chapter{What Have I Installed?}
|
|
|
|
\chapter{What's to Like About Linux?}
|
|
|
|
I have an app on my phone called ``The Stoic'' that shows quotations from various Stoic philosophers. As I was working on this issue, this popped up:
|
|
|
|
\AtBeginEnvironment{quote}{\singlespacing\small}
|
|
|
|
\begin{quote}
|
|
Because a thing seems difficult for you, do not think it impossible for anyone to accomplish.
|
|
|
|
\begin{flushright}
|
|
---\textbf{Marcus Aurelius}
|
|
\end{flushright}
|
|
\end{quote}
|
|
|
|
|
|
\end{document} |