Skip to content

Commit b0e029b

Browse files
committed
Updates elsewhere.
1 parent 1e0022d commit b0e029b

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

presentation/linux_bash_metacentrum_course.tex

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ \subsection{Choose one}
470470
\begin{itemize}
471471
\item If you can use whole disk, just boot from CD/USB and click \enquote{Next}\ldots
472472
\item If you don't have whole disk, you need at least one (commonly more) disk partition(s) --- if you don't know how to manage them, ask someone skilled\ldots
473-
\item Major updates of Windows 10 or Windows reinstall use to destroy bootloader and it is not possible to start Linux anymore (although it can be usually easily fixed)
473+
\item Major updates of Windows 10/11 or Windows reinstall use to destroy bootloader and it is not possible to start Linux anymore (although it can be usually easily fixed)
474474
\end{itemize}
475475
\item Live CD/USB
476476
\begin{itemize}
@@ -561,7 +561,7 @@ \subsection{Disks and file systems}
561561
exFAT & 255 & ? & No limit defined & 16 EiB & 64 ZiB & Any\\
562562
NTFS & 255 & Variable & Variable & 16 TiB & 16 EiB & Windows (UN*X)\\
563563
HFS+ & 255 & Unicode & Unlimited & 8 EiB & 8 EiB & macOS\\
564-
ext4 & 255 & Any, not / & No limit defined & 16 TiB & 1 EiB & Linux (UN*X)\\
564+
ext4 & 255 & Any, not \texttt{/} & No limit defined & 16 TiB & 1 EiB & Linux (UN*X)\\
565565
XFS & 255 & Any & No limit defined & 9 EiB & 9 EiB & Linux (UN*X)\\
566566
Btrfs & 255 & Any & No limit defined & 16 EiB & 16 EiB & Linux (only?)\\
567567
ZFS & 255 & Unicode & No limit defined & 16 EiB & 256 ZiB & UN*X
@@ -572,7 +572,7 @@ \subsection{Disks and file systems}
572572
\item FAT32 (including extensions) is old-fashioned and not reliable FS, but still common in various flash disks and memory cards
573573
\item NTFS (basic Windows FS) and FAT do not support UNIX permissions, so they can't be used as system partition in Linux; see also \href{https://en.wikipedia.org/wiki/Comparison_of_file_systems}{full comparison}
574574
\item Btrfs, ext4, XFS and ZFS are not accessible from Windows at all (Linux mainly uses ext4)
575-
\item Btrfs, XFS and ZFS are the most advanced FS in common use
575+
\item Btrfs and ZFS are the most advanced FS in common use
576576
\end{itemize}
577577
\end{frame}
578578

