forked from hpcugent/vsc_user_docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.tex
91 lines (76 loc) · 2.75 KB
/
macros.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
% use \macro instead of \newcommand so we automatically add a space
\usepackage{xspace}
\newcounter{cnt}
\newcommand\textlist{}
\newcommand\settext[2]{%
\csdef{text#1}{#2}}
\newcommand\addtext[1]{%
\stepcounter{cnt}%
\csdef{text\thecnt}{#1}}
\newcommand\gettext[1]{%
\csuse{text#1}}
\newcounter{colnum}
\newcommand\maketabularrow[1]{%
\setcounter{colnum}{0}%
\whileboolexpr
{ test {\ifnumcomp{\value{colnum}}{<}{#1 - 1}} }%
{\stepcounter{colnum}\gettext{\thecolnum} & \gettext{\gettext{\thecolnum}} \\ \hline }
% Weird stuff with latex adding an empty row if we don't use the following way.
\stepcounter{colnum}\gettext{\thecolnum} & \gettext{\gettext{\thecolnum}}
}
\newcommand{\macro}[2]{\addtext{\string#1}\settext{\string#1}{\noexpand#2}\newcommand{#1}{#2\xspace}}
% Define some general macros
\ifwindows
\macro{\OS}{Windows}
\newcommand{\osurl}{windows}
\fi
\ifmac
\macro{\OS}{Mac}
\newcommand{\osurl}{mac}
\fi
\iflinux
\macro{\OS}{Linux}
\newcommand{\osurl}{linux}
\fi
\ifleuven
\newcommand{\siteurl}{leuven}
\fi
\ifantwerpen
\newcommand{\siteurl}{antwerpen}
\fi
\ifbrussel
\newcommand{\siteurl}{brussel}
\fi
\ifgent
\newcommand{\siteurl}{gent}
\fi
\macro{\cloudinfo}{\href{mailto:[email protected]}{[email protected]}}
\newcommand{\HPCManualURL}{https://hpcugent.github.io/vsc_user_docs/pdf/intro-HPC-\osurl-\siteurl.pdf}
\newcommand{\LinuxManualURL}{https://hpcugent.github.io/vsc_user_docs/pdf/intro-Linux-\osurl-\siteurl.pdf}
\newcommand{\VSCCloudManualURL}{https://hpcugent.github.io/vsc_user_docs/pdf/intro-Cloud-\osurl-\siteurl.pdf}
% Import the Site specific macros
\inputsite{macros}
% General macro for extracting the jobnumber from the jobid
\macro{\jobnumber}{\BeforeSubString{.}{\jobid}}
\macro{\pbsserver}{\BehindSubString{.}{\jobid}}
% Macro for 255 vs 256 diff in ssh-ed25519 fingerprint
\newcommand{\sshedfingerprintnote}{
\emph{Note:} it is possible that the \lstinline|ssh-ed25519| fingerprint starts with "\lstinline|ssh-ed25519 255|"
rather than "\lstinline|ssh-ed25519 256|" (or vice versa), depending on the PuTTY version you are using.
It is safe to ignore this \lstinline|255| versus \lstinline|256| difference, but the part after should be
\strong{identical}.
}
% Macro for winscp/putty fingerprint alert
\newcommand{\firsttimeconnection}{
The first time you make a connection to the login node, a Security
Alert will appear and you will be asked to verify the authenticity of the
login node.
Make sure the fingerprint in the alert matches one of the following:
\puttyFirstConnect
If it does, press \strong{\emph{Yes}}, if it doesn't, please contact \hpcinfo.
\sshedfingerprintnote
\begin{center}
\includegraphics*[width=3.42in]{ch2-putty-verify-authenticity}
\end{center}
}
\newcommand{\modulelocation}{/apps/\sitename/\defaultcluster/modules/all}