Ubuntu ttf fonts, all at once.

Ever wanted to install every ttf font in the Ubuntu repositories at once?   I have the command for you.

I was using inkscape, and annoyed with the meagre list of fonts available, so I assembled this with a quick regex and a few manual corrections.  It’s about 300 packages, takes up nearly 900Mb of space, and is a 335Mb download. (Good compression on fonts, apparently!)

(Edit: you may wish to skip ttf-mathematica4.1 and  ttf-mscorefonts-installer, as they require you to agree to licences.  I’ve put them at the end for easier deletion.)

sudo apt-get install fonts-arphic-uming fonts-hanazono fonts-lklug-sinhala fonts-mona fonts-opensymbol fonts-unfonts-core fonts-unfonts-extra ttf-adf-accanthis ttf-adf-baskervald ttf-adf-berenis ttf-adf-gillius ttf-adf-ikarius ttf-adf-irianis ttf-adf-libris ttf-adf-mekanus ttf-adf-oldania ttf-adf-romande ttf-adf-switzera ttf-adf-tribun ttf-adf-universalis ttf-adf-verana ttf-aenigma ttf-alee ttf-ancient-fonts ttf-anonymous-pro ttf-aoyagi-kouzan-t ttf-aoyagi-soseki ttf-arabeyes ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-ukai ttf-arphic-ukai-mbe ttf-arphic-uming ttf-atarismall ttf-baekmuk ttf-bengali-fonts ttf-beteckna ttf-bitstream-vera ttf-bpg-georgian-fonts ttf-breip ttf-century-catalogue ttf-comfortaa ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-dejima-mincho ttf-denemo ttf-devanagari-fonts ttf-droid ttf-dustin ttf-dzongkha ttf-ecolier-court ttf-ecolier-lignes-court ttf-engadget ttf-essays1743 ttf-evertype-conakry ttf-f500 ttf-fanwood ttf-farsiweb ttf-femkeklaver ttf-fifthhorseman-dkg-handwriting ttf-freefarsi ttf-freefont ttf-georgewilliams ttf-gfs-artemisia ttf-gfs-baskerville ttf-gfs-bodoni-classic ttf-gfs-complutum ttf-gfs-didot ttf-gfs-didot-classic ttf-gfs-gazis ttf-gfs-neohellenic ttf-gfs-olga ttf-gfs-porson ttf-gfs-solomos ttf-gfs-theokritos ttf-goudybookletter ttf-gujarati-fonts ttf-hanazono ttf-inconsolata ttf-indic-fonts ttf-indic-fonts-core ttf-ipafont-jisx0208 ttf-ipafont-uigothic ttf-isabella ttf-jsmath ttf-junicode ttf-jura ttf-kacst ttf-kacst-one ttf-kanjistrokeorders ttf-kannada-fonts ttf-khmeros ttf-khmeros-core ttf-kiloji ttf-komatuna ttf-konatu ttf-kouzan-mouhitsu ttf-lao ttf-larabie-deco ttf-larabie-straight ttf-larabie-uncommon ttf-levien-museum ttf-levien-typoscript ttf-lg-aboriginal ttf-liberation ttf-lindenhill ttf-linex ttf-linux-libertine ttf-lyx ttf-malayalam-fonts ttf-manchufont ttf-marvosym ttf-mgopen ttf-mikachan ttf-misaki ttf-mona ttf-monapo ttf-motoya-l-cedar ttf-motoya-l-maruberi ttf-mph-2b-damase ttf-mplus ttf-nafees ttf-nanum ttf-nanum-coding ttf-nanum-extra ttf-ocr-a ttf-oflb-asana-math ttf-oflb-euterpe ttf-okolaks ttf-oldstandard ttf-opendin ttf-oriya-fonts ttf-paktype ttf-prociono ttf-punjabi-fonts ttf-radisnoir ttf-root-installer ttf-rufscript ttf-sawarabi-gothic ttf-sawarabi-mincho ttf-sazanami-gothic ttf-sazanami-mincho ttf-sil-abyssinica ttf-sil-andika ttf-sil-charis ttf-sil-dai-banna ttf-sil-doulos ttf-sil-ezra ttf-sil-galatia ttf-sil-gentium ttf-sil-gentium-basic ttf-sil-nuosusil ttf-sil-padauk ttf-sil-scheherazade ttf-sil-sophia-nubian ttf-sil-yi ttf-sil-zaghawa-beria ttf-sinhala-lkmug ttf-sjfonts ttf-staypuft ttf-summersby ttf-tagbanwa ttf-takao ttf-takao-gothic ttf-takao-mincho ttf-takao-pgothic ttf-tamil-fonts ttf-telugu-fonts ttf-thai-arundina ttf-thai-tlwg ttf-tiresias ttf-tmuni ttf-tomsontalks ttf-tuffy ttf-ubuntu-font-family ttf-ubuntu-title ttf-umefont ttf-umeplus ttf-unfonts-core ttf-unfonts-extra ttf-unifont ttf-unikurdweb ttf-uralic ttf-vlgothic ttf-wqy-microhei ttf-wqy-zenhei ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac ttf-yanone-kaffeesatz ttf-yofrankie ttf-mathematica4.1 ttf-mscorefonts-installer