@@ -995,7 +995,7 @@ \subsection{Permissions}
995995
\item \alert{When in use, \enquote{basic} tools listing permissions (e.g. \texttt{ls -l}, ACL in use is marked by \texttt{+} after permissions --- next slide) sometimes do not show correct result and permissions may work unexpectedly}
996996
\item Important especially in network environment with many users
997997
\item If intensively used, \texttt{ls -l} sometimes doesn't show correct permissions (see next slide), it can be confusing and lead into various issues
998-
\item If not in use on server (like e.g. on CESNET data storage in Ostrava, \texttt{du4.cesnet.cz}), relatively high number of groups is required to be able to correctly setup sharing permissions
998+
\item If not in use on a~server, relatively high number of groups is required to be able to correctly setup sharing permissions
999999
\item MetaCentrum has storages and clusters connected via NFSv4 protocol (see also slide~\ref{netfs}) --- commands \texttt{getfacl} and \texttt{setfacl} do not work there, use \texttt{nfs4\_getfacl}, \texttt{nfs4\_setfacl} and \texttt{nfs4\_editfacl} instead (usage is very similar), see also \href{https://wiki.metacentrum.cz/wiki/Access_Control_Lists_on_NFSv4}{old MetaCentrum wiki}
10001000
\item Permissions (\enquote{classical} as well as ACL) require some time to practice and master it\ldots
10011001
\end{itemize}
@@ -1342,7 +1342,7 @@ \subsection{BASH}
13421342
\item \texttt{$\sim$/.bash\_profile} --- Used specifically (not in every system) when user is using remote connection (e.g. SSH) --- user can have different settings for local and remote work
13431343
\item \texttt{/etc/profile} --- System wide profile file --- can be overridden by user's configuration
13441344
\item \texttt{$\sim$/.profile} --- Settings loaded when user logs-in (mainly for language settings), sometimes used by remote connections
1345-
\item \alert{Note:} BASH scripts are non-interactive shells --- they do not read settings above --- there are no aliases etc., but they inherit some settings (PATH, language,~\ldots) and they can read global (not local) variables
1345+
\item \alert{Note:} BASH \textbf{scripts} are non-interactive shells --- they do not read settings above --- there are no aliases etc., but they inherit some settings (PATH, language,~\ldots) and they can read global (not local) variables
13461346
\end{itemize}
13471347
\end{frame}
13481348

@@ -1490,7 +1490,7 @@ \subsection{Directories}
14901490
\item Create other directory, see it and then remove (\texttt{rmdir}).
14911491
\item Can you access directories of another users? Why? If yes, what are your permissions there? Explain it.
14921492
\item What are some permissions in \texttt{/}? Why?
1493-
\item Define some alias (by running \texttt{alias} command, not by edit of \texttt{$\sim$/.bashrc}) and use it.
1493+
\item Define some alias (by running \texttt{alias} command, or edit \texttt{$\sim$/.bashrc} and reload it) and use them.
14941494
\item Create directory in your home directory and share it with another user so she/he can write there anything (using e.g. \texttt{touch somefile} or \texttt{mkdir somedirectory}) (work e.g. in pairs). Use everywhere as restricted permissions as possible. Can you figure out solution with or without ACL (slide~\ref{acl})?
14951495
\item Practice moving between \texttt{/srv/scripts\_data} and your home directory. Use \texttt{cd} and \texttt{TAB}.
14961496
\item Within \texttt{/srv/scripts\_data} list by single command only \texttt{jpg} and \texttt{txt} files.
@@ -1584,7 +1584,7 @@ \subsection{Searching}
15841584
\begin{itemize}
15851585
\item All following arguments are argument of the command until \enquote{\texttt{;}} is encountered
15861586
\item \texttt{'\{\}'} is replaced by the current file name being processed
1587-
\item Those constructs might require protection by escape (\enquote{\textbackslash}) or quotes not to be expanded by shell
1587+
\item Those constructs might require protection by escape (\enquote{\texttt{\textbackslash}}) or quotes not to be expanded by shell
15881588
\end{itemize}
15891589
\end{itemize}
15901590
\end{frame}
@@ -2230,7 +2230,7 @@ \subsection{Network}
22302230
\item SAMBA --- UNIX connection to Microsoft network shares (port 5445), slide~\ref{netfs}
22312231
\item web --- \enquote{The Internet} for most of users (port 80 or encrypted 443)
22322232
\item IMAP (port 143 or 993) and SMTP (port 25 or 465) to connect to e-mail server and send mails
2233-
\item Messaging protocols like XMPP (Jabber and derived services like Google Talk or Facebook Messenger), IRC, ICQ, Skype,~\ldots
2233+
\item Messaging protocols like XMPP (Jabber), IRC, ICQ, MS Teams, Slack, Skype,~\ldots
22342234
\item Databases (if accessible over the Internet), and another special services, use to be available on dedicated ports
22352235
\item And much more (see \texttt{/etc/services})\ldots
22362236
\item Port number can be changed in configuration of respective server service
@@ -2784,8 +2784,8 @@ \subsection{Extractions}
27842784
27852785
\begin{frame}[fragile]{Examples of usage of head, grep and cut with our data II}
27862786
\begin{bashcode}
2787-
# Extract from FASTA only sequences (discard sequence names) into seq.txt
2788-
grep -v "^>" Oxalis_HybSeq_nrDNA_selection_alignment.fasta > seq.txt
2787+
# Extract from FASTA only sequence names into names.txt
2788+
grep "^>" Oxalis_HybSeq_nrDNA_selection_*.fasta | sed 's/^>//' > names.txt
27892789
# Save names of oxalis* JPG files into list_oxalis_photo.txt and see it
27902790
ls -1 *oxalis*.jpg > list_oxalis_photo.txt && cat list_oxalis_photo.txt
27912791
\end{bashcode}
@@ -3074,6 +3074,7 @@ \subsection{Compressed text}
30743074
\item Sometimes these variants are used automatically when user works with compressed file
30753075
\item \texttt{mc} can also do the job
30763076
\item These tools sometimes don't have all options of the \enquote{standard} applications
3077+
\item Scientific data formats are often compressed by GZIP (FASTQ, VCF,~\ldots)
30773078
\end{itemize}
30783079
\end{frame}
30793080
@@ -3144,7 +3145,7 @@ \subsection{Comparisons}
31443145
\begin{bashcode}
31453146
# Display diff in vim
31463147
diff -u diff_test_file_1.txt diff_test_file_2.txt | view -
3147-
# vimdiff can show more colors, launches vim (exit by <ESC>:q! Enter)
3148+
# vimdiff can show more colors, launches vim (exit by <ESC>:q!<Enter>)
31483149
vimdiff diff_test_file_1.txt diff_test_file_2.txt
31493150
\end{bashcode}
31503151
\vfill
@@ -3155,7 +3156,7 @@ \subsection{Comparisons}
31553156
\end{itemize}
31563157
\vfill
31573158
\begin{bashcode}
3158-
# Create the diff file
3159+
# Create the diff file - use like "diff old new"
31593160
diff -u diff_test_file_1.txt diff_test_file_2.txt > difference.diff
31603161
# Apply the patch - xxx_file_1.txt is patched according to xxx_file_2.txt
31613162
patch < difference.diff # or
@@ -3203,7 +3204,7 @@ \subsection{Editors}
32033204
\end{itemize}
32043205
\item The most common (but very complex and specific) is \textbf{Vim}
32053206
\begin{itemize}
3206-
\item See \url{https://vim-adventures.com/} to play a~game and learn Vim
3207+
\item See \url{https://vim-adventures.com/} to play a~game and learn Vim (and derivatives)
32073208
\end{itemize}
32083209
\item \textbf{Emacs} and \textbf{Vim} have huge number of possibilities and support for plugins and scripts, but completely different usage style --- one person can really learn only one\ldots
32093210
\item If regularly working in command line, master any command line editor
@@ -3838,7 +3839,7 @@ \subsection{Reading variables}
38383839
\end{bashcode}
38393840
\end{frame}
38403841
3841-
\begin{frame}[fragile]{Simple providing of input file I}
3842+
\begin{frame}[fragile]{Simple providing of input file I}{Probably the most common script type you need --- just specify data to process}
38423843
\begin{bashcode}
38433844
#!/bin/bash
38443845
# We expect exactly one parameter
@@ -3873,6 +3874,7 @@ \subsection{Reading variables}
38733874
\begin{itemize}
38743875
\item Common way for simple scripts --- check input and do something with single input file
38753876
\item Note lines 4 and 5 above --- common way to report success as well as handle failure
3877+
\item Possibly add extra variables describing what to do with input data (e.g. slide~\ref{metacentrumscript})
38763878
\end{itemize}
38773879
\vfill
38783880
\begin{bashcode}
@@ -4088,7 +4090,7 @@ \subsection{Loops}
40884090
# whatever reason 'for' loop construction is impractical)
40894091
while read TEXTLINE; do # Run loops on every line of text file
40904092
commands... # TEXTLINE contains in each turn one line of the file
4091-
done < text_file_to_process.txt
4093+
done < text_file_to_process.txt # Commonly list of input data files
40924094
# Infinite loops - common when waiting for some condition to proceed
40934095
while :; do echo "Press CTRL+C to exit..."; done
40944096
for (( ; ; )) ; do echo "Press CTRL+C to exit..."; done
@@ -4327,7 +4329,7 @@ \subsection{Compilation}
43274329
\begin{itemize}
43284330
\item Available from \url{https://github.com/stamatak/standard-RAxML}
43294331
\item Before compilation check \href{https://github.com/stamatak/standard-RAxML/blob/master/README.md}{README}
4330-
\item This example does not require to run \texttt{make install}, it does not have extra dependencies for compilation, it requires specifying of particular source file by \texttt{make~-f} (there are multiple \texttt{GCC} files, no one main)
4332+
\item This example does not require to run \texttt{make install}, it does not have extra dependencies for compilation, it requires specifying of particular source file by \texttt{make~-f} (there are multiple \texttt{GCC} files, not just one main)
43314333
\end{itemize}
43324334
\begin{bashcode}
43334335
mkdir raxml # Create working directory
@@ -4616,6 +4618,7 @@ \subsection{Usage}
46164618
\subsection{Tasks}
46174619
46184620
\begin{frame}[fragile]{Basic skeleton of script running tasks I} % TODO Check usage of trap.
4621+
\label{metacentrumscript}
46194622
\begin{bashcode}
46204623
#!/bin/bash
46214624
# Modify the script according to your needs!
@@ -4777,7 +4780,7 @@ \subsection{Tasks}
47774780
# Go to SCRATCH directory
47784781
cd SCRATCHDIR # e.g. /scratch/USER/job_12345678.meta-pbs.metacentrum.cz/
47794782
# There are working data of currently running task...
4780-
# Check whatever you need...
4783+
# Check whatever you need... Press Ctrl+D to logout
47814784
\end{bashcode}
47824785
\end{frame}
47834786
@@ -5138,9 +5141,13 @@ \subsection{Git basics} % TODO Bit reorder commands so it is more fluent.
51385141
51395142
\subsection{}
51405143
5141-
\begin{frame}{Git tasks} % TODO Make clear they work from their notebooks.
5144+
\begin{frame}[fragile]{Git tasks}
5145+
\begin{bashcode}
5146+
git clone https://students:[email protected]
5147+
.cz/restio/dadaism.git # It is one long line (no space after .cas)
5148+
\end{bashcode}
51425149
\begin{enumerate}
5143-
\item Clone over SSH repository \texttt{[email protected]:/srv/dadaism} (use your credentials on the testing server) and go to \texttt{dadaism} directory.
5150+
\item Clone the repository using access token (see above) and go to the \texttt{dadaism} directory.
51445151
\item Communicate with others to avoid conflicting edits.
51455152
\item Add some text files, edit existing text files. Do not add images or another non-text files, do not add large files.
51465153
\item Push your changes back to the repository.
@@ -5273,7 +5280,7 @@ \subsection{Resources}
52735280
\item Very good to improve code and fixing non-working code
52745281
\item Can well explain existing code --- good starting point
52755282
\item Good for adaptation of existing code for user's needs
5276-
\item Limited usage to generate new code --- can misunderstand request, code can be technically wrong, but not well working, can be incomplete or limited in corner-cases
5283+
\item Limited usage to generate new code --- can misunderstand request, code can be technically correct, but not well working, can be incomplete or limited in corner-cases
52775284
\item Without at least basic understanding of subject it is hard to realize if ChatGPT solution is correct --- user should be at least basically able to work without AI, otherwise there is high risk of failures
52785285
\item \alert{One should never rely on tool with unclear functionality and problematic usage of of users' data and copyrighted content}
52795286
\end{itemize}

0 commit comments

Comments
 (0)