Upload file FTP via curl

curl -T my-local-file.txt ftp://ftp.example.com --user user:secre
From here


Extract text from PDF, from the command line

pdfs-512pdftotext is a command line tool for converting PDF files to plain text. Included by default with many Linux distributions.

$ pdftotext file.pdf

The gs (Ghostscript) program can also handle the process:
$ gs -sDEVICE=txtwrite -o extractedText.txt input.pdf

View a “table” via the Linux command line

It’s very common to use the “less” command to view a table, maybe with the “-x 20” parameter to have a smaller chance of misaligned columns, but Google gave me much better way to view CSV (or TSV) files:

column -s, -t < file.csv | less -#2 -N -S

As you can see the “column” command allows to be customized in terms of field separator and much more.

Lightweight browser: small footprint but opening GMail

When in a need for a responsive browser I thought to be limited in my choice among fully featured browsers (Chromium) that nicely support javascript and HTML5, or stripped down crashing things (Arora, Midori?)…

Found a couple of alternatives:

  • QupZilla: it is fully featured… but in my hands still too crashy
  • uzbl (http://www.uzbl.org/): blazing fast, fully featured browsing, zero features browser (type the address with a sort of vi-like console!)

Alternative shell interfaces in Ubuntu Linux

Faster than default Gnome-terminal, they can be installed via repository. They run under X and don’t require Gtk or Qt libraries…

1) xterm, is quite fast. I use it as a nice replacement with this shortcut:

xterm -fs 11 -fa "Courier 10 Pitch"

2) mrxvt is very fast, with nice tabs. I run it in default configuration, without antialiasing or background to keep good performance.

Tab complete for SSH

This snippet from .bashrc/.bash_profile was gifted from Marcel Molina, but I thought I would share because it’s life changing. Put this in your .bashrc or .bash_profile:

SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | \
cut -f 1 -d ‘ ’ | \
sed -e s/,.*//g | \
uniq | \
egrep -v [0123456789]) )
 complete -o default -W ”${SSH_COMPLETE[*]}” ssh