turn num lock on at startup

install numlockx and edit config:

vim /etc/mdm/Init/Default
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on

source: http://unix.stackexchange.com/questions/275474/turn-on-numlock-on-startup-in-linux-mint


custom python3.x install (on mint)

follow instructions from: http://grahamwideman.wikispaces.com/Python-+Installation+on+Linux

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.

source: https://coderwall.com/p/agmblq/bash-function-for-extract-every-archive-with-one-word

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