Handy Bash Commands

Standard

A few commands I use frequently but sometimes forget.

Concatenate mutliple PDF files

pdftk *.pdf cat output out.pdf

Convert a PDF page to an image

convert -density 150 input.pdf -quality 90 output.png

Batch resize images

mogrify -resize 640x480 *.{png|jpeg}

Crop an image

convert input.png -crop 0x4000 output.png

Create a GIF animation from images (10s delay, loop endlessly)

convert -delay 10 -loop 0 *.png animation.gif
Advertisements

Training a Neural Network to detect Oil Spills in Synthetic Aperture Radar Satellite Images

Image

Python

Link

Intermediate and Advanced Software Carpentry

Problem Solving with Algorithms and Data Structures using Python

 

Vim casts

Link

Vim Screencasts – vimcasts.org from Drew Neil the author of Practical Vim.

VIM video tutorials

Standard

Over the past or so year I have been heavily using `Vim` as my main text editor for Python scripting and LaTeX editing of my CV as well as taking notes from occasionally. Moreover, over the past few months I’ve added `tmux`, a terminal multiplexer similar to screen,  to my environment to get a great combination with `Zsh`. If you love the Linux terminal as I do this is a great combination. Each of these three tools is very popular and very expandable and customizable.

`Vim` has a steep learning curve and it will take a lifetime of use to master it. So if you do not like the terminal I would recommend against using vim as it is a terminal-based text editor which heavily depends on keyboard shortcuts and is not for people who like to use the mouse. However, do not be

Searching for vim will yield a variety of text and video tutorials as well hour plus long talks. Each has its own however I recently discovered TheFrugalComputerGuy on Youtube and his videos are quite easy to follow for beginners. I recommend them to everyone especially beginners. A playlist is embedded below. Another video below it is a good way to improve your vim speed by using (or not) some features.

Also, I have previously shared vim games that help learn vim in a fun way.

And of course the VimTutor is a great way to learn about vim. Simply type vimtutor in the terminal to begin your learning journey.

Anaconda Python needs cleaning every once in a while

Standard

As a user of Anaconda python I have been receiving (Ubuntu) system warnings of low free space in my home directory. Investigating what was causing this I found out that Anaconda python had several versions of each package. The overall size of the pkgs directory was 14+ GB. After cleaning it is about 3GB.

The second largest directory was my mail in Thunderbird.

So it would be wise, especially if you are limited in disk space, to clean Anaconda. The commands I used are as follows:

 
conda clean --all
conda update conda
# just to make sure nothing is broken and
# your environment is updated
source activate <your-environment>
conda update --all
conda clean --all

The Bash Hackers Wiki [link]

Link

The Bash Hackers Wiki

This wiki is intended to hold documentation of any kind about GNU Bash. The main motivation was to provide human-readable documentation and information so users aren’t forced to read every bit of the Bash manpage – which can be difficult to understand. However, the docs here are not meant as a newbie tutorial.