Downloading all files from a folder with wget

Posted: December 19, 2014 in CLI, Linux
Tags: ,

So you want to download all those [your favorite tv show here] videos from that nice index page.

Here’s what you do:

wget -c -r –no-directories –no-parent

-c – means “continue”, or resume
-r – means recursive
–no-directories – means wget won’t clone the website directory tree
–no-parent – means it won’t get files from parent folders

Batch resizing images in CLI

Posted: November 17, 2014 in CLI, Linux, Ubuntu

Make sure you have installed Image Magic

sudo apt-get install imagemagick

And then, from the command line:

mogrify -resize 50% *png      # keep image aspect ratio
mogrify -resize 320x240 *png  # keep image aspect ratio
mogrify -resize 320x240! *png # don't keep image aspect ratio
mogrify -resize x240 *png     # don't keep image aspect ratio
mogrify -resize 320x *png     # don't keep image aspect ratio

Terminal commands:

# Update system:
sudo apt-get update 
sudo apt-get upgrade

# Restricted extras: 
sudo apt-get install ubuntu-restricted-extras

# CCSM: 
sudo apt-get install compizconfig-settings-manager

# if youuse gnome
sudo apt-get install gnome-tweak-tool

If you use unit (please do not):

# Unity Tweak Tool: 
sudo apt-get install unity-tweak-tool

# ClassicMenu Indicator:
sudo add-apt-repository ppa:diesch/testing
sudo apt-get update
sudo apt-get install classicmenu-indicator

#Disable Overlay Scrollbars: 
gsettings set com.canonical.desktop.interface scrollbar-mode normal

Other commands

# Java:
sudo apt-get install icedtea-7-plugin openjdk-7-jre

# Flash Player:
sudo apt-get install flashplugin-installer

Awesome tips that I [mostly] got from the Ubuntu Help Guy

You have foo.rb open in your feature branch and you want to check how this file was on the mater branch?

Do this:

:Gedit master:foo.rb


:Gedit [branchname or commit hash]:filename


Use the “%” symbol for using the path of the current file:

:Gedit master:%
git remote prune origin

Moving windows arround with tmux

Posted: July 2, 2014 in Uncategorized

Moving current window to the position 0:

Ctrl + B + : (to enter command mode)

move-window -t 0

The tip was found here.

Hi there.

I’ve been willing to practice pair program. Since that is not something I can achieve in my current job, my goal is to do that remotely with anyone who is willing to work on any open source project.

If you are interested, please get in touch. I am a Ruby/PHP/Javascript programmer and I am all into TDD/BDD, so if you have tested code that would be awesome. Comfortable with VIM would be a plus, since working on the terminal seems easier/faster.

If you have a open project you are working on, please send me the project url so I can have an idea about what that is and how that works (or is supposed to). If you don’t, perhaps we could contribute to some awesome open source project out there, such as Rails, Devise, Zend Frameork or what have you, perhaps fixing some bugs.

I intend to be available every Monday from 23:00 to 00:00 (GMT-03:00).

See ya.

I just found a great alternative to the following command:

mv /tmp/a/b/c /tmp/a/b/d

Well, turns out there is a short hand alternative for accomplishing the same result:

mv /tmp/a/b/{c,d}



# service mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql --user=root mysql

MYSQL> update user set Password=PASSWORD('new-password') where user='root';
MYSQL> flush privileges;
MYSQL> exit;

# service mysqld restart

This is the source.

sudo mkdosfs -n 'Label' -I /dev/sdX