Archive for November, 2015

md5sum, sha1sum

November 29, 2015 Leave a comment

You always forget how to use the commands md5sum and sha1sum.


bash$ ls -al
-rw-r--r--  1 jabba users 351 Nov 29 14:55 file.iso
bash$ md5sum file.iso
ca9779174955bbaaa6652bb0844ed64f  file.iso 
bash$ md5sum file.iso >na.md5
bash$ md5sum -c na.md5
file.iso: OK
bash$ sha1sum file.iso
76004a25fc2ba41cb805f010a0f66f41e023692d  file.iso
bash$ sha1sum file.iso >na.sha1
bash$ sha1sum -c na.sha1
file.iso: OK
bash$ python2
>>> len("ca9779174955bbaaa6652bb0844ed64f")
>>> len("ca9779174955bbaaa6652bb0844ed64f")*4
>>> len("76004a25fc2ba41cb805f010a0f66f41e023692d")
>>> len("76004a25fc2ba41cb805f010a0f66f41e023692d")*4

MD5 is 128-bit, SHA1 is 160-bit. sha1sum has some stronger variations: sha224sum, sha256sum, sha384sum and sha512sum.

Categories: bash, security Tags: ,


November 28, 2015 Leave a comment

You visit some websites quite often but the focus is not put on the input field, so you need to click there each time. Google puts the focus on the input field when you want to do a query. Why can’t other sites do the same?

I got fed up so I wrote a Greasemonkey script that does the autofocus job for me. Thus, after opening such a site, I can type immediately.

You can find the script here: . The script is very simple and can be customized easily. Currently it contains 2 rules: one for Wikipedia, and one for IMDb.

monitor the CPU/memory usage of one single process

November 23, 2015 Leave a comment

I want to monitor a specific process. How much CPU does it use? How much memory does it eat?


$ top -p PID
# or
$ htop -p PID

The option “-p” stands for “pid’.

Tip from here.

Categories: bash Tags: , , , ,

convert a LibreOffice Calc/Excel stylesheet to .csv in command-line

November 21, 2015 Leave a comment

I have a stylesheet made with LibreOffice Calc / Excel. The extension of the file is .ods or .xls / .xlsx. How to convert it to .csv? From the command line, of course.

Convert an .ods file:

libreoffice --headless --convert-to csv file.ods

Convert an Excel file:

libreoffice --headless --convert-to csv file.xlsx

Tip from here.

If you use --convert-to html, then you get an HTML output.

Categories: bash Tags: , , ,

free Udemy courses

November 21, 2015 Leave a comment
Categories: Uncategorized Tags: , ,

VLC hotkeys that you must know

November 14, 2015 Leave a comment
a     - cycle aspect ratio (16:9, 4:3, etc.)
b     - cycle audio track
g, h  - adjust subtitle delay (down, up)
f     - fullscreen
space - pause

Full list here.

Categories: Uncategorized Tags: ,

always add a fucking abstract to your project

November 8, 2015 Leave a comment

When you write a scientific paper, you MUST add an abstract. Then comes an introduction, new results, and conclusion. Why is an abstract necessary? Because it sums up your work. If someone doesn’t want (or has no time) to read your whole paper, (s)he should be able to have an idea about your work just by reading the abstract. The abstract must describe clearly what this paper is about. Then the reader can decide: 1) “Hmm, sounds interesting, I’ll read it.”, or 2) “Ehh, who cares?”.

So, when you write a piece of code and you decide to share it with the world, then add an abstract! I’ve met so many projects that has no abstract and then I need to do my own research to figure out what it is, what it is good for, and why I would need it.

Let’s take a terrible example. Today I read about Babel.js and decided to visit the homepage to learn more about it. What kind of information can you find on the front page?

  • Babel is a JavaScript compiler
  • Babel transforms your JavaScript

That’s all! And there is a link to ES6 features. And from this someone should understand what it is for. Well, after this I still had no idea why I would need it. So I made a Google search and found a detailed blog post at that starts with this:

“Babel is a transpiler for JavaScript best known for its ability to turn ES6 (the next version of JavaScript) into code that runs in your browser (or on your server) today.” And then it shows an EXAMPLE. Babel converts this:

const input = [1, 2, 3];
console.log( => item + 1)); // [2, 3, 4]

into this:

var input = [1, 2, 3];
console.log( (item) {
  return item + 1;
})); // [2, 3, 4]

And now, 5 minutes later I know what it is for, but this info should have been on the FRONT PAGE of the project!

TL; DR: Just add a fucking abstract to your project. People will be grateful for that.

Categories: blog Tags: ,