Skip to content

Commit 3813517

Browse files
committed
Small updates of remaining chapters.
1 parent 1d84a2f commit 3813517

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

presentation/linux_bash_metacentrum_course.tex

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3621,7 +3621,7 @@ \subsection{Reading variables}
36213621
\end{itemize}
36223622
\end{frame}
36233623
3624-
\begin{frame}[fragile]{Provide named parameters}
3624+
\begin{frame}[fragile]{Provide named parameters} %FIXME Fix wrong syntax highlight
36253625
\begin{bashcode}
36263626
#!/bin/bash
36273627
# Script has only one parameter ($1) provided
@@ -3908,17 +3908,17 @@ \subsection{Branching the code}
39083908
\item Avoid long chaining of conditions using \texttt{elif} statement (previous slide) --- susceptible to mistakes, hard to debug
39093909
\item \enquote{\texttt{[~\ldots~]}} (always keep space inside around it) is function to evaluate expressions
39103910
\begin{itemize}
3911-
\item \texttt{if [ "\${VAR}" -eq 25 ]} or alternatively \texttt{test "\${VAR}" -eq 25} instead of \texttt{if}
3912-
\item \texttt{if [ "\${VAR}" == "value" ]; \ldots}
3911+
\item \texttt{if [ "\$\textbraceleft VAR\textbraceright" -eq 25 ]} or alternatively \texttt{test "\$\textbraceleft VAR\textbraceright" -eq 25} instead
3912+
\item \texttt{if [ "\$\textbraceleft VAR\textbraceright" == "value" ]; \ldots}
39133913
\begin{itemize}
39143914
\item Escaping variables and values by double quotes (\texttt{"\ldots"}) is recommended (to be sure), but not strictly required all the time
39153915
\end{itemize}
3916-
\item \texttt{if [ ! -f regularfile ];} \ldots --- \texttt{!} reverts condition
3916+
\item \texttt{if [ ! -f regularfile ];} \ldots{ }--- \texttt{!} reverts condition
39173917
\item Single-bracket conditions --- file, string, or arithmetic conditions
39183918
\item Double-bracket syntax --- enhanced (now preferred)
39193919
\begin{itemize}
39203920
\item Allow usage of regular expressions and globing patterns
3921-
\item Word splitting is prevented --- \texttt{\$STRINGVAR} can contain spaces
3921+
\item Word splitting is prevented --- \texttt{\textbraceleft \$STRINGVAR} can contain spaces
39223922
\item Expanding file names --- \texttt{if [[ -a *.sh ]]} (variant with only one bracket doesn't work when there are multiple sh files)
39233923
\item More detailed test, e.g. \texttt{if [[ \$num -eq 3 \&\& "\$\textbraceleft STRINGVAR\textbraceright " == XXX ]]\ldots}
39243924
\end{itemize}
@@ -4170,7 +4170,7 @@ \subsection{Packages}
41704170
\item And many more\ldots
41714171
\item All do same task --- as soon as user master one, others are equally simple
41724172
\end{itemize}
4173-
\item Distributions use to provide convenient simple update applet notifying about awaiting updates
4173+
\item Distributions use to provide convenient update applet notifying about awaiting updates
41744174
\item There use to be web services to look for packages, also from other sources --- \href{https://software.opensuse.org/explore}{openSUSE}, \href{https://www.debian.org/distrib/packages\#search_packages}{Debian}, \href{https://packages.ubuntu.com/}{Ubuntu} (+ \href{https://launchpad.net/ubuntu/+search}{Launchpad} and \href{https://launchpad.net/ubuntu/+ppas}{PPAs}), \href{https://packages.fedoraproject.org/}{Fedora},~\ldots
41754175
\item The task is always same, the exact work-flow and commands more or less differ among distributions\ldots
41764176
\item Tools like Android Google Play, Apple Store or Windows Store are inspired from Linux (but terribly simplified)\ldots
@@ -4183,7 +4183,7 @@ \subsection{Packages}
41834183
41844184
\begin{frame}[allowframebreaks]{Package management in command line in openSUSE and SLE (basic commands)}
41854185
\begin{itemize}
4186-
\item Root password is required: use \texttt{sudo\ldots} or \texttt{su~-}
4186+
\item Root password is required: use \texttt{sudo \ldots} or \texttt{su~-}
41874187
\item Package name \texttt{*.rpm}
41884188
\item \texttt{zypper in \textit{package}} --- install \textit{package}
41894189
\item \texttt{zypper rm \textit{package}} --- remove \textit{package}
@@ -4208,7 +4208,7 @@ \subsection{Packages}
42084208
42094209
\begin{frame}[allowframebreaks]{Package management in command line in Debian/Ubuntu and derivatives (basic commands)}
42104210
\begin{itemize}
4211-
\item Root password is required: use \texttt{sudo\ldots} or \texttt{su~-}
4211+
\item Root password is required: use \texttt{sudo \ldots} or \texttt{su~-}
42124212
\item Package name \texttt{*.deb}
42134213
\item \texttt{apt install \textit{package}} --- install \textit{package}
42144214
\item \texttt{apt remove \textit{package}} --- remove \textit{package}
@@ -4221,15 +4221,15 @@ \subsection{Packages}
42214221
\item \texttt{cat /etc/apt/sources.list} --- list repositories
42224222
\item \texttt{nano /etc/apt/sources.list} --- add/remove/edit repositories
42234223
\item \texttt{dpkg-*}, \texttt{apt-*} commands for other tasks
4224-
\item \texttt{aptitude} is used in similar way as \texttt{apt} (e.g. \texttt{aptitude install \textit{package}},~\ldots)
4224+
\item \texttt{aptitude} is used in similar way as \texttt{apt} (e.g. \texttt{aptitude install \textit{package}},~\ldots) or as interactive tool (just run \texttt{aptitude})
42254225
\item Similar tasks can be done with \texttt{apt}, \texttt{apt-get}, or \texttt{aptitude}
42264226
\item \texttt{man aptitude}, \texttt{man apt-XXX}, \texttt{man dpkg-XXX}, \texttt{man apt} --- usage help
42274227
\end{itemize}
42284228
\end{frame}
42294229
42304230
\begin{frame}[allowframebreaks]{Package management in command line in RedHat, Fedora, CENTOS and derivatives (basic commands)}
42314231
\begin{itemize}
4232-
\item Root password is required: use \texttt{sudo\ldots} or \texttt{su~-}
4232+
\item Root password is required: use \texttt{sudo \ldots} or \texttt{su~-}
42334233
\item Package name \texttt{*.rpm}
42344234
\item \texttt{dnf install \textit{package}} --- install \textit{package}
42354235
\item \texttt{dnf remove \textit{package}} --- remove \textit{package}
@@ -4277,7 +4277,7 @@ \subsection{Compilation}
42774277
42784278
\begin{frame}[fragile]{Basics of compilation}
42794279
\begin{itemize}
4280-
\item Some software is distributed only as source code (e.g. downloaded from GitHub) written in languages like C or C++ --- user has to compile it to get binary executable
4280+
\item Some software is distributed only as source code (e.g. downloaded from GitHub) written in languages like C or C++ --- user has to \textit{compile} it to get working binary executable
42814281
\item Compilation creates binary specific for particular operating system and hardware platform --- can be tuned for optimal performance
42824282
\item Interpreted languages like Bash, Perl, Python or Java don't have to be compiled (but it is possible) --- they need their interpreter to run, relative easily portable among hardware platforms and OS
42834283
\item Applications requiring compilation usually have good instructions
@@ -4490,7 +4490,7 @@ \subsection{Information}
44904490
\item To use MetaCentrum fill registration form \url{https://metavo.metacentrum.cz/en/application/form} (\href{https://metavo.metacentrum.cz/cs/application/}{česky})
44914491
\item To use data storage fill registration form \url{https://einfra.cesnet.cz/perun-registrar-fed/?vo=storage}
44924492
\item After registration for MetaCentrum, user can join MetaCloud via \url{https://perun.metacentrum.cz/fed/registrar/?vo=meta&group=metacloud}
4493-
\item Users not having access to \href{https://www.eduid.cz/en/index}{EduID} (\href{https://www.eduid.cz/cs/index}{česky}) have to register first at \href{https://www.eduid.cz/cs/hostel}{HostelID} (only in Czech)
4493+
\item Login is using \href{https://www.eduid.cz/en/index}{EduID} (\href{https://www.eduid.cz/cs/index}{česky})
44944494
\end{itemize}
44954495
\item Information about data storage \url{https://du.cesnet.cz/en/start} (\href{https://du.cesnet.cz/cs/start}{česky}) contains detailed usage instructions
44964496
\item Information about MetaCentrum \url{https://www.metacentrum.cz/en/} (\href{https://www.metacentrum.cz/cs/}{česky}) and wiki \url{https://wiki.metacentrum.cz/wiki/Main_Page} (\href{https://wiki.metacentrum.cz/wiki/Hlavn\%C3\%AD_strana}{česky}) (main information for users containing all needed documentation)
@@ -4512,7 +4512,7 @@ \subsection{Information}
45124512
\begin{frame}{Terminology}
45134513
\begin{multicols}{2}
45144514
\begin{itemize}
4515-
\item Node (computing server) --- single computer, worker finally doing computational job
4515+
\item Node (computing server) --- single computer, worker finally doing your computational job
45164516
\item Cluster --- bunch of nodes in rack (special case storing nodes, use to contain also network switch, backup power,~\ldots{ } e.g. \href{https://sorbus.ibot.cas.cz/en/hw}{cluster in Průhonice}, \href{https://sorbus.ibot.cas.cz/cs/hw}{česky})
45174517
\item Grid --- clusters distributed in various places, connected into single system by fast network (e.g. \href{https://www.metacentrum.cz/en/Sluzby/Grid/}{MetaCentrum}, \href{https://www.metacentrum.cz/cs/Sluzby/Grid/}{česky})
45184518
\item Supercomputer --- extra powerful computer, nowadays mostly special cluster, e.g. \href{https://www.it4i.cz/}{IT4Innovations} in Ostrava
@@ -4539,6 +4539,9 @@ \subsection{Information}
45394539
\item Some special services (like \href{https://wiki.metacentrum.cz/wiki/OnDemand}{OnDemand}) start on particular storage (here \texttt{brno3})
45404540
\item Generally, computing task loads data from selected storage and can start on any cluster
45414541
\item Orientation is plenty of storages might be sometimes tricky --- ensure where you are and where your data are supposed to be
4542+
\begin{itemize}
4543+
\item Preferably use single frontend and storage to avoid confusions and issues with paths
4544+
\end{itemize}
45424545
\end{itemize}
45434546
\end{frame}
45444547
@@ -4556,7 +4559,7 @@ \subsection{Usage}
45564559
\begin{frame}[fragile]{MetaCentrum usage}
45574560
\begin{enumerate}
45584561
\item Transfer data into one of \href{https://wiki.metacentrum.cz/wiki/Working_with_data}{storages} (\href{https://wiki.metacentrum.cz/wiki/Prace_s_daty}{česky}) by e.g. \texttt{scp} from command line, \href{https://winscp.net/}{WinSCP} from Windows or \href{https://filezilla-project.org/}{FileZilla} from any OS
4559-
\item Connect via SSH to select \href{https://wiki.metacentrum.cz/wiki/Frontend}{frontend} (\href{https://wiki.metacentrum.cz/wiki/Celni_uzel}{česky}). Same credentials are used for all frontends, for SSH login as well as file transmissions
4562+
\item Connect via SSH to selected \href{https://wiki.metacentrum.cz/wiki/Frontend}{frontend} (\href{https://wiki.metacentrum.cz/wiki/Celni_uzel}{česky}). Same credentials are used for all frontends, for SSH login as well as file transmissions
45604563
\item In home directory on the storage (accessed via frontend) prepare all needed data and non-interactive script to do the calculations
45614564
\item Submit job using \texttt{qsub}. Tasks are not launched immediately, but submitted into queue and system decides when it will be launched
45624565
\item Monitor job progress. Check results. Etc\ldots
@@ -4591,7 +4594,7 @@ \subsection{Tasks}
45914594
# Modify the script according to your needs!
45924595
# Set data directories
45934596
WORKDIR="my_data_dir" # Or something else
4594-
DATADIR="/storage/XXX/home/$LOGNAME" # Or other storage
4597+
DATADIR="/storage/XXX/home/${LOGNAME}" # Or other storage
45954598
# There is e.g. directory /storage/praha1/home/gunnera/my_data_dir
45964599
# containing all the data needed for calculations
45974600
# Clean-up of SCRATCH (it is temporal directory created by server) - the
@@ -4872,8 +4875,8 @@ \subsection{Archive data storage}
48724875
chgrp -R XXX /tape_tape/VO_XXX 2>/dev/null
48734876
# ("-R" to modify also subdirectories; "2>/dev/null" to discard errors)
48744877
# Set correct permissions to directories and files
4875-
find /tape_tape/VO_XXX -type d -exec chmod 770 {} \; 2>/dev/null
4876-
find /tape_tape/VO_XXX -type f -exec chmod 660 {} \; 2>/dev/null
4878+
find /tape_tape/VO_XXX -type d -exec chmod 770 '{}' \; 2>/dev/null
4879+
find /tape_tape/VO_XXX -type f -exec chmod 660 '{}' \; 2>/dev/null
48774880
\end{bashcode}
48784881
\end{frame}
48794882
@@ -4939,7 +4942,7 @@ \subsection{Git principle}
49394942
\begin{frame}[allowframebreaks]{Git and version control}
49404943
\begin{itemize}
49414944
\item \href{https://git-scm.com/}{Git} is \href{https://en.wikipedia.org/wiki/Version_control}{version controlling} (\href{https://cs.wikipedia.org/wiki/Verzov\%C3\%A1n\%C3\%AD}{česky}) system (nowadays the most common) --- it traces changes among all versions --- absolutely crucial for any software development
4942-
\item Older (nowadays not so common) version controlling systems is Subversion (SVN), there are many more (Bazaar, Mercurial,~\ldots)
4945+
\item Older (nowadays not so common) version controlling systems is Subversion (SVN); there are many more (Bazaar, Mercurial,~\ldots)
49434946
\item Probably the best textbook for Git is \href{https://git-scm.com/book/en/v2}{Chacon's Pro Git}
49444947
\begin{itemize}
49454948
\item Dostupná i~\href{https://git-scm.com/book/cs/v2}{česky} (včetně \href{https://knihy.nic.cz/\#ProGit}{prvního vydání})
@@ -4995,7 +4998,7 @@ \subsection{Git principle}
49954998
\item Staging (changes awaiting to be pushed to the repository)
49964999
\item Git repository (remote/local)
49975000
\end{enumerate}
4998-
\item Everyone has whole repository and history --- very robust
5001+
\item Everyone has whole repository and history (it's \enquote{distributed}) --- very robust
49995002
\item Flexible branches
50005003
\begin{itemize}
50015004
\item Very convenient
@@ -5106,7 +5109,7 @@ \subsection{}
51065109
51075110
\begin{frame}{Git tasks}
51085111
\begin{enumerate}
5109-
\item Clone over SSH repository \texttt{[email protected]:/home/dadaism} (use your credentials on the testing server) and go to \texttt{dadaism} directory.
5112+
\item Clone over SSH repository \texttt{[email protected]:/srv/dadaism} (use your credentials on the testing server) and go to \texttt{dadaism} directory.
51105113
\item Add some text files, edit existing text files. Do not add images or another non-text files, do not add large files.
51115114
\item Push your changes back to the repository.
51125115
\item Fetch changes done by others.
@@ -5217,7 +5220,7 @@ \subsection{Resources}
52175220
\begin{itemize}
52185221
\item As soon as you don't pay for support, you can't blame anyone for lack of responses
52195222
\item Most of software we use to process our data is provided under \enquote{best effort}, without warranty\ldots
5220-
\item Plenty of scientific software is not written by professional programmers, authors often do not foresee everything what could happen and they could have troubles wehn fixing reported issues\ldots
5223+
\item Plenty of scientific software is not written by professional programmers, authors often do not foresee everything what could happen and they could have troubles when fixing reported issues\ldots
52215224
\item There are plenty of reasons some software doesn't work --- usage/data author didn't expect, unsupported version of operating system, author's mistake, user's mistake, unexpected interaction with another software,~\ldots
52225225
\item Authors wish their software to be useful --- constructive feedback, reporting bugs and wishes is welcomed, but it must be provided in the way useful for the developer
52235226
\end{itemize}

0 commit comments

Comments
 (0)