\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{JordiAlm} \pdfinfo{ /Title (arnaljordi-cheatsheet.pdf) /Creator (Cheatography) /Author (JordiAlm) /Subject (ArnalJordi\_Cheatsheet 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}{FF0F0F} \definecolor{LightBackground}{HTML}{FFF0F0} \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{ArnalJordi\_Cheatsheet Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{JordiAlm} via \textcolor{DarkBackground}{\uline{cheatography.com/96596/cs/20838/}}} \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}JordiAlm \\ \uline{cheatography.com/jordialm} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 18th October, 2019.\\ Updated 25th February, 2020.\\ 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{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{NFS Paquetes y comandos}} \tn % Row 0 \SetRowColor{LightBackground} paquete \seqsplit{nfs-kernel-server} & paquete nfs servidor \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} nfs-common & paquete nfs cliente \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} mkdir "carpeta compartir" & crear carpeta para compartir \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} exportfs -a & actualizar fichero exports \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} mkdir "carpeta cliente" & crear carpeta donde se alojaran los archivos en el cliente \tn % Row Count 10 (+ 3) % Row 5 \SetRowColor{white} windows nfs & caracteristicas de windows \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{APK Y CMDS CUOTAS DE DISCO}} \tn % Row 0 \SetRowColor{LightBackground} useradd -m usuario & crear usuario para cuotas \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} quota y quotatool & paquetes para las cuotas \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} /etc/fstab & uuid=raiz / ext4 defaults,usrquota,grpquota 0 1 \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} mount -o remount, rw / & remontar la raiz \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} quotacheck -ugmv / & crear, verificar o reparar control cuotas \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} edquota -u {[}usuario{]} & nos lleva al fichero del usuario para controlar los warninggs y topes \tn % Row Count 13 (+ 3) % Row 6 \SetRowColor{LightBackground} blando/soft & warning \tn % Row Count 14 (+ 1) % Row 7 \SetRowColor{white} duro/hard & tope gb \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} repquota / & listar cuotas de usuarios/grupos \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} - & - \tn % Row Count 18 (+ 1) % Row 10 \SetRowColor{LightBackground} windows & propiedades disco duro - cuotas \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{FICHEROS,paquetes y cmds SAMBA}} \tn % Row 0 \SetRowColor{LightBackground} apk samba & serivdor \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} apk samba-common & cliente \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} useradd -m nombre & añadir usuario \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} smbpasswd -a usuario & añadir usuario (arriba) \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} mkdir "carpeta" & carpeta a compartir \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} chmod 750 carpeta & cambiar permisos \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} chown usuario carpeta & cambiar permisos carpeta al usuario nuevo \tn % Row Count 10 (+ 3) % Row 7 \SetRowColor{white} testparm & verificar si la config es correcta \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} systemctl restart smbd & reiniciar servicio samba \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} /etc/samba/smb.conf -\textgreater{} fichero cofniguracion samba & -\textgreater{} fichero cofniguracion samba \tn % Row Count 17 (+ 3) % Row 10 \SetRowColor{LightBackground} workgroup & \seqsplit{nombre\_grupo\_trabajo} \tn % Row Count 18 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{5.377cm}}{{[}grupo\_trabajo{]}} \tn % Row Count 19 (+ 1) % Row 12 \SetRowColor{LightBackground} comment & cmentario \tn % Row Count 20 (+ 1) % Row 13 \SetRowColor{white} path & ruta carpeta compartida \tn % Row Count 22 (+ 2) % Row 14 \SetRowColor{LightBackground} read only & yes/no \tn % Row Count 23 (+ 1) % Row 15 \SetRowColor{white} writeable & yes/no \tn % Row Count 24 (+ 1) % Row 16 \SetRowColor{LightBackground} browseable & yes/no \tn % Row Count 25 (+ 1) % Row 17 \SetRowColor{white} valid users & usuarios validos \tn % Row Count 26 (+ 1) % Row 18 \SetRowColor{LightBackground} write list & usuarios escritura \tn % Row Count 27 (+ 1) % Row 19 \SetRowColor{white} read list & usuarios lectura \tn % Row Count 28 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.14471 cm} x{3.83229 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{NFS FICHEROS}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{/etc/exports} & configuracion carpetas compartidas nfs \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{/etc/fstab} & ip:/ruta-servidor/ /ruta-/cliente/ nfs rw,sync 0 0 \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{LVM FICHEROS, COMANDOS Y PAQUETES}} \tn % Row 0 \SetRowColor{LightBackground} dd if=/dev/zero of=/ruta/swap bs=*k count=x & crear archivo con peso \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} chmod & modificar permisos fichero (600) \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} swapoff/on /var/swap & desactivar swap \tn % Row Count 6 (+ 1) % Row 3 \SetRowColor{white} mkswap /var/swap & establecer memoria de intercambio \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} swapon /var/swap & activar memoria swap \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} swapon -s & listar memoria swap \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} fstab & /var/swap none swap sw 0 0 \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} - & - \tn % Row Count 13 (+ 1) % Row 8 \SetRowColor{LightBackground} vgdisplay & ver grupo volumenes \tn % Row Count 14 (+ 1) % Row 9 \SetRowColor{white} fdisk -l & listar nuevos discos \tn % Row Count 15 (+ 1) % Row 10 \SetRowColor{LightBackground} fdisk /disco/duro & seleccionar disco duro (recordad aplicar tipo lvm) \tn % Row Count 18 (+ 3) % Row 11 \SetRowColor{white} pvcreate /disco/duro & establecer partivion como un volumen \tn % Row Count 20 (+ 2) % Row 12 \SetRowColor{LightBackground} vgextend ubuntu-vg /disco/duro & añadir el disco al grupo de volumenes \tn % Row Count 22 (+ 2) % Row 13 \SetRowColor{white} vgdisplay & listar grupo volumenes \tn % Row Count 24 (+ 2) % Row 14 \SetRowColor{LightBackground} lvscan & estado volumenes \tn % Row Count 25 (+ 1) % Row 15 \SetRowColor{white} lvextend -L +*G \seqsplit{/dev/ubuntu-vg/ubuntu-lv} & extender capacidad volumen logico \tn % Row Count 27 (+ 2) % Row 16 \SetRowColor{LightBackground} resize2fs \seqsplit{/dev/ubuntu-vg/ubuntu-lv} 16G & redimensionar el sistema de ficheros \tn % Row Count 29 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{PSSH ARCHIVOS}} \tn % Row 0 \SetRowColor{LightBackground} apt-get install openssh-server & cliente al que nos conectamos \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} apt-get install pssh & servidor desde donde nos conectamos \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ssh-keygen & crear claves publicas y privadas \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} ssh-copy-id -i \textasciitilde{}/.ssh/mykey user@host & copiar clave publica al otro cliente (esto desde el servidor \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} \seqsplit{/home/jordi/hosts.txt} & añadir maquinas a las que nos conectaremos {[}nombre@ip{]} \tn % Row Count 12 (+ 3) % Row 5 \SetRowColor{white} parallelssh -i -h /archivohosts.txt comando (ejemplo:date) & conexion con las maquiinas \tn % Row Count 15 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{COMANDOS Y APK ESCRITORIO UBUNTU SERVER}} \tn % Row 0 \SetRowColor{LightBackground} ubuntu-desktop & paquete escritorio \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} reboot & reiniciar escritorio \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} systemctl set-default multi-user.target & cuando arranque no ejecute el nuevo escritorio \tn % Row Count 5 (+ 3) % Row 3 \SetRowColor{white} systemctl isolate graphical.target & activar cuando arranque el escritorio remoto \tn % Row Count 8 (+ 3) % Row 4 \SetRowColor{LightBackground} systemctl isolate multi-user.target & salir del escritorio en el momento sin aplicacion de cambios \tn % Row Count 11 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{DOMAIN CONTROLLER CMD Y APK}} \tn % Row 0 \SetRowColor{LightBackground} ifconfig {[}n.tarjeta{]} ipnueva netmask {[}mascara{]} & cambiar ip \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} /etc/hosts & nueva linea = ipmaquina srv.nombre.server nombre.dominio dominio nombreserver \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} /etc/hosts & nueva linea = direcccionlopback " " " " \tn % Row Count 9 (+ 2) % Row 3 \SetRowColor{white} samba krb5-config winbind smbclient & paquetes dominio \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} samba-tool domain provision & configuracion samba \tn % Row Count 13 (+ 2) % Row 5 \SetRowColor{white} systemctl disable smbd nmbd winbind systemd-resolved & desactivar servicios para compatibilidad \tn % Row Count 16 (+ 3) % Row 6 \SetRowColor{LightBackground} systemctl unmask samba-ad-dc & desenmascarar el servicio de controlador de dominiio de sambva \tn % Row Count 20 (+ 4) % Row 7 \SetRowColor{white} /etc/resolv.conf & domain dominio / nameserver ipserver \tn % Row Count 22 (+ 2) % Row 8 \SetRowColor{LightBackground} systemctl start samba-ad-dc & iniciar el ctl de samba-ad-dc \tn % Row Count 24 (+ 2) % Row 9 \SetRowColor{white} systemctl enable samba-ad-dc & activar servicio samba-ad-dc \tn % Row Count 26 (+ 2) % Row 10 \SetRowColor{LightBackground} samba-tool user create user1 & crear usuario dominio \tn % Row Count 28 (+ 2) % Row 11 \SetRowColor{white} smbclient //ipserver/netlogon -U user1 & loguarse con el usuario dentro del servidor \tn % Row Count 31 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Claves y distribucion}} \tn % Row 0 \SetRowColor{LightBackground} ssh-keygen & crear claves (directorio alojamiento claves -\textgreater{} \seqsplit{/home/user/.ssh/id\_rsa} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} scp clave.pub \seqsplit{nombreotramaquina@ip:/ruta/destino/}.ssh & llevar las claves a la otra maquina \tn % Row Count 7 (+ 3) % Row 2 \SetRowColor{LightBackground} \seqsplit{./ssh/authorized\_keys} & fichero donde se almacenan las claves publicas para las conexiones \tn % Row Count 11 (+ 4) % Row 3 \SetRowColor{white} \seqsplit{./ssh/authorized\_keys} & cambiar permisos a 600 \tn % Row Count 13 (+ 2) % Row 4 \SetRowColor{LightBackground} ./ssh/ & cambiar permisos a 700 \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}