Configurar msmtp para enviar correo mediante GMail desde el terminal

Otra alternativa para enviar correos electrónicos desde el terminal sin necesidad de tener instalado un servidor de correo. Su configuración es incluso más sencilla que con ssmtp. Si tenemos instalado ssmtp deberemos desinstalarlo para poder instalar msmtp. Instalamos mstmp-mta Instalamos el paquete msmtp-mta desde los repositorios y editamos el fichero de configuración ~/.msmtprc: defaults logfile ~/msmtp.log account gmail auth on host smtp.gmail.com from example@gmail.com auth on tls on tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt user example@gmail.com password secret port 587 account default : gmail Le cambiamos los permisos: ...

June 4, 2014 · 1 min · 134 palabras · Nacho Cano

ASCII Chart

The American Standard Code for Information Interchange (ASCII) was developed under the auspices of a committee of the American Standards Association, called the X3 committee, by its X3.2 (later X3L2) subcommittee, and later by that subcommittee’s X3.2.4 working group. The ASA became the United States of America Standards Institute or USASI and ultimately the American National Standards Institute. » Charles Torvalds | askapache.com

June 1, 2014 · 1 min · 63 palabras · Nacho Cano

Obtener el listado de rangos de IPs asociados a un dominio

Si queremos obtener el listado de rangos de IPs que puedan estar asociadas a un dominio, por ejemplo para bloquearlo, podemos ejecutar: $ IP=$(dig +short www.example.com | grep -Eo '([0-9]{1,3}\.?){4}' | head -1) $ AS=$(whois $IP | awk '/OriginAS/{print $2}') $ test -n "$AS" && whois -h whois.radb.net '!g'$AS | tr -d "\n" | tr " " "\n" | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 En la primera línea, obtenemos la IP asociada al dominio. En la segunda, obtenemos el registro origin, el cual utilizamos en la tercera línea para consultar a whois.radb.net el rango de IPs y mostrar las IPs una por línea. ...

June 1, 2014 · 1 min · 154 palabras · Nacho Cano

The Forgotten History Of CGI

The roots of CGI lie in the first mechanical aids to drawing and painting. The earliest of these were developed to help solve a problem every artist has found to be sticky: perspective. Before the introduction of geometric perspective, the realistic depiction of nature was not one of the purposes of art. Instead, artists chose the size and position of objects in a picture by their relative importance to one another. A distant castle might appear to be larger than one in the foreground simply because it was considered more important. ...

May 31, 2014 · 1 min · 96 palabras · Nacho Cano

The Golden Age of Basic

I remember my first program, by which I mean one that I cobbled together myself, not simply typing in a complete listing from the manual. I was twelve, the year was 1985, and the computer a Texas Instruments TI-99/4A (a machine which was actually the first 16-bit home computer). My program was a very simple text adventure game, created by chaining together as many IF¦ THEN GOTO statements as I had patience for. ...

May 31, 2014 · 1 min · 78 palabras · Nacho Cano

Programming Sucks

Every friend I have with a job that involves picking up something heavier than a laptop more than twice a week eventually finds a way to slip something like this into conversation: ”Bro,1 you don’t work hard. I just worked a 4700-hour week digging a tunnel under Mordor with a screwdriver.” They have a point. Mordor sucks, and it’s certainly more physically taxing to dig a tunnel than poke at a keyboard unless you’re an ant. But, for the sake of the argument, can we agree that stress and insanity are bad things? Awesome. Welcome to programming. ...

May 31, 2014 · 1 min · 102 palabras · Nacho Cano

Enviar y reicibir notificaciones de Telegram desde la línea de comandos

Utilizando tg, podemos enviar y recibir mensajes de nuestros contactos en Telegram, incluyéndonos a nosotros mismos, desde el terminal. Envíos programados Combinándolo con expect, conseguiremos una forma sencilla de programar notificaciones. He aquí un pequeño ejemplo: #!/usr/bin/env bash function tg { # First argument, if any, must be the receiver local to="$1" local msg="" local cmd="" if [ $# -gt 1 ]; then shift 1 msg="$@" else while read line; do if [ -z "$msg" ]; then msg=$line else msg="$msg\n$line" fi done if [ -z "$to" ]; then to=$(awk '{print $1}' <<< $msg) msg=$(awk '{$1="";print $0}' <<< $msg) fi fi if [[ $msg =~ "\n" ]]; then file=$(mktemp) echo -e "$msg" > $file cmd="send_text $to $file" else cmd="msg $to $msg" fi #echo $cmd expect -c " log_user 0 match_max 100000 spawn /path/to/telegram -k /path/to/tg-server.pub expect \"User \" send -- \"$cmd\r\" expect \"Sent\" send \"quit\" " } tg $@ Algunos ejemplos de uso: ...

May 31, 2014 · 3 min · 432 palabras · Nacho Cano

Programming is social

Programming is social, too. Most people think it’s not. With assistance from media portrayals of programmers and sloppy stereotypes of our own, they think most of us would prefer to work alone in the dark. Some do, of course, but even then most programmers I know like to talk shop with other programmers all the time. They like to talk about the places where they are stuck, as well as the places they used to be stuck. War stories are the currency of the programmer community. ...

May 31, 2014 · 1 min · 95 palabras · Nacho Cano

Unsafe cookies leave WordPress accounts open to hijacking, 2-factor bypass

Yan Zhu, a staff technologist at the Electronic Frontier Foundation, came to that determination after noticing that WordPress servers send a key browser cookie in plain text, rather than encrypting it, as long mandated by widely accepted security practices. The cookie, which carries the tag ”wordpress_logged_in,” is set once an end user has entered a valid WordPress user name and password. It’s the website equivalent of a plastic bracelets used by nightclubs. Once a browser presents the cookie, WordPress servers will usher the user behind a velvet rope to highly privileged sections that reveal private messages, update some user settings, publish blog posts, and more. The move by WordPress engineers to allow the cookie to be transmitted unencrypted makes them susceptible to interception in many cases. ...

May 26, 2014 · 1 min · 131 palabras · Nacho Cano

netcat - Cycles Per Instruction

Welcome to the most unnecessarily complicated netcat album release format yet. In this repository, you will be able to compile your own kernel module, create a /dev/netcat device and redirect its output into an audio player (tested with mplayer and play from SoX as well). ogg123 - < /dev/netcat ;’ Brandon Lucia, Andrew Olmstead, and David Balatero github.com

May 25, 2014 · 1 min · 58 palabras · Nacho Cano