diff --git a/HS23_ConsoleToolkit/main.pdf b/HS23_ConsoleToolkit/main.pdf index da9a70c2f4a688563bd86d0410ff57e3206e189e..b9a6f69346247fae31099839ae5028804f0bff82 100644 Binary files a/HS23_ConsoleToolkit/main.pdf and b/HS23_ConsoleToolkit/main.pdf differ diff --git a/HS23_ConsoleToolkit/main.tex b/HS23_ConsoleToolkit/main.tex index b90ecaef5e2dbb5eaa4ae83e311b9cc58e32a08f..2aa8084496d1050428e25b84532d625364af79a8 100644 --- a/HS23_ConsoleToolkit/main.tex +++ b/HS23_ConsoleToolkit/main.tex @@ -32,9 +32,9 @@ } \title{The Console Toolkit} -\author{Jean-Claude Graf} +\author{Caspar Gutsche} \institute{TheAlternative, ETH Zürich} -\date{11. October 2023} +\date{10. April 2024} \begin{document} \begin{frame} @@ -110,7 +110,7 @@ \begin{itemize} \item Files \item Directories (or ``folders'') - \item Storage devices + \item Storage devices \texttt{} \item Keyboards \end{itemize} \column{0.5\textwidth} @@ -331,7 +331,7 @@ drwxr-xr-x 2 alice alice 4.0K Sep 3 23:27 Downloads \begin{frame}[t,fragile]{Getting Help} \begin{itemize} \item Where can I find out what options are available? - \item Two Ways: + \item Three Ways: \begin{itemize} \item \verb+--help+ option \begin{itemize} @@ -341,6 +341,10 @@ drwxr-xr-x 2 alice alice 4.0K Sep 3 23:27 Downloads \begin{itemize} \item E.g. \verb+man ls+ \end{itemize} + \item Too Long; Didn't Read + \begin{itemize} + \item Eg. \verb+tldr ls+ + \end{itemize} \end{itemize} \item (Bonus) Shell Completion \end{itemize} @@ -626,7 +630,7 @@ lrwxrwxrwx 1 root root 7 Dec 7 03:41 lib -> usr/lib \begin{frame}[t,fragile]{Changing permissions} \begin{itemize} - \item Change permission: \verb$chmod {u,g,a}{+,-}{r,w,x} file$ + \item Change permission: \verb$chmod {u,g,o,a}{+,-}{r,w,x} file$ \item Change user/group: \verb$chown OWNER:GROUP file$ \end{itemize} \SU{alice} @@ -638,24 +642,24 @@ chown alice:alice file.txt \end{shell} \end{frame} - \begin{frame}[t,fragile]{Octal Permissions} - \begin{itemize} - \item Change permission: \verb+chmod OCTALMODE file+ - \begin{itemize} - \item \texttt{4: read} - \item \texttt{2: write} - \item \texttt{1: execute} - \end{itemize} - \item Octal representation allows setting all permissions in one go - \item Desired permissions are added up - \iexa{} \texttt{7 = read + write + execute} - \end{itemize} - \SU{bob} - \begin{shell} -chmod 776 program.sh -chmod 774 program.sh - \end{shell} - \end{frame} +% \begin{frame}[t,fragile]{Octal Permissions} +% \begin{itemize} +% \item Change permission: \verb+chmod OCTALMODE file+ +% \begin{itemize} +% \item \texttt{4: read} +% \item \texttt{2: write} +% \item \texttt{1: execute} +% \end{itemize} +% \item Octal representation allows setting all permissions in one go +% \item Desired permissions are added up +% \iexa{} \texttt{7 = read + write + execute} +% \end{itemize} +% \SU{bob} +% \begin{shell} +% chmod 776 program.sh +% chmod 774 program.sh +% \end{shell} +% \end{frame} \section{Efficiency} @@ -674,6 +678,7 @@ chmod 774 program.sh \begin{itemize} \item Scroll up in your command history by pressing the \keys{\arrowkeyup} key \item Press \keys{\ctrl} + \keys{r} to search the history + \item \verb+history <n>+ lets you look at the last n entries of the history (-n) in zsh \end{itemize} \end{frame} @@ -707,6 +712,11 @@ rm {*.doc,*.docx} \begin{itemize} \item Run next command iff current succeeds: \texttt{\&\&} \item Run next command in any case: \texttt{;} + \item Run in Background \texttt{\&} + \begin{itemize} + \item To run any process in background use \keys{CTRL} + \keys{z} + \item to get it back into forground use \texttt{fg} + \end{itemize} \item Pass stdout to stdin: \texttt{|} \begin{itemize} \item More on that later @@ -1103,6 +1113,18 @@ sudo dnf update \end{columns} \end{frame} + \begin{frame}[t,fragile]{Uninstalling Packages} + Debian, Ubuntu + \begin{shellcomp} + sudp apt purge + \end{shellcomp} + Arch + \begin{shellcomp} + sudo pacman -Rsn + \end{shellcomp} + + \end{frame} + \begin{frame}[t,fragile]{Building From Source} \begin{itemize} \item Sometimes software is unavailable in the repositories @@ -1204,16 +1226,6 @@ git push \end{columns} \end{frame} - \begin{frame}[t,fragile]{Sharing a Repository} - \begin{itemize} - \item You can use services like \emph{Github} or \emph{Gitlab} to collaborate with others on your project - \item Or host your repositories yourself! - \begin{itemize} - \item You can pull from/push to any server you can access via SSH - \end{itemize} - \end{itemize} - \end{frame} - \section{Backup} \begin{frame}[t,fragile]{Backup} \begin{itemize} @@ -1281,6 +1293,7 @@ rsync_tmbackup.sh ~/ alice@homeserver:~/Backup/ ~/rsync_exclude_list \item \verb+du -d 1 -h+ \item \verb_for f in *.md; do echo pandoc -o $(basename $f .md).pdf $f; done_ \item \verb+find -type l -iname "*.cr3" | wc -l+ + \item \verb+convert <input.jpg> -define jpeg:extent=512kb newimage.jpg+ \end{itemize} \end{frame} % \begin{frame}[t,fragile]