Archive

Author Archive

command-line currency converter

November 19, 2014 Leave a comment

Qalculate! is a multi-purpose desktop calculator for GNU/Linux (now ported to Mac). It is small and simple to use but with much power and versatility underneath. Features include customizable functions, units, arbitrary precision, plotting, and a user-friendly interface (KDE or GTK+).” (source)

The software has a command-line interface too that you can start with the command “qalc“. You can do all kinds of fancy math calculations with it, but this time I’m interested in currency conversions. Qalc supports it too:

$ qalc
You need the download exchange rates to be able to convert between different currencies.
You can later get current exchange rates with the "exchange rates" command.
Do you want to fetch exchange rates now from the Internet (default yes)? yes
> 50000 USD to HUF

  50000 * dollar = approx. HUF 12157958

>  USD to HUF

  dollar = approx. HUF 243.15915

>

Related

colorize man pages

November 19, 2014 Leave a comment

Before
before

After
after

But how?

sudo apt-get install most

Then add this line to your ~/.bashrc:

export PAGER=most

Open a new terminal and try it.

Explanation
This tip is from here. As the user cannedprimates states, “you can solve this issue by using a different pager, for example most. man will actually use the program specified in the PAGER environment variable.”

Categories: bash Tags: , , , ,

autocompile LaTeX project when a file changes

November 19, 2014 Leave a comment

Problem
When I work with LaTeX, I always create a script called “compile.sh” that compiles the project and produces a PDF. For viewing the PDF file I use okular since it refreshes automatically if the PDF changes. However, if I change the LaTeX source, I need to call the “compile.sh” script manually. Could it be automated? That is, when I save the LaTeX source, the project should compile automatically, so I should only switch between my text editor and the PDF viewer.

Solution
I found a complete solution for the problem: autocompile.py. It’s a demo script that is part of the pyinotify project.

Usage:

./autocompile.py . .tex,.bib ./compile.sh

I put autocompile.py in the root folder of the LaTeX project, next to the compile.sh script. The command above means the following: “monitor the current directory recursively. When a .tex or .bib file changes, call the compile.sh script.”

Related

Categories: python Tags: , , , ,

Learn a language in a few minutes

November 16, 2014 Leave a comment

Short summaries of different programming languages: http://learnxinyminutes.com/ .

Midnight Commander: go to parent directory with Backspace

November 16, 2014 Leave a comment

Problem
Total Commander has a nice feature: if you press Backspace, it steps back to the parent directory. How to have this shortcut in Midnight Commander?

Solution
This thing has bugged me for years! But, I was lazy to look it up. Today I got fed up and made a Google search. Guess what. I had the answer in 5 minutes…

The local config files of MC are here: ~/.config/mc. The global ones are located at /etc/mc. I like to access the local config files at ~/.mc, so first I create a symbolic link:

$ cd
$ ln -s ~/.config/mc .mc
$ cd .mc
$ cp /etc/mc/mc.keymap .
$ vi mc.keymap

Modify this line:

# new value:
CdParentSmart = backspace

Originally this line was put in comment.

Restart MC and enjoy the new feature. If you wrote something in the mini shell, you can still delete it with the Backspace. If the mini shell is empty, Backspace makes MC jump back to the parent directory.

My MC version is 4.8.13. You can verify yours with “mc -V“.

download tube videos

November 14, 2014 Leave a comment

http://www.tubeoffline.com/

They support a lot of tube sites.

Categories: Uncategorized Tags: ,
Follow

Get every new post delivered to your Inbox.

Join 73 other followers