Search

Fonty Python: manage your fonts

February 22nd, 2009 edited by Tincho

Article submitted by Donn Ingle. We’ve run out of articles! If you like Debian Package of the Day please submit good articles about software you like!

FP logoFonty Python is available from the fontypython package in both Debian and Ubuntu in Universe. Fonty is a wxPython app so will work in any desktop environment. It also has a command-line interface which avoids the gui.

What the font?

As a graphic designer, one is called-upon to create artwork for many things. Fonts change from one client to another, from one job to another. If busy enough, then one can soon amass a vast pile of font files. Some are downloaded from the net as freeware, others are purchased, others are supplied by the clients for their work.

These font-files are stored somewhere, independently of the system fonts managed by the Debian package manager, possibly sorted in whatever fashion you prefer. It’s crazy to have these fonts all installed at the same time. Besides whatever that may do to your computer’s speed, it has one gigantic drawback: it clutters up font-selection boxes. Have you ever tried to find a font in a list of 500 fonts? Bleh.

What you need is a way to herd fonts and that’s what Fonty does.

Bring out yer fonts!

FP screenshot
Fonty will let you gather your fonts and structure them into “collections” —or what I call “Pogs”— a place to keep tyPOGraphy (well, why not?)

Think of Pogs as “groups”, “bags”, “cases”, “boxes” —that kind of thing. It’s an oddball word invented to describe a bunch of font files.

Ye olde basic idea

You visually gather fonts into Pogs. You then install a Pog and all the fonts within it are active on the system. You finish your work and then uninstall the Pog.

Your fonts never move from where they live (so don’t worry). Neither are copies of your fonts made; only links to the original files are used to install the fonts into your home .fonts subdirectory.

For example, you might have a Pog called logoZoo into which you place all the TTFs you need to design a logo for a Zoo. After that, when you need to work with them, you simply install the logoZoo Pog and start your design app. All those fonts will now appear in Inkscape or The Gimp, and other apps. Do your work as normal, and forget about fonts.

When you are done designing, you uninstall logoZoo and all those fonts go away. The links to the original files are removed from your home .fonts
directory, effectively uninstalling each font.

Fonty is also great for just looking at fonts wherever they are on your computer, without having to install them first. Fonty also has a command-line, allowing very quick use. You can install or remove pogs without having to start the entire gui, which is neat.

Quick tour

The layout of Fonty is supposed to be as simple as possible. I stayed away from context-menus and drag and drop because I find them hard to use. The flow is left-to-right with the sources of fonts on the left and their targets on the right.

  • FP layoutPoint 1: You choose a Source Folder (or Source Pog) on the left.
  • Point 2 & 3: You then see the fonts in the middle. You can page or Point or search around (Points 5,7). You click the fonts you want to use.
  • Point 4: On the right, you choose a Pog, or make a new one.
  • Point 6: Once you have a Target Pog selected, you can place fonts that you ticked into it.
  • Point 8: On the bottom-right you then Install or Uninstall Pogs as you need them.
  • There is a settings box (ctrl+s) where you can change the sample text and sizes.
  • Check the help too — it’s full of tips and quite short.
FP screenshot

Bad fonts

Some fonts are simply bad to the bone. Fonty relies on freetype and PIL to open and draw the glyphs, and when this fails so does Fonty. I have put a lot of effort into catching this, but it does not always work. When a font crashes Fonty, you should get a popup box telling you which one did the deed. You really ought to remove that font! Some fonts cannot be displayed, and Fonty will show that by using coloured bars in the display area.

There is also a menu item (File > Check Fonts) that you can point at a given directory and scan it for fonts that will crash Fonty. Use this when you want to cull all the fonts that are bad.

Font Flavours

Originally, Fonty could only show TTF files. Since then I have expanded it to include OTF, Type1 and TTC files. As far as I can tell, being only seminiscient, this all works.

i18n

Fonty speaks your language; or it will if you translate it. There are a few translations available and you can join the project to contribute others.

Fonty needs help

With Python heading for version 3 and all kinds of other changes, Fonty is falling behind. She still works quite well, but I cannot spend the time I want to on her. If there’s anyone out there who wants to stick a fork in her and run —please do.

I hope to find some time this year to have another go; fix some bugs and include a few translations I have been sent, but I can’t be relied upon.

You can check out the author’s home page for Fonty and the project home page.

Posted in Debian, Ubuntu | 2 Comments »

localepurge: Automagically remove unnecessary locale data

February 15th, 2009 edited by Vicho

Article submitted by Geoffroy Youri Berret. We’ve run out of articles! If you like Debian Package of the Day please submit good articles about software you like!

localepurge allows you to remove unnecessary locale data you have on your system and prevents installing unneeded locales when installing new packages.

During the initial installation of localepurge you’ll be asked which languages you want in your system. The installation process will ask you if you want to purge also manpages for unwanted locales. Once installed, localepurge will be launched each time you install a new package on your system and will inform you of the amount of space you saved.

