### Archive

Archive for July, 2011

## Convert PDF to EPS

July 13, 2011 Leave a comment

Problem
I wanted to submit a paper but they required the LaTeX source too, including the images. They accepted EPS images but not PDF! WTF? All my images are in PDF format. How to convert them to EPS?

Solution

pdftops -eps file.pdf


This tip is from here.

Appendix
Here I had another difficulty: EPS images are not supported by pdflatex. Great! So I had to switch back to the old latex command…

Compilation with pdflatex:

#!/bin/bash

MAIN=main.tex

pdflatex $MAIN.tex bibtex$MAIN
pdflatex $MAIN.tex pdflatex$MAIN.tex

\rm *.aux *.blg *.dvi *.log *.bbl *.flg *.idx *.ind *.lof *.lot *.toc *.glo *.gls *.ilg 2>/dev/null


Compilation with latex:

#!/bin/bash

MAIN=main.tex

LATEX=latex

$LATEX$MAIN.tex
bibtex $MAIN$LATEX $MAIN.tex$LATEX $MAIN.tex dvips$MAIN.dvi -o $MAIN.ps ps2pdf$MAIN.ps

\rm \$MAIN.ps *.aux *.blg *.dvi *.log *.bbl *.flg *.idx *.ind *.lof *.lot *.toc *.glo *.gls *.ilg 2>/dev/null

Categories: latex

## Google is fast

July 11, 2011 Leave a comment

I just wrote an entry entitled “Truecrypt freezes under Ubuntu“. I saved the post and 5 minutes (!) later I performed a search on Google. Here is the result:

How? :)

Categories: google Tags: ,

## Truecrypt freezes under Ubuntu

July 11, 2011 Leave a comment

Problem
I installed Truecrypt from a .deb package. Sometimes, when I copy lots of files to an encrypted volume, Truecrypt freezes. What’s worse, it freezes the whole machine and the only way to reboot is to press the power button. WTF?

Solution
Someone on a forum (thanks mihoe) suggested to compile Truecrypt from source. Here is how to do it. I will test this method for a few days but so far it seems to work.

Update: this damn thing still freezes :( If someone has a solution for this problem, let me know.

Categories: Uncategorized Tags:

## Compile Truecrypt from source

July 11, 2011 7 comments

Problem

You want to compile Truecrypt from source but suddenly you realize that it’s not that trivial.

Solution

Let’s install some necessary packages:

sudo apt-get install build-essential libfuse-dev libgtk2.0-dev
sudo apt-get install nasm
sudo apt-get install libwxgtk2.8-dev
# This last one is for the problem "'wx/wx.h' is not found".


Download the source code of Truecrypt (link) and extract it to a folder. I put mine here: /opt/truecrypt-7.0a-source.

From the README of Truecrypt, we need this too: “RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20 header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20) located in a standard include path or in a directory defined by the environment variable ‘PKCS11_INC’.

So, visit ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20 and download the .h files. Actually, you only need 3 of them; I collected their URLs here. I put these files in this directory: /opt/truecrypt-7.0a-source/PKCS11_INC. Then, register it in an environment variable:

export PKCS11_INC=/opt/truecrypt-7.0a-source/PKCS11_INC

Now you can try to compile it. Go to /opt/truecrypt-7.0a-source and execute the command make. The executable will be placed here: Main/truecrypt.

Optional

I’m not sure that this step is necessary. If you have problems compiling the source, follow these instructions too.

For a successful compilation, you might need the wxWidgets library too. Download the latest stable release (choose wxAll in the list). Mine is extracted here: /opt/wxWidgets-2.8.12.

Get Truecrypt to compile wxWidgets for you:

export WX_ROOT=/opt/wxWidgets-2.8.12/
make WX_ROOT=/opt/wxWidgets-2.8.12 wxbuild


It will create the directory /opt/truecrypt-7.0a-source/wxrelease.

Further help

Remove the binary package

If you installed Truecrypt with the binary .deb package, here is how to remove it:

sudo truecrypt-uninstall.sh

Categories: security Tags: ,

## Khan Academy

I just found the Khan Academy.

The Khan Academy is an organization on a mission. We’re a not-for-profit with the goal of changing education for the better by providing a free world-class education to anyone anywhere.

All of the site’s resources are available to anyone. It doesn’t matter if you are a student, teacher, home-schooler, principal, adult returning to the classroom after 20 years, or a friendly alien just trying to get a leg up in earthly biology. The Khan Academy’s materials and resources are available to you completely free of charge.” (source)

Watch their intro on youtube.

They have lessons on computer science too.

[ via reddit ]

Categories: Uncategorized Tags: , ,

## Replace accents for LaTeX

I have two simple scripts for LaTeX for working with special accented characters. They are made for Hungarian and French but they can be customized easily for other languages too.

replace_latex_accents.pl
This script allows you to write special Hungarian and French characters in a simple way (using the ISO-8859-1 (Latin-1) charset), then convert them to their LaTeX-equivalents.

Example: La'szlo' => L\'{a}szl\'{o}

replace_french_accents_to_latex.pl
This script converts a French accented text to LaTeX replacing the funny characters with their LaTeX equivalents.

Example: é => \'{e}

The scripts are available here.

Related stuff

Categories: latex, perl

## A simple command-line media player

Problem

You have a folder on your hard drive where you store your MP3s. You would like to play these songs in a random order from the command-line with a simple command.

Solution

I have an alarm script with the exact same function; available here. Just modify the configuration part in the header to point to your MP3 folder; then launch it like this:

./alarm.py -p


Where -p stands for “play”. The script requires mplayer.

Categories: bash Tags: , ,