The 2009 COMP300E class taught at Hong Kong University of Science and Technology by Steven Skiena.


Linux / Debian / Ubuntu / ElementaryOS : Check real-time network up/down speeds in terminal

bmon is a command line utility for linux based systems to monitor the real-time upload - download network speeds on all network interfaces.

To install it on Debian based systems (read Ubuntu, Linux Mint, ElementaryOS etc.), use the command:

sudo apt-get install bmon

Here is a screenshot showing bmon in action.

bmon screenshot




When some lines of code are not running properly, then all of a sudden they run correctly despite you doing nothing to them…



(Source: macro-hatch)


How to use pip behind a proxy

Use the following command for getting pip to do network related operations via a proxy

pip --proxy=username:password@proxy_server:proxy_port install pkg_name

The --proxy option can be used with all pip commands that require network, like search etc.

Tags: pip proxy python

eclipse : how to add multiple projects to the same git repo


Linux / Ubuntu : Multitask in terminal using Byobu

There are many instances when you wish that the current command being exexuted in the terminal goes to the background or that you get a second terminal to execute another command. This use case is pretty common when accessing server without a Graphical User Interface (GUI).

An extremely useful and powerful tool called Byobyu is the answer to this problem. In layman terms you can say that it is a “multi-window” terminal. While that definition is wrong on so many counts, it somehow would help the layman understand byobu.

To install byobu on debian based distributions (Ubuntu / Linux Mint etc.) use the following command:

sudo apt-get install byobu

Following are some of the useful commands for byobu

New Window - F2
Previous Window - F3
Next Window - F4
Reload Byobu - F5
Detach - F6
Scrollback Mode - F7
Re-title Window - F8
Configure Byobu - F9
Lock Termnal - F12


Android Development : Sizes of Small, Medium and Large Texts

The sizes of small, medium and large texts in sp are as below:

Small Text -> 14sp

Medium Text -> 18sp

Large Text -> 22sp

"The Debian project was started by Ian Murdock - his wifes name was Debra (I
think that’s the spelling of it - not sure) so hence forth Debian was
formed. And as such it should be pronounced “Deb-ian” and not “Dee-b-an” as
so many do :-)"

Re: What does Debian mean? (via whytheam)

(via whytheam)


Linux : How to find the actual read and write speeds of hard disk

hdparm is a command line tool to find the actual read/write speeds of hard disk. To find the read write speeds of a drive, simply exexute the following command in terminal:

sudo hdparm -tT /dev/sda

the -t flag is for read timings and -T is for write timings.

/dev/sda is the disk on which the read/write timing measurements are to be performed.

In case hdparm is not installed, you can install it via command (in debian based distros):

sudo apt-get install hdparm

Linux : How to analyse disk usage using command line

To analyse disk usage using terminal, a very handy utility exists by the name of NCurses Disk Usage. To install it, type the following in Debian based distributions (Ubuntu, Linux Mint etc)

sudo apt-get install ncdu

The most common usage of ncdu is with the options -x and -q.

-q Quiet mode, doesn’t update the screen 10 times a second while scanning, reduces network bandwidth used

-x Don’t cross filesystem borders (don’t descend into a directory which is a mounted disk)

To use the program

ncdu -x -q

Sample Screenshot