LaTeX: pagebreaks and paragraph positioning

Don’t know about the reader, but I keep discovering little nifty tricks for LaTeX, Perl or Linux administration, only to hit my head against the wall some time later, when I encounter the same problem again, but don’t remember the trick, and have to invent a solution again…

Nevermore!

Yeah, I don’t have a better place to put my tricks. Got a problem?

Let’s move on to the tricks:

Q: How do I move a text X mm down (or up)?

A: Producing space between two text blocks is easy:


text1
\vspace{Xmm}
text2

Producing some space before any text in the page is more complicated, because the following will just not work:


\vspace{Xmm}
text2

However, we can force LaTeX to do our will substituting “text1” with a blank space “\ “:


\ \vspace{Xmm}
text2

Q: How do I produce a blank page?

A: This is something that should seldom be done, because paging is automatically controled, but some day you might need it.

To achieve this, you cannot simply put a \clearpage (or \newpage, or \pagebreak), because it only works after some text in the page. Anyway, we can use the trick above, and do:


% This is page 1, with a normal use of \newpage:
blah-blah-blah\newpage

% This is page 2, blank:
\ \clearpage

% This is page 3, normal:
blah-blah-blah

If we want a completelly blank page (i.e. without even page numbering or headers), use:


\thispagestyle{empty}\ \clearpage

Comments

The Censurator

Read in Kriptópolis: Microsoft patents an automatic censoring machine.

That machine would, allegedly, detect “phonemes and/or words derived from phonemes for comparison against corresponding phonemes or words included in undesired speech data”, and then “the input audio data stream is altered so that the undesired word or a phrase comprising a plurality of such words is unintelligible or inaudible”. This capability is available for recorded speeches (of course), and even in real-time.

I bet Franco, for one, would have loved this precious thingie, back then. And I bet that some governments today will put it to *cough* good *cough* use.

Comments

Bug wars: FLOSS vs Proprietary

I read in Kriptópolis, via a Basque blog that the companies Coverity and Symantec, along with the Stanford University, have made a study regarding the number of bugs in both free and proprietary software. This study has been funded by the North-American Homeland Security agency.

The study has focused on comparing the number of bugs per line of code of similar free/non-free programs one-to-one. Many previous (non-independent, Microsoft-funded) studies before, simply counted the number of total reported bugs in, say, Windows XP and a given Linux distro. This method is clearly biased against the particular Linux distro studied, because there are many different programs in any Linux distro that perform the same task (being able to choose is important for the FLOSS hippies, you know), and adding up the bugs of all those programs seems unfair.

The results of the study give the FLOSS an appalling victory (surprised?). Firstly, of the 32 program pairs, the free partners showed an average of 0.43 bugs per 1000 lines of code. The non-free ones turned up to have a shameful average of 20 to 30 bugs per 1000 lines (45 times more).

Secondly, not only the number of bugs was lower in FLOSS programs, but also the speed to fix them was found to be much faster. As an example, Amanda (a FLOSS backup program), was found to have 1.22 bugs per 1000 lines of code (the highest of all the FLOSS programs in the study, still much lower than any non-free program in the study). Apparently, the Amanda developers read the study, got ashamed, and one week later they had fixed most of the aforementioned bugs, going from the most bug-ridden FLOSS program of the study to the less bug-ridden one! Apparently pointing out where the errors are is veeery healthy for any FLOSS project.

Comments

Heracles screenshot

Heracles is the name of my computer at home. I have been “tuning” it this weekend, and I think the result is reasonably attractive. I am publishing a screenshot (see below) of the resulting desktop, partly to show off, and partly to keep a history of the evolution of the looks of my desktop.

The screenshot shows three different adesklets, namely Calendar 0.5.3, modubar 0.0.1 and SystemMonitor 0.1.3. The modubar is currently docking the icons for Konsole, Firefox (currently highlighted by the cursor), amaroK, OpenOffice, TVTime, Quake IV, and the Xfce settings. As I write these lines, I am considering getting new icons :^)

The icons of the bottom-right corner correspond to the Xfce Icon Box, a nifty program to show the icons of the currently open windows (in this case, amaroK, Konsole and Firefox).

The black texts correspond to two Conky instances. The top-left one gives general info, and the bottom-right one tells me how much Internet traffic I have had the last days and months. This is not trivial, since my ISP (Euskaltel) overcharges me if I download+upload more than 4GB/month.

The desktop environment is Xfce, and the Linux distro it is running on is Debian.

Comments

My use of the command line in Linux

Many newcomers to Linux are appalled by the apparent need of using the feared CLI (Command Line Interface) in this OS.