Some slightly noisy peace and quiet.

I’m currently working in an open concept space – surrounded by whiteboards, but not, ironically, people who are working collaboratively*.  Thus, the space has become a “quiet only” zone.

Given the recent studies that shows ambient noise is a booster of productivity and creativity (eg. http://www.jstor.org/stable/info/10.1086/665048, which you should take with a grain of salt – I haven’t read anything other than the title), I thought I’d share something that my colleague introduced me to… http://coffitivity.com/.

It’s been featured on lifehacker, and plenty of other places.   Given that I don’t drink coffee, you wouldn’t think it would be particularly useful, but surprisingly, I’m enjoying having ambient noise.   It drowns out other people’s loud conversations, and simultaneously is somewhat relaxing.  It also sounds pretty decent over a light veneer of baroque music.

Anyhow, one more tool to add to my toolkit.  Thanks Jake!

*Please see comment below.

Faster is better…

I was going to write about the crazy street preacher I met on the bus this morning, but I have some far more topical stuff to mention.

I’ve been working on some code in python, which, much to my dismay, was taking a LONG time to run.  Around 11 hours of processing time, using 100% of all 8 CPUs (summed up user time of 6110 minutes – about 100 hours of total CPU time), for something I figured should take about about an hour.

I’d already used profiling to identify that the biggest bottlenecks were in two places – putting and retrieving information from a single queue shared by all 8 worker processes, as well as a single function of code that is central to the calculations being done by the workers.  Not being able to figure out what was happening in the worker’s code, I spent some time optimizing the queue management, with some fancy queue management (which turned out later to be outperformed by simply picking a random number for a queue to push the data into) and a separate queue for each process (which did, in fact cut wasted time significantly).  Before that, it had been hovering around the 20 hours, with 8 processes. So, I’d already been doing well, but it was well above where I thought it should be.

So, following up on John’s comment the other day, I gave Pypy a shot.  Unfortunately, the first thing I discovered was that pypy doesn’t work with numpy, the numerical computing library for python.  No problem – I was only using it in one place.  It only took a few seconds to rewrite that code so that it used a regular 2D array.

Much to my surprise, I started getting an error elsewhere in the code, indicating that a float was being used as an index to a matrix!

Indeed, it only took a few seconds to discover that the code was calling the absolute value  of an int, and the returned value was a float – not an integer…

Which means that numpy was hiding that mistake all along, without warning or error!  Simply putting a cast on the float (eg, int(math.fabs(x))) was sufficient to drive the total running time of the code to 111m of user time on the next data set of comparable size. (about 2 hours, with a real time of 48 minutes because the fancy queue manager mentioned above wasn’t working well).

Yes, I’m comparing apples with oranges by not rerunning on the data set, but I am trying to process a large volume of data, and I wasn’t expecting such a massive performance boost.- I’ll get around to proper bench marking when that’s done.

Unfortunately, in the end, I never could get pypy running.  It turns out that it’s incompatible with pysam, a library I’m using to process bam (next-generation sequencing) files.  I don’t have any alternatives for that library and I can’t drop it, so pypy is out.  However, it did help me identify that numpy is far too accepting of bad data for array indexes, and while it is able to handle it correctly, numpy does so with a huge time penalty on your code.

So, lessons learned: profiling is good, pypy isn’t ready for heavy computing use, and numpy should be treated with caution!  And, of course, yes, you can write fast code with python – you just have to know what you’re doing!