\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{luis0202} \pdfinfo{ /Title (firewall-y-monitorizacion.pdf) /Creator (Cheatography) /Author (luis0202) /Subject (Firewall y Monitorizacion 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}{66CCC5} \definecolor{LightBackground}{HTML}{EBF8F7} \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{Firewall y Monitorizacion Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{luis0202} via \textcolor{DarkBackground}{\uline{cheatography.com/56657/cs/14996/}}} \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}luis0202 \\ \uline{cheatography.com/luis0202} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 6th March, 2018.\\ 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.24425 cm} x{3.73275 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Fuser}} \tn % Row 0 \SetRowColor{LightBackground} Fuser & Identifica que procesos están utilizando un fichero o carpeta determinada \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} fuser -a & Muestra todos los archivos especificados \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} fuser -i & Pregunta antes de matar un proceso \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} fuser -k & Mata el proceso que accede al fichero \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} fuser -l & Muestra los procesos que utilizan un sistema de archivos o unidad de bloque \tn % Row Count 12 (+ 3) % Row 5 \SetRowColor{white} fuser -n & Selecciona un nombre de espacio diferente \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} fuser -s & Silenciar operacion \tn % Row Count 15 (+ 1) % Row 7 \SetRowColor{white} fuser -SIGNAL & Utilizar una señal diferente \tn % Row Count 17 (+ 2) % Row 8 \SetRowColor{LightBackground} fuser -u & Muestra usuarios que ejecuta el prceso \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} fuser -v & Muestra salida detallada \tn % Row Count 20 (+ 1) % Row 10 \SetRowColor{LightBackground} fuser -w & Mata solo procesos que tenga acceso de escritura \tn % Row Count 22 (+ 2) % Row 11 \SetRowColor{white} fuser -V & Muestra informacion sobre la version \tn % Row Count 24 (+ 2) % Row 12 \SetRowColor{LightBackground} fuser -4 & Busca unicamente sockets IPv4 \tn % Row Count 25 (+ 1) % Row 13 \SetRowColor{white} fuser -6 & Busca unicamente sockets IPv6 \tn % Row Count 26 (+ 1) % Row 14 \SetRowColor{LightBackground} fuser - & Resetea las opciones y configura la señal a SIKGKILL \tn % Row Count 28 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Top}} \tn % Row 0 \SetRowColor{LightBackground} top & Muestra procesos de ejecucion del sistema \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} top -h & Muestra versión de la libreria \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} top -d & Especifica cada cuantos sg actualiza \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} top -n & Nº total de interacciones antes de cerrarse \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{htop}} \tn % Row 0 \SetRowColor{LightBackground} htop -d & Configurar tiempo entre actualizaciones \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} htop -s & Ordenar segun nombre de columna \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} htop -u & Mostrar procesos de un determinado usuario \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} htop -p & Mostrar procesos especificos segun el PID \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{1.04517 cm} x{3.93183 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{bmon}} \tn % Row 0 \SetRowColor{LightBackground} bmon & Uso de interfaces \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} bmon g & Estadisticas en grafico \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} bmon d & Estadisticas en detalle \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} bmon i & Información adiccional \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Speedometer}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Speedometer} -rx & Monitorizar entrada de datos en ese interfaz de red \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Speedometer} -tx & Monitorizar la salida de datos en ese interfaz de red \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Firewall}} \tn % Row 0 \SetRowColor{LightBackground} ufw status & Estado firewall \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} ufw allow ssh & Permitir SSH al firewall \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} ufw allow 25000/tcp & Abrir puerto especifico \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} ufw dissable & Deshabilitar firmware \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} ufw enable & Habilitar firmware \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} ufw default deny & Capar el trafico que entra de fuera \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} ufw app list & Listar aplicaciones disponibles \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} ufw delete allow 25000 & Borrar regla creada \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} ufw delete 7 & Borrar regla nombre/numero \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} ufw reset & Borrar todas las reglas \tn % Row Count 15 (+ 1) % Row 10 \SetRowColor{LightBackground} ufw status numbered & Listar la reglas \tn % Row Count 17 (+ 2) % Row 11 \SetRowColor{white} ufw status verbose & Mostrar configuración completa \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{lsof}} \tn % Row 0 \SetRowColor{LightBackground} lsof & Listar archivos abierto en el sistema \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} lsof -p \textless{}proceso\textgreater{} & Listar los ficheros abiertos de un determinado proceso \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} lsof /particion & Listar os ficheros abiertos en una particion \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} lsof -u /usuario & Listar los ficheros abiertos de un determinado usuario \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} lsof -i & Ver actividad de red en tiempo real \tn % Row Count 12 (+ 2) % Row 5 \SetRowColor{white} lsof -P -i -n & Ver actividad en red del momento en los que lo ejecutamos \tn % Row Count 15 (+ 3) % Row 6 \SetRowColor{LightBackground} lsof -i -nP & Comprobar servicios/puertos que están escuchando \tn % Row Count 18 (+ 3) % Row 7 \SetRowColor{white} lsof -u foo -a +D /tmp & Archivos en uso por un usuario en un directorio concreto \tn % Row Count 21 (+ 3) % Row 8 \SetRowColor{LightBackground} lsof +D \seqsplit{/directorio.ruta} & Visualizar archivos abiertos de un directorio/path concreto \tn % Row Count 24 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.64241 cm} x{3.33459 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{du / df}} \tn % Row 0 \SetRowColor{LightBackground} du -h {[}ruta{]} & Cantidad de espacio que determinados archivos/directorios estan consumiendo \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} du -ch {[}ruta{]} {[}ruta{]} & Misma informacion du -h pero de varios directorios \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} df -h & Información de las particiones \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} df -hT & Sistema de archivos de cada particion \tn % Row Count 9 (+ 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}{netstat}} \tn % Row 0 \SetRowColor{LightBackground} netstat -putona & Muestra las conexiones entrantes y salientes de los procesos \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} netstat -a & Lista todos los puertos (TCP/UDP) \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} netstat -l & Lista solo los puertos en escucha (TCP/UDP) \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} netstat -s & Lista solo los puertos en escucha (TCP/UDP) \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} netstat -at & Lista solo conexiones TCP \tn % Row Count 10 (+ 1) % Row 5 \SetRowColor{white} netstat -st & Lista solo estadísticas TCP \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} netstat -lt & Lista solo los puertos TCP en escucha \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} netstat -au & Lista solo conexiones UDP \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} netstat -su & Lista solo estadísticas UDP \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} netstat -lu & Lista solo los puertos UDP en escucha \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} netstat -F & Muestra el nombre del dominio si es posible para cada ip \tn % Row Count 22 (+ 3) % Row 11 \SetRowColor{white} netstat -pt & Muestra PID y nombres de program \tn % Row Count 24 (+ 2) % Row 12 \SetRowColor{LightBackground} netstat -i & Muestra una lista de interfaces de red \tn % Row Count 26 (+ 2) % Row 13 \SetRowColor{white} netstat -ap | grep shh & Busca un programa y te dice que puerto esta ejecutando \tn % Row Count 29 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{ps}} \tn % Row 0 \SetRowColor{LightBackground} ps -A -e & Todos los procesos \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ps -a & Todos los procesos con tty exceptos los procesos padres \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ps a & Todos los procesos con tty incluyendo otros usuarios \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} ps -d & Todos excepto los procesos padres \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} ps -N & Quitar de la seleccion \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} ps r & Unicamente procesos en marcha \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} ps T & Todos los procesos del terminal \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} ps x & Procesos excluyendo ttys \tn % Row Count 11 (+ 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}{iotop}} \tn % Row 0 \SetRowColor{LightBackground} iotop & Carga de trabajo que genera cada proceso \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} iotop -{}-only & Solo los procesos activos \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} iotop -n & Nº de interacciones antes de ser finalizado \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} iotop -d & Segundos de revison antes de parar \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} iotop -k & Ver el tamaño en kilobytes \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} r & Cambiamos orden ascendente o descendente \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} q & salir \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}