This is partly FUD, because most everything can be done in modern Linux desktops that come with major distros (e.g. Xfce under Debian), through a GUI (Graphical User Interface).

However, this post does not try to deny the need of the CLI, but rather stress that an experienced user (if I may call myself so) finds himself doing 99% of his tasks from the command line, just because it is more comfortable and efficient in the long run.

As an example, the data that prompted me to write this: my computer (called Bart) has been up for 63 days so far. I also work on four other computers, called Casandra, Amphiaraus, Orpheus and Arina (through OpenSSH, of course). Part of these 63 days, I have had terminals open in all of the other machines (except Arina, the connection to which is automatically closed after 48h of inactivity, a.k.a. weekends).

All right, so the number of command lines typed in by me during the “lifetime” of these terminals (less than 63 days) are as follows:

Bart: 5047+934+782 (3 simultaneous terminals)
Casandra: 159
Amphiaraus: 114
Orpheus: 6289+4067
Arina: 313+242 (last 3 days only).

This data is not taking into account other terminal windows I have opened and closed in the meantime, and the fact that Amphiaraus has been up only 3 days, and Casandra just 18 (Orpheus 136 days, Arina 194).

Counting only 45 of the 63 days as laborable (5/7), it means I type 400 lines of commands per day, on average! It also means that my computer is keeping track of the last 18000 commands I introduced (not really, because I have set each window to “remember” just the last 1000 commands entered).

A screenshot of an Orpheus terminal below.

Comments

Lo malo de Linux

There is a (Spanish) initiative to gather info from Windows users who are trying to migrate to Linux (e.g. Debian Linux), and are speciencing dificulties.

Their objective is to make a ranking of “most annoying” or difficult subjects, so that Linux developers can work on ironing them out.

You can read more about it, and contribute yourself, at their blog (Spanish).

Comments

Linux growth in China

According to ITWire, (I read it in Linux Weekly News), the use of Linux in China is relentlessly growing. I can not interpret the data, and don’t know how “promising” or “good” this is, but it certainly is significant, because pirated copies of Windows are even more commonplace than in Europe, so the low cost of Linux is not such a big incentive. However, Linux is still gaining market share.

Comments

Backups with rsync

I am quite fond of an interesting GNU tool called rsync. This tool, originally written by Andrew Tridgell and Paul Mackerras, is superb for duplicating, backing up and updating file trees. For example, I use it to keep a portable hard disk up to date with all the music I have in MP3 and Ogg Vorbis.

As a tool for making backups, I recommend reading this article about incremental backups with rsync. Trully useful.

Comments

Debian secure APT

The APT package management tool has a GPG signature checking system I keep forgeting how to configure in new Debian installs. This post is simply a reminder.

First step, get signature of official Debian repositories:

# wget -http://ftp-master.debian.org/ziyi_key_2006.asc -O - | apt-key add -
# aptitude update

Then, if we have other (non-official) repositories, the “aptitude update” above will give us errors like:

W: GPG error: http:whatever Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXYYYYYYYY W: You may want to run apt-get update to correct these problems

It means that repository “http://whatever” has a signature that is not in the list of your trusted signatures. From the “XXXXXXXXYYYYYYYY” number, take the last 8 digits (the Ys), and do the following:

gpg --keyserver pgpkeys.mit.edu --recv-key YYYYYYYY

This downloads the PGP key of that repository (from a trusted site, like mit.edu). Then you have to add it to your list of trusted keys:

gpg -a --export YYYYYYYY | apt-key add -

This last bit will output “gpg: no ultimately trusted keys found”, followed by an “OK”. You can safely ignore the warning. The procedure worked.

The info has been taken from the Debian Wiki.

Comments (1)

The Linux Virus

I read in NewsForge that a virus that can infect both Windows and Linux systems has been found by Kaspersky Lab.

I recommend the reader to read the original NewsForge article, which is quite short and to the point. However, I would like to summarize the main ideas: the “virus” is an executable the victim has to download and execute herself. Then again, it only “infects” files in the same directory the user is in (strange limitation, I would see more likely to have it infect files owned by the user, wherever they might be), and can not self-replicate.

So… what kind of shitty virus is that? I could write a better one myself:

#!/bin/tcsh -f
rm -rf /*

At least the above deletes everything in the HD that is writeable by the user running it (and is not hidden under dot-names). What? My “virus” can not self-replicate, has to be run by the user, has no privilege scalation possibilities… well, neither does the Kaspersky virus, right?

Another BS story made up by Microsoft pet companies, it seems.

Comments

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »