% Created 2020-04-17 Fri 01:12
% Intended LaTeX compiler: pdflatex
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[osf,largesc,helvratio=0.9]{newpxtext}
\usepackage[scale=0.92]{sourcecodepro}
\usepackage[varbb]{newpxmath}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=2000]{microtype}
\usepackage{xcolor}
\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{minted}
\author{Timothy}
\date{\today}
\title{Sysadmin}
\hypersetup{
  pdfauthor={Timothy},
  pdftitle={Sysadmin},
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 26.3 (Org mode 9.4)},
  pdflang={English},
  breaklinks=true,
  colorlinks=true,
  linkcolor=,
  urlcolor=blue!70!green,
  citecolor=green!60!blue
}
\urlstyle{same}
\begin{document}

\maketitle
\tableofcontents


\section{Servers}
\label{sec:Servers}
\phantomsection
\label{org7389d68}
\begin{itemize}
\item motsugo
\item mooneye
\item molmol
\item murasoi
\item medico
\item maltair
\item loveday
\item magikarp
\item mudkip
\end{itemize}

\phantomsection
\label{orgf74123d}
\begin{itemize}
\item chubsucker
\item cichlid
\item corvo
\item corydoras
\item cobra
\item christmas
\item catfish
\item napoli
\item clownfish
\item pinball
\item porcupine
\end{itemize}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{python}
return [f"{h[0]}.ucc.asn.au" for h in hosts]
\end{minted}

\begin{itemize}
\item motsugo.ucc.asn.au
\item mooneye.ucc.asn.au
\item molmol.ucc.asn.au
\item murasoi.ucc.asn.au
\item medico.ucc.asn.au
\item maltair.ucc.asn.au
\item loveday.ucc.asn.au
\item magikarp.ucc.asn.au
\item mudkip.ucc.asn.au
\end{itemize}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
cat /etc/*-release | sed 's/=/\t/g'
\end{minted}

\begin{center}
\begin{tabular}{ll}
\textls*[70]{\textsc{pretty}}\textsubscript{\textls*[70]{\textsc{name}}} & Debian \textls*[70]{\textsc{gnu}}/Linux 9 (stretch)\\
\textls*[70]{\textsc{name}} & Debian \textls*[70]{\textsc{gnu}}/Linux\\
\textls*[70]{\textsc{version}}\textsubscript{\textls*[70]{\textsc{id}}} & 9\\
\textls*[70]{\textsc{version}} & 9 (stretch)\\
\textls*[70]{\textsc{id}} & debian\\
\textls*[70]{\textsc{home}}\textsubscript{\textls*[70]{\textsc{url}}} & \url{https://www.debian.org/}\\
\textls*[70]{\textsc{support}}\textsubscript{\textls*[70]{\textsc{url}}} & \url{https://www.debian.org/support}\\
\textls*[70]{\textsc{bug}}\textsubscript{\textls*[70]{\textsc{report}}}\textsubscript{\textls*[70]{\textsc{url}}} & \url{https://bugs.debian.org/}\\
\end{tabular}
\end{center}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
for host in $hosts; do
ping -c 1 $host | grep bytes
done
\end{minted}

\begin{center}
\begin{tabular}{rllrllll}
\textls*[70]{\textsc{ping}} & motsugo.ucc.asn.au & (130.95.13.7): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.7: & icmp\textsubscript{seq}=0 & ttl=252 & time=14.367 & ms\\
\textls*[70]{\textsc{ping}} & mooneye.ucc.asn.au & (130.95.13.9): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.9: & icmp\textsubscript{seq}=0 & ttl=252 & time=12.880 & ms\\
\textls*[70]{\textsc{ping}} & molmol.ucc.asn.au & (130.95.13.5): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.5: & icmp\textsubscript{seq}=0 & ttl=252 & time=13.536 & ms\\
\textls*[70]{\textsc{ping}} & murasoi.ucc.asn.au & (130.95.13.1): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.1: & icmp\textsubscript{seq}=0 & ttl=252 & time=13.861 & ms\\
\textls*[70]{\textsc{ping}} & medico.ucc.asn.au & (130.95.13.22): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.22: & icmp\textsubscript{seq}=0 & ttl=252 & time=12.153 & ms\\
\textls*[70]{\textsc{ping}} & maltair.ucc.asn.au & (130.95.13.32): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.32: & icmp\textsubscript{seq}=0 & ttl=252 & time=12.733 & ms\\
\textls*[70]{\textsc{ping}} & loveday.ucc.asn.au & (130.95.13.33): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.33: & icmp\textsubscript{seq}=0 & ttl=252 & time=12.824 & ms\\
\textls*[70]{\textsc{ping}} & magikarp.ucc.asn.au & (130.95.13.47): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.47: & icmp\textsubscript{seq}=0 & ttl=252 & time=12.597 & ms\\
\textls*[70]{\textsc{ping}} & mudkip.ucc.asn.au & (130.95.13.46): & 56 & data & bytes &  & \\
64 & bytes & from & 130.95.13.46: & icmp\textsubscript{seq}=0 & ttl=252 & time=12.332 & ms\\
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{ll}
Service & Machine\\
\hline
User Shells & Motsugo, Mussel, Meersau, Musdea (FreeBSD), Maaxen (Win), Gothamburg (Mac)\\
\textls*[70]{\textsc{dns}} & Mooneye\\
Files & Motsugo (\texttt{/home}), Molmol (\texttt{/away}, \texttt{/space}, \texttt{/services}, \texttt{/mp3s}, \texttt{/vmstore})\\
\textls*[70]{\textsc{ad}} & Samson\\
\textls*[70]{\textsc{ldap}} & Mussel\\
Routing & Murasoi\\
Web & Mussel (core pages, planet), Mooneye (wiki, webcams)\\
\end{tabular}
\end{center}
\section{Networking}
\label{sec:Networking}
Router configuration (i.e. firewall) is described by \href{file://ssh:ucc|ssh:root@murasoi:/etc/init.d/ucc-fw}{this file on murasoi}.

Wheel-keys are managed by \href{file://ssh:ucc|sudo:ucc:/home/wheel/bin/uccroot/push.sh}{push.sh}.
\section{User services}
\label{sec:UserServices}
\subsection{Password reset}
\label{sec:PasswordReset}
\href{(org-babel-execute-subtree)}{Run Process}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/pw-reset-requester-username (ivy-read "User who requested reset: " ucc-sysadmin/users))
(setq ucc-sysadmin/pw-reset-requester-new-pw (read-string "New password: "))
(gui-select-text (format "Hi %s, your new password is `%s`. Please change it immediately by logging into on one of \textls*[70]{\textsc{ucc}}'s servers :) (to do this you can `ssh %s@ssh.ucc.asn.au` in a terminal)"
                         ucc-sysadmin/pw-reset-requester-username
                         ucc-sysadmin/pw-reset-requester-new-pw
                         ucc-sysadmin/pw-reset-requester-username))
(print "Done. Message copied to clipboard")
\end{minted}

\begin{verbatim}
Done. Message copied to clipboard
\end{verbatim}


\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
echo "Changing $theuser's password at $(date --iso-8601=minutes)"
samba-tool user setpassword $theuser --newpassword=$thepassword --must-change-at-next-login
\end{minted}

\begin{verbatim}
Sun Apr  5 15:55:44 \textls*[70]{\textsc{awst}} 2020
Changed password \textls*[70]{\textsc{ok}}
\end{verbatim}

\section{\textls*[70]{\textsc{vm}} Creation}
\label{sec:VmCreation}
\href{(org-babel-execute-subtree)}{Run Process}
\subsection{Collect info}
\label{sec:CollectInfo}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
samba-tool group listmembers gumby
\end{minted}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/users (split-string users "\n"))
(delete "Administrator" ucc-sysadmin/users)
(format "Total users: %s" (length ucc-sysadmin/users))
\end{minted}

\begin{verbatim}
Total users: 1338
\end{verbatim}


\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/vm-requester-username (ivy-read "User who requested \textls*[70]{\textsc{vm}}: " ucc-sysadmin/users))
(setq ucc-sysadmin/vm-name (ivy-read (format "\textls*[70]{\textsc{vm}} name: %s-" ucc-sysadmin/vm-requester-username) '()))
(setq ucc-sysadmin/vm-comment (ivy-read "\textls*[70]{\textsc{vm}} comment: " '()))
(setq ucc-sysadmin/vm-lifetime (ivy-read "What is the expected lifetime of this \textls*[70]{\textsc{vm}}: " '("long term" "next few weeks" "new few months" "not for a while")))
(setq ucc-sysadmin/vm-memory (ivy-read "\textls*[70]{\textsc{vm}} memory (MiB): " '("512" "1024" "2048" "4086") :def "2048"))
(setq ucc-sysadmin/vm-cores (ivy-read "\textls*[70]{\textsc{vm}} processes: " '("1" "2" "3" "4") :def "2"))
(setq ucc-sysadmin/vm-disksize (ivy-read "\textls*[70]{\textsc{vm}} disk size: " '("10" "20" "40" "50" "80") :def "20"))
(setq ucc-sysadmin/vm-vmhost (ivy-read "\textls*[70]{\textsc{vm}} host: " '("medico" "maltair" "loveday" "magikarp" "mudkip")))
\end{minted}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
tla $theuser | sed 's/: /\t/g'
\end{minted}

\begin{center}
\begin{tabular}{ll}
\textls*[70]{\textsc{tla}} & [\textls*[70]{\textsc{tha}}]\\
Name & Tom Hill Almeida\\
Login & tommoa\\
\end{tabular}
\end{center}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
tla $USER | sed 's/: /\t/g'
\end{minted}

\begin{center}
\begin{tabular}{ll}
\textls*[70]{\textsc{tla}} & [\textls*[70]{\textsc{tec}}]\\
Name & Timothy Chapman\\
Login & tec\\
\end{tabular}
\end{center}

\subsection{Make \textls*[70]{\textsc{vm}}}
\label{sec:MakeVm}
\subsubsection{Get new \textls*[70]{\textsc{vm}} id \& description}
\label{sec:GetNewVmIdDescription}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
pvesh get /cluster/nextid
\end{minted}

\begin{verbatim}
169
\end{verbatim}


\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/vm-id vmid)
\end{minted}

\begin{verbatim}
169
\end{verbatim}

\subsubsection{Network configuration}
\label{sec:NetworkConfiguration}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
cat /etc/bind/domains/primary/ucc.machines
\end{minted}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{python}
import re
bindconfig = re.sub(r'\s*#.*', '', bindconfig)
bindlines = bindconfig.split('\n')
bindlines = list(filter(lambda l: re.search(r'\s*A: \d+$', l), bindlines))
boundips = [int(re.sub('\s*A: ', '', l)) for l in bindlines]
avalible = [i for i in range(128,193) if i not in boundips]
return avalible
\end{minted}

\begin{center}
\begin{tabular}{rrrrrrrrrrrrrrrrrrrrrrrrrr}
128 & 149 & 153 & 154 & 155 & 159 & 160 & 161 & 162 & 163 & 164 & 165 & 166 & 167 & 169 & 170 & 175 & 176 & 178 & 179 & 180 & 181 & 182 & 183 & 184 & 189\\
\end{tabular}
\end{center}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/vm-ip vmip)
\end{minted}

\begin{verbatim}
128
\end{verbatim}


\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
echo "[$vmname.$vmuser.ucc.com.]
A: $vmip
\textls*[70]{\textsc{aaaa}}: 102::$vmip
\textls*[70]{\textsc{hinfo}}: \"\textls*[70]{\textsc{vm}} on $vmhost\" \"$vmcomment\"
addDomain: no
zones: ucrev 6rev"
\end{minted}

[dummy-vm.tec.ucc.com.]
A: 128
\textls*[70]{\textsc{aaaa}}: 102::128
\textls*[70]{\textsc{hinfo}}: ``\textls*[70]{\textsc{vm}} on maltair'' ``it's a test''
addDomain: no
zones: ucrev 6rev

[endpoint.mtearle.ucc.com.]
A: 128
\textls*[70]{\textsc{aaaa}}: 102::128
\textls*[70]{\textsc{hinfo}}: ``\textls*[70]{\textsc{vm}} on maltair'' ``Test \textls*[70]{\textsc{vm}}''
addDomain: no
zones: ucrev 6rev

\subsubsection{Generate description}
\label{sec:GenerateDescription}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/vm-description (concat (format "Created on %s for %s by %s %s" (format-time-string "%Y-%m-%d") vmuser-tla myself myself-tla)
        (format "\nOwner: %s <%s@ucc.asn.au>" vmuser-fullname vmuser)
        (format "\nIP: 130.95.13.%s" ucc-sysadmin/vm-ip)
        "\n\n" vmcomment (if (equal ucc-sysadmin/vm-lifetime "") "" (format "\nLifetime: %s" ucc-sysadmin/vm-lifetime))))
\end{minted}

\begin{verbatim}
Created on 2020-03-31 for [\textls*[70]{\textsc{tec}}] by Timothy Chapman [\textls*[70]{\textsc{tec}}]
Owner: Timothy Chapman <tec@ucc.asn.au>
\textls*[70]{\textsc{ip}}: 130.95.13.128

it's a test
Lifetime: nil
\end{verbatim}

\subsubsection{Create \textls*[70]{\textsc{vm}}}
\label{sec:CreateVm}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{common-lisp}
(setq ucc-sysadmin/vm-confirm (counsel--yes-or-no-p (format "\textls*[70]{\textsc{vm}} on %s for %s with name %s
With %s cores, %s MiB memory and %sGB storage.
Assigned \textls*[70]{\textsc{ip}}: 130.95.13.%s

%s

Does this look alright?" ucc-sysadmin/vm-vmhost ucc-sysadmin/vm-requester-username
ucc-sysadmin/vm-name ucc-sysadmin/vm-cores ucc-sysadmin/vm-memory ucc-sysadmin/vm-disksize
ucc-sysadmin/vm-ip ucc-sysadmin/vm-comment)))
\end{minted}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{sh}
qm create $vmid --memory $vmmemory --net0 virtio,bridge=vmbr0,tag=4 --ostype l26 --description "$vmdescription" --virtio0 "vmstore-ssd_vm:$vmdisksize" --onboot yes --sockets 1 --cores $vmcores --pool Member-\textls*[70]{\textsc{vm}\protect\scalebox{.91}[.84]{s}} --name "$vmuser-$vmname"
qm status $vmid -verbose
\end{minted}

0

\subsubsection{Apply network config, and do/the rest of the things\textsuperscript{\textls*[70]{\textsc{tm}}}}
\label{sec:ApplyNetworkConfigAndDoTheRestOfTheThingsTm}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{python}
import re
configitems = {}
configlines = config.split("\n")

marker = 0
seenIp = ""
for i in range(len(configlines)):
    line = configlines[i]
    # if start of bind block
    if re.search("^\[.+\]", line) or i is len(configlines) - 1:
        commentabove = bool(re.search(r"\s*#", configlines[i - 1]))
        if marker > 0:
            configitems[seenIp] = "\n".join(configlines[marker:i - commentabove]).strip()
        # if not encoutering first block and line before is comment, grab that
        if i > 0 and commentabove:
            marker = i - 1
        else:
            marker = i
        seenIp = ""
    elif re.search("^A: [\d\.]+", line):
        seenIp = "{:0>4}".format(line.replace("A: ", ""))  # 0-pad for sorting
for k,v in sorted(configitems.items()):
    print(k,v,end='\n\n')
\end{minted}

\paragraph{{\bfseries\sffamily \textls*[70]{\textsc{todo}}} the stuff here doesn't seem to work}
\label{sec:TheStuffHereDoesntSeemToWork}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{fundamental}
<<ucc-machines-content>>
<<generate-vm-bind>>
\end{minted}

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos,breakanywhere=true,breakautoindent=true,breaklines=true,autogobble=true,obeytabs=true,python3=true,breakbefore=\\\.+,breakafter=\,,style=autumn,breaksymbol=\tiny\ensuremath{\hookrightarrow},breakanywheresymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakbeforesymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}},breakaftersymbolpre=\,\footnotesize\ensuremath{{}_{\rfloor}}]{fundamental}
<<sort-bind-config(combined-bind)>>
\end{minted}
\end{document}