On a regular desktop installation you may save up to one hundred or more MiB. Even though space is no longer that expensive, this kind of tool might still be useful on netbooks, laptops and, in general, mobile technology with limited disk space.

nota bene: You have to be aware that localepurge is considered a hack of the package system, this is not a feature (localepurge(8)). localepurge is independent and not a part of dpkg/apt. Consider using it at your own risk. This warning sounds worrying but my personal experience of localepurge for the past 5 years tells me there is no reason to be afraid of —I never identified a problem on my system I could blame on localepurge. It’s nonetheless important to keep that in mind.

Let’s see of efficient it is with a mplayer installation on Debian Lenny for instance:

$ aptitude install mplayer
[...]
Preconfiguring packages …
Selecting previously deselected package libopenal1.
(Reading database … 95241 files and directories currently installed.)
Unpacking libopenal1 (from …/libopenal1_1%3a1.4.272-2_i386.deb) …
Selecting previously deselected package mplayer-skin-blue.
Unpacking mplayer-skin-blue (from …/mplayer-skin-blue_1.6-2_all.deb) …
Selecting previously deselected package mplayer.
Unpacking mplayer (from …/mplayer_1.0~rc2-17+lenny3_i386.deb) …
Processing triggers for man-db …
Processing triggers for menu …
Setting up libopenal1 (1:1.4.272-2) …
Setting up mplayer-skin-blue (1.6-2) …
Setting up mplayer (1.0~rc2-17+lenny3) …
Configuring mplayer …done
Processing triggers for menu …
localepurge: Disk space freed in /usr/share/man: 780K
[...]
$

localepurge is available in Debian since quite a long time, you’ll find it in old stable Sarge, Etch and Lenny. It’s also been available in Ubuntu (universe) for ages.

Posted in Debian, Ubuntu | 8 Comments »

vnstat: a console-based network traffic monitor

February 8th, 2009 edited by Vicho

Article submitted by András Horváth. Guess what? We still need you to submit good articles about software you like!

There are many command-line utilities in the Unix / Linux world that collect network traffic statistics for a chosen interface.

vnstat is different because statistics are collected permanently. It keeps the data in files so traffic monitoring is resumed at reboot. vnstat can be useful in situations when you need to know the exact amount of traffic that goes through the interface for a period longer than the computer is on. For example when you have a mobile 3G internet connection or an xDSL connection that has traffic limit per month, then you can easily check how much traffic you generated.

vnstat can be run without root privileges because it collects data from the kernel’s proc filesystem. It doesn’t have a daemon service, it is simply run by cron periodically. In Debian, the installation creates a cron job where a vnstat -u command is run every 5 minutes:

# /etc/cron.d/vnstat: crontab entries for the vnstat package

