custom python3.x install (on mint)

follow instructions from:

note the following:

  • use (latest) python version that you want
  • use configure prefix path valid for your version
  • make install for adding binaries to /bin (adding to $PATH variable) and make altinstall for side-by-side install
  • create link:
    ln -s /opt/python3.5/bin/python3.5 /usr/local/bin/python3.5
  • need to compile libraries as well… to be continued

bash extract function

it’s convenient to define this function in your bashrc, s.t. you dont have to think of all the different file formats while extracting.


function extract()
     if [ -f $1 ] ; then
         case $1 in
                tar xvjf $1     
                tar xvJf $1
                tar xvzf $1     
                bunzip2 $1      
                unrar x $1      
                gunzip $1       
                tar xvf $1      
                tar xvjf $1     
                tar xvzf $1     
                unzip $1        
                uncompress $1   
                7z x $1         
                echo "'$1' cannot be extracted via extract" 
        echo "'$1' is not a valid file"

pdf editing

install the following program: pdftk

  • simple cutting: pdftk myDocument.pdf cat 1-9 26-end output removedPages.pdf
  • cutting multiple files: pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf
  • viewing + editing pdf metadata:
    • view: pdftk input.pdf dump_data output metadata.txt
    • edit: vim metadata.txt
    • make consistent: pdftk input.pdf update_info metadata.txt output output.pdf

Create random + pronouncable passwords on linux

$ pwgen

pwgen is another utility that is just a quick installation away with the command sudo apt-get install pwgen. Simply running the command pwgen will flood your terminal with many passwords, so you’re just supposed to pick one at random (preferrably not the first or last one). This is done in case someone is nearby or looking over your shoulder — that way they won’t know which password you’ve chosen out of the many that are displayed.

You can also use these flags:

  • -1: Gives you just one password rather than an entire screen full of them.
  • -s: Uses a different algorithm to make it even more secure.
  • -y: Add special characters to the provided password.
  • -0: Don’t include numbers.
  • -B: Don’t use characters that are hard to read, such as 1 I l or 0 O
  • -v: Don’t allow any vowels. This is primarily used if the website doesn’t allow offensive language to be used in passwords.