\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Joe319} \pdfinfo{ /Title (thomas.pdf) /Creator (Cheatography) /Author (Joe319) /Subject (Thomas Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{346CA3} \definecolor{LightBackground}{HTML}{F2F5F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Thomas Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Joe319} via \textcolor{DarkBackground}{\uline{cheatography.com/86715/cs/20130/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Joe319 \\ \uline{cheatography.com/joe319} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 25th July, 2019.\\ Updated 30th July, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{0.82386 cm} x{1.87657 cm} x{1.87657 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Linux}} \tn % Row 0 \SetRowColor{LightBackground} \{\{ac\}\}sudo & \{\{ac\}\}sudo \{\{nl\}\}\textless{}commade\textgreater{} & \{\{ac\}\}Execute la commande en tant qu'admin \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{ac\}\}reboot & \{\{ac\}\}sudo reboot & \{\{ac\}\}Reboot \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \{\{ac\}\}apt \seqsplit{install} & \{\{ac\}\}apt install \{\{ac\}\}\textless{}packet\textgreater{} & \{\{ac\}\}Instalation du paquet \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \{\{ac\}\}update & \{\{ac\}\}sudo \{\{ac\}\}apt update & \{\{ac\}\} Update\{\{ac\}\} Faire \{\{ac\}\}ensuite\{\{ac\}\} upgrade \tn % Row Count 12 (+ 4) % Row 4 \SetRowColor{LightBackground} \{\{ac\}\}upgrade & \{\{ac\}\}sudo\{\{ac\}\} apt\{\{ac\}\} upgrade & \{\{ac\}\}Met à \{\{ac\}\}jour \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} \{\{ac\}\}cp & \{\{ac\}\}cp \textless{}file1\textgreater{} \{\{ac\}\}\textless{}folder/file2\textgreater{} & \{\{ac\}\}copie le fichier 1\{\{ac\}\}dans folder sous le nom file2 \tn % Row Count 19 (+ 4) % Row 6 \SetRowColor{LightBackground} \{\{ac\}\}rm & \{\{ac\}\}rm \textless{}file1\textgreater{} & \{\{ac\}\}supprime \textless{}file1\textgreater{} \tn % Row Count 21 (+ 2) % Row 7 \SetRowColor{white} \{\{ac\}\}rm -R & \{\{ac\}\}rm -R \textless{}folder\textgreater{} & \{\{ac\}\}Supprimer le dossier\{\{ac\}\} \textless{}folder\textgreater{} \tn % Row Count 24 (+ 3) % Row 8 \SetRowColor{LightBackground} \{\{ac\}\}chmod & \{\{ac\}\}sudo chmod +x \textless{}file1\textgreater{} & \{\{ac\}\}Rend \textless{}file1\textgreater{} executable \tn % Row Count 26 (+ 2) % Row 9 \SetRowColor{white} \{\{ac\}\}./ & \{\{ac\}\}./\textless{}file1\textgreater{} & Execute \textless{}file1\textgreater{} \tn % Row Count 28 (+ 2) % Row 10 \SetRowColor{LightBackground} \{\{ac\}\}mkdir & \{\{ac\}\}mkdir \textless{}fodler\textgreater{} & \{\{ac\}\}Make Directory \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{0.82386 cm} x{1.87657 cm} x{1.87657 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Linux (cont)}} \tn % Row 11 \SetRowColor{LightBackground} \{\{ac\}\}mv & \{\{ac\}\}mv \textless{}fold1/file1\textgreater{} \{\{ac\}\}\textless{}fold2/file2\textgreater{} & \{\{ac\}\}Deplace \textless{}file1\textgreater{} dans \{\{ac\}\}\textless{}fold2\textgreater{}\{\{ac\}\} et le renomme\{\{ac\}\} \textless{}file2\textgreater{} \tn % Row Count 5 (+ 5) % Row 12 \SetRowColor{white} \{\{ac\}\}source & \{\{ac\}\}source \textless{}shell\textgreater{} & \{\{ac\}\}Source le shell \tn % Row Count 7 (+ 2) % Row 13 \SetRowColor{LightBackground} \{\{ac\}\}echo & \{\{ac\}\}echo \textless{}str\textgreater{} & \{\{ac\}\}Print \textless{}str\textgreater{} \tn % Row Count 9 (+ 2) % Row 14 \SetRowColor{white} \{\{ac\}\}setxkbmap fr & \{\{ac\}\}setxkbmap fr & \{\{ac\}\}Passe le clavier en azerty \tn % Row Count 12 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{\{\{ac\}\}Liste commande de base linux} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.96117 cm} x{1.51041 cm} x{2.10542 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Linux (suite)}} \tn % Row 0 \SetRowColor{LightBackground} \{\{ac\}\}setxkb,qp fr & \{\{ac\}\}setxkb,qp fr & \{\{ac\}\}Passe \{\{ac\}\}le clavier en \{\{ac\}\}azerty \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{ac\}\}cat & \{\{ac\}\}cat \textless{}file\textgreater{} & \{\{ac\}\}Affiche le contenue de \textless{}file\textgreater{} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \{\{ac\}\}touch & \{\{ac\}\}touch \textless{}file\textgreater{} & \{\{ac\}\}Créé un fichier \textless{}file\textgreater{} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \{\{ac\}\}gedit & \{\{ac\}\}gedit \textless{}file\textgreater{} & \{\{ac\}\}Edite \textless{}file\textgreater{} \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \{\{ac\}\}nano & \{\{ac\}\}Idem & \{\{ac\}\}Idem\{\{ac\}\} \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} \{\{ac\}\}lsusb & \{\{ac\}\}lsusb & \{\{ac\}\}Liste les usb \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} \{\{ac\}\}python & \{\{ac\}\}python \{\{ac\}\}\textless{}file.py\textgreater{} & \{\{ac\}\}Execute le programme python \textless{}fle.py\textgreater{} \tn % Row Count 16 (+ 3) % Row 7 \SetRowColor{white} \{\{ac\}\}grep & \{\{ac\}\}\textless{}commande\textgreater{} | grep \textless{}str\textgreater{} & \{\{ac\}\}N'affiche que \{\{ac\}\}les lignes contenannt \textless{}str\textgreater{} \tn % Row Count 19 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.05271 cm} x{1.78503 cm} x{1.73926 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Python (suite)}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}ctrl+D & \{\{nl\}\}\{\{ac\}\}ctrl+D & \textasciicircum{}\{\{ac\}\}Quitte une instance python\textasciicircum{} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}import & \{\{nl\}\}\{\{ac\}\}import \textless{}library\textgreater{} & \textasciicircum{}\{\{ac\}\}Import le module\textasciicircum{} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}os & \{\{nl\}\}\{\{ac\}\}import os & \textasciicircum{}\{\{ac\}\}Interaction avec l'OS\textasciicircum{} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}os.system & \{\{nl\}\}\{\{ac\}\}os.system('\textless{}cmd\textgreater{}') & \textasciicircum{}\{\{ac\}\}Execute \textless{}cmd\textgreater{} comme \{\{ac\}\}dans \{\{ac\}\}un shell\textasciicircum{} \tn % Row Count 11 (+ 4) % Row 4 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}os.popen & \{\{nl\}\}\{\{ac\}\}os.popen('\textless{}cmd\textgreater{}').read() & \textasciicircum{}\{\{ac\}\}Idem mais récupère la sortie\textasciicircum{} \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}os.listdir() & \{\{nl\}\}\{\{ac\}\}os.listdir(os.curdir) & \textasciicircum{}\{\{ac\}\}Liste les fichiers du dossier courant\textasciicircum{} \tn % Row Count 17 (+ 3) % Row 6 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}split() & \{\{nl\}\}\{\{ac\}\}\textless{}str\textgreater{}.split(\textless{}char\textgreater{}) & \textasciicircum{}\{\{ac\}\}Retourne une liste\{\{ac\}\} de str\{\{ac\}\} obtenue en\{\{ac\}\} splittant\{\{ac\}\} selon \textless{}char\textgreater{}\textasciicircum{} \tn % Row Count 24 (+ 7) % Row 7 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}replace() & \{\{nl\}\}\{\{ac\}\}\textless{}str\textgreater{}.replace(\textless{}str1\textgreater{},\textless{}str2\textgreater{})) & \textasciicircum{}\{\{ac\}\}Remplace les \{\{ac\}\}\textless{}str1\textgreater{}\{\{ac\}\} par des \{\{ac\}\}\textless{}str2\textgreater{}\textasciicircum{} \tn % Row Count 28 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{\{\{ac\}\}Fonctions élémentaires python} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.55618 cm} x{1.51041 cm} x{1.51041 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Python}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}python & \{\{nl\}\}\{\{ac\}\}python \{\{ac\}\}\textless{}file.py\textgreater{} & \textasciicircum{}\{\{ac\}\}Execute le programme python\{\{ac\}\} \textless{}file.py\textgreater{}\textgreater{}\textasciicircum{} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}python2.7 & \{\{nl\}\}\{\{ac\}\}python2.7 \{\{ac\}\}\textless{}file.py\textgreater{} & \textasciicircum{}\{\{ac\}\}Execute avec la version 2.7 de python\textasciicircum{} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}python3 & \{\{nl\}\}\{\{ac\}\}python3 \textless{}file.py\textgreater{} & \textasciicircum{}\{\{ac\}\}Idem avec python 3\textasciicircum{} \tn % Row Count 11 (+ 3) % Row 3 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}python -{}-version & \{\{nl\}\}\{\{ac\}\}python -{}-version & \textasciicircum{}\{\{ac\}\}Retourne la version de python utilisée\textasciicircum{} \tn % Row Count 15 (+ 4) % Row 4 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}sudo \{\{ac\}\}apt-get install python-pip & \{\{nl\}\}\{\{ac\}\}sudo apt-get install python-pip & \textasciicircum{}\{\{ac\}\}Installe pip\textasciicircum{} \tn % Row Count 19 (+ 4) % Row 5 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}pip install & \{\{nl\}\}\{\{ac\}\}pip install \{\{ac\}\}\textless{}library\textgreater{} & \textasciicircum{}\{\{ac\}\}Installe une \seqsplit{bibliothèque} python\textasciicircum{} \tn % Row Count 23 (+ 4) % Row 6 \SetRowColor{LightBackground} \{\{nl\}\}\{\{ac\}\}pip freeze & \{\{nl\}\}\{\{ac\}\}pip freeze & \textasciicircum{}\{\{ac\}\}Liste les \seqsplit{bibliothèques} python installées\textasciicircum{} \tn % Row Count 27 (+ 4) % Row 7 \SetRowColor{white} \{\{nl\}\}\{\{ac\}\}python & \{\{nl\}\}\{\{ac\}\}python & \textasciicircum{}\{\{ac\}\}Lance une instance python\textasciicircum{} \tn % Row Count 30 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{\{\{ac\}\}Fonctions élémentaires python} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.55618 cm} x{1.51041 cm} x{1.51041 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{MQTT}} \tn % Row 0 \SetRowColor{LightBackground} \{\{ac\}\}sudo apt-get install mosquitto & \{\{ac\}\}sudo apt-get install mosquitto & \{\{ac\}\}Installe le broker MQTT mosquitto \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{ac\}\}sudo apt-get install \seqsplit{mosquitto-client} & \{\{ac\}\}sudo apt-get \{\{ac\}\}install \{\{ac\}\}mosquitto-client & \{\{ac\}\}Installe le client MQTT mosquitto \tn % Row Count 8 (+ 5) % Row 2 \SetRowColor{LightBackground} \{\{ac\}\}mosquitto\_sub & \{\{ac\}\}mosquitto\_sub \{\{ac\}\}-t \textless{}test/\#\textgreater{} \{\{ac\}\} -h \textless{}host\textgreater{} & \{\{ac\}\}Souscrit aux sous-topics du topic \textless{}test\textgreater{} sur l'adresse de \textless{}host\textgreater{} \tn % Row Count 14 (+ 6) % Row 3 \SetRowColor{white} \{\{ac\}\}mosquitto\_pub -m -t -h & \{\{ac\}\}mosquitto\_pub -m \textless{}msg\textgreater{} -t \textless{}topic/st\textgreater{} -h \textless{}host\textgreater{} & \{\{ac\}\}Envoi \{\{ac\}\}\textless{}msg\textgreater{} \{\{ac\}\}sur le sous-topic \textless{}st\textgreater{} du topic \{\{ac\}\}\textless{}topic\textgreater{} \{\{ac\}\}de l'hôte \{\{ac\}\}\textless{}host\textgreater{} \tn % Row Count 23 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{Commandes de base MQTT} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.82386 cm} x{1.3731 cm} x{2.38004 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Réseau}} \tn % Row 0 \SetRowColor{LightBackground} \{\{ac\}\}ifconfig & \{\{ac\}\}ifconfig & \{\{ac\}\}Liste les ip de la machine sur chaque réseaux \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{ac\}\}iwconfig & \{\{ac\}\}iwconfig & \{\{ac\}\}Liste les réseaux auxquels la machine est connectée \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \{\{ac\}\}ping & \{\{ac\}\}ping \textless{}ip\textgreater{} & \{\{ac\}\}Lance requête ping sur \textless{}ip\textgreater{} \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} \{\{ac\}\}ping & \{\{ac\}\}ping \{\{ac\}\}\textless{}site\textgreater{} & \{\{ac\}\}affiche l'IP de \textless{}site\textgreater{} \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} \{\{ac\}\}curl & \{\{ac\}\}curl \{\{ac\}\}\textless{}site\textgreater{} & \{\{ac\}\}récupère contenue du site\{\{ac\}\}Par exemple curl ifconfig.me \{\{ac\}\}(IP publique) \tn % Row Count 15 (+ 5) % Row 5 \SetRowColor{white} \{\{ac\}\}nmtui & \{\{ac\}\}nmtui & \{\{ac\}\}Gestion des connections réseaux \tn % Row Count 17 (+ 2) % Row 6 \SetRowColor{LightBackground} \{\{ac\}\}ssh & \{\{ac\}\}ssh \textless{}user\textgreater{}@ip & \{\{ac\}\}Créé une connection ssh de \textless{}user\textgreater{} sur \textless{}ip\textgreater{} \tn % Row Count 20 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}