0-55/5 *        * * *   root    if [ -x /usr/bin/vnstat ] &&
[ `ls /var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi

Initially, you have to create the database with this command:

vnstat -u -i wlan1

After creating the database, the statistics can be viewed by running vnstat without any further parameters. Thanks to the cron job, the statistic is updated every 5 minutes. It even remembers the interface name to list:

$ vnstat

Database updated: Tue Jan 27 15:40:01 2009

        wlan1

           received:       2.18 GB (81.3%)
        transmitted:     512.85 MB (18.7%)
              total:       2.68 GB

                        rx     |     tx     |  total
        -----------------------+------------+-----------
        yesterday     95.14 MB |   12.19 MB |  107.32 MB
            today     11.33 MB |    4.47 MB |   15.80 MB
        -----------------------+------------+-----------
        estimated        16 MB |       6 MB |      22 MB

Some command line options allow you to view statistics for specific periods of time. For example:

  • --days
    $ vnstat --days
    
     wlan1  /  daily
    
        day         rx      |     tx      |  total
    ------------------------+-------------+----------------------------------------
       18.01.       231 kB  |     115 kB  |     346 kB
       19.01.    611.72 MB  |   58.16 MB  |  669.88 MB   %%%%%%%%%%%%%%%%%::
       20.01.    400.53 MB  |  200.70 MB  |  601.23 MB   %%%%%%%%%%%%%%:::::
       21.01.      5.87 MB  |    1.56 MB  |    7.43 MB
       22.01.    417.97 MB  |  108.94 MB  |  526.91 MB   %%%%%%%%%%%%%%::::
       23.01.    365.24 MB  |   41.78 MB  |  407.02 MB   %%%%%%%%%%%%::
       24.01.    150.00 MB  |   13.42 MB  |  163.43 MB   %%%%%%
       25.01.    170.17 MB  |   71.52 MB  |  241.70 MB   %%%%%%:::
       26.01.     95.14 MB  |   12.19 MB  |  107.32 MB   %%%%
       27.01.     11.36 MB  |    4.51 MB  |   15.87 MB
    ------------------------+-------------+----------------------------------------
     estimated       16 MB  |       6 MB  |      22 MB
    
  • --weeks
    $ vnstat --weeks
    
            wlan1  /  weekly
    
                                rx      |       tx      |    total
            ----------------------------+---------------+--------------
              last 7 days      1.19 GB  |    253.93 MB  |      1.44 GB
                last week      2.07 GB  |    496.08 MB  |      2.56 GB
             current week    106.52 MB  |     16.71 MB  |    123.23 MB
            ----------------------------+---------------+--------------
                estimated       456 MB  |        68 MB  |       524 MB
    
  • --months
    $ vnstat --months
    
     wlan1  /  monthly
    
       month         rx      |      tx      |   total
    -------------------------+--------------+--------------------------------------
      Jan '09       2.18 GB  |   512.90 MB  |     2.68 GB   %%%%%%%%%%%%%:::
    -------------------------+--------------+--------------------------------------
     estimated      2.53 GB  |      596 MB  |     3.12 GB
    
  • --top10
    $ vnstat --top10
    
     wlan1  /  top 10
    
       #       day         rx      |     tx      |  total
    -------------------------------+-------------+---------------------------------
       1    19.01.09    611.72 MB  |   58.16 MB  |  669.88 MB   %%%%%%%%%%%%%%%%::
       2    20.01.09    400.53 MB  |  200.70 MB  |  601.23 MB   %%%%%%%%%%%:::::
       3    22.01.09    417.97 MB  |  108.94 MB  |  526.91 MB   %%%%%%%%%%%:::
       4    23.01.09    365.24 MB  |   41.78 MB  |  407.02 MB   %%%%%%%%%:
       5    25.01.09    170.17 MB  |   71.52 MB  |  241.70 MB   %%%%::
       6    24.01.09    150.00 MB  |   13.42 MB  |  163.43 MB   %%%%
       7    26.01.09     95.14 MB  |   12.19 MB  |  107.32 MB   %%
       8    21.01.09      5.87 MB  |    1.56 MB  |    7.43 MB
       9    18.01.09       231 kB  |     115 kB  |     346 kB
    -------------------------------+-------------+---------------------------------
    
  • --live gives real-time statistics about the packets currently going through the interface:
    $ vnstat --live -i wlan1
    Monitoring wlan1...    (press CTRL-C to stop)
    
       rx:     113.40 kB/s    99 p/s            tx:      28.42 kB/s    96 p/s
    

Pros and cons

  • Pros:
    • Permanent network traffic statistic that is not forgotten.
    • Very lightweight solution, no daemon service is running in the background (automatically run from cron periodically).
    • Easy to install and use. In vnstat, everything can be done from the command line and it clearly shows how many megabytes have you send/receive in a given day or month.
  • Cons:
    • Internet or remote traffic cannot be separated from local network traffic if it all goes through the interface being monitored.
    • It works for a single host, but it doesn’t scale very well. If you need to monitor a lot of hosts and need detailed graphs, there are better alternatives, such as munin or ganglia.

Availability

There are official packages available in both Debian and Ubuntu (Universe) for a long time now.

Posted in Debian, Ubuntu | 3 Comments »

rtpg-www: Please your dearest with rtorrent’s power

February 1st, 2009 edited by Vicho

Article submitted by Dmitry E. Oboukhov. Guess what? We still need you to submit good articles about software you like!

Many people use a wonderful bittorrent client: rtorrent. It is an extremely easy and convenient program for servers. However, its Command-Line Interface may scare some.

If you’re already using apache then you may use an external GUI for rtorrent. rtpg-www (RTorrent Perl GUI) is a package package that quite recently appeared in Debian (Sid) and Ubuntu (Jaunty). It will please your nearest and dearest with a nice web interface, as they will be able to run rtorrent without having to touch the dreaded terminal :)

rtpg screenshot

The package comes with an already configured virtual server. In its simplest variant all you need to do is:

  1. Answer “yes” on debconf’s question about adding a line to /etc/hosts (only if dpkg asks you medium priority questions)
  2. Switch on the scgi module with a2enmod scgi
  3. Enable the virtual server in apache: a2ensite rtpg.apache.conf
  4. Reload apache to activate the new configuration: invoke-rc.d apache2 reload
  5. Add “scgi_port = localhost:5000″ to your ~/.rtorrent.rc

Now, you can go to http://rtpg/ and start using it! With it you can:

  • add/delete/view the list of torrents.
  • Control torrents’ download priorities, start, and stop them.
  • Control torrents’ file-by-file download priorities.
  • View the statistics: rating, number of peers, download/upload rate, etc.
  • Control the overall download/upload rates (for all torrents).

rtpg Console skinrtpg supports skins which are easy to add by yourself. For those of you who doesn’t want to get out of the habit of using console there is a cool “Console” skin ;)

So install and enjoy! Good luck!

Posted in Debian, Ubuntu | 9 Comments »