I was having the hardest time getting various programs to echo the runtime of m2ts files in Linux, and it turns out someone wrote a parser for the files in the BDMV/PLAYLIST directory, which have all of this information.
Uncategorized
awesome, bluray, encoding, linux, m2ts, mpls, software, tools, ubuntu, utilities
I have no idea why this package isn’t in the default community repositories. I highly recommend they add it. Use the following commands to add the repository and install the package:
sudo zypper ar ftp://ftp5.gwdg.de/pub/opensuse/repositories/home:/mkng:/science/openSUSE_11.1/ PARI
sudo zypper in pari-gp
Uncategorized
gp, linux, opensuse, pari, software, zypper
Calibre is about the best thing since sliced bread. It is able to convert basically any type of Ebook format into EPUB, which is what my Nook reads natively. It seamlessly syncs with the Nook as well, which is a huge plus, and all of this happens in Linux. I highly recommend this software. Just make sure not to queue up too many jobs, or it might DOS your computer for a bit. The PDF conversion is especially intensive. It makes quick work of short documents (hundreds of pages), but documents that are thousands of pages take much, much longer. The only capability I’m missing currently is conversion of DOC to EPUB, but I can use OpenOffice to convert a DOC to HTML, and then import that into Calibre and convert it, so that works.
Uncategorized
awesome, Calibre, ebooks, linux, nook, reading, software, ubuntu
I converted an ebook from TXT to EPUB today using Calibre, and found that the italics (which in the TXT file are annotated /like this/) are not converted into the HTML equivalent. I did the following to fix this:
- unzip ebook.epub -d tmpbook
- cd tmpbook
perl -i.bak -pe 's/([\s-,.;\'?:]+)\/(.+?)\/([\s-,.;\'?:]+)/$1<i>$2<\/i>$3/sg;' *html
- That will create.bak files just in case anything went wrong. To revert the changes, do this:
for i in *.bak; do mv $i ${i%.bak}; done
zip -r ebook.zip * && mv ebook.zip ebook.epub
Then, I found out Calibre works beautifully with the Nook, so I just popped it on there and it worked.
Uncategorized
awesome, Calibre, ebooks, linux, nook, software
So, ConvertLit seems to be a good solution for those looking to convert LIT ebooks into EPUB (well, into HTML, but then into EPUB…). Unfortunately, the developers seem to be unable to properly make a good source tarball for version 1.8. Here’s what I did:
- Download Version 1.8 source from here.
unzip clit18src.zip -d convertlit
sudo apt-get install libtommath-dev
- Download this to the convertlit directory.
patch -p1 -i clit18.source.patch
- You should see the clit18/Makefile was patched
cd lib && make && cd ../clit18 && make
- the clit binary should be available in the clit18 directory
sudo cp clit18/clit /usr/local/bin/
- Use it!
Now I just have to figure out how to convert it to epub.
Uncategorized
awesome, converlit, convert, ebooks, epub, linux, lit, ubuntu
I’ve been using Kopete on my quest to convert to KDE, and I’ve been extremely annoyed by previous conversions showing up in my chat windows. The option to disable it didn’t seem to be anywhere, but I found a forum post that pointed me to the Plugins section of the configuration.

Just disable the plugin entirely or open it and mess with the configuration. Things like that shouldn’t be on by default, along with chat window tabs (when did this become common?) and annoying buttons for fonts and emoticons. But, maybe I’m more minimalistic than many.
Uncategorized
chat, fix, kde, kopete, linux
So, recently, I installed Ubuntu karmic cleanly on my main desktop machine here at home, and I have really liked it. I even switched to KDE, and everything has been working better than it had been in GNOME. I tried setting up Skype the other day, and ran into an issue with the microphone. It turns out that since the new Skype uses PulseAudio, there’s a further configuration step that’s not so obvious. I found out here that you have to do the following:
sudo apt-get install pavucontrol
pavucontrol
Then, go to the Input Devices tab, and unmute the sound (click the little speaker with a red X until the controls at the bottom are enabled). Then, change the Port setting until you can see the bars move when you tap the microphone. Then try Skype. This worked perfectly for me – it’s too bad it’s not connected to the KDE sound mixer, but oh well. Maybe in the future that will happen.
Uncategorized
audio, karmic, kde, linux, microphone, pulseaudio, skype, sound, ubuntu
I used to use lirc with mplayer to allow my Packard Bell crappy remote to work awesomely, but I have since lost that configuration and switched to smplayer, since it’s awesome. Today, I figured out how to control smplayer using similar means.
Read more…
Uncategorized
awesome, configuration, infrared, linux, lirc, mplayer, smplayer, ubuntu
I was having a bunch of trouble today importing my old MySQL amarok database into the new nightly version of amarok I installed. The Amarok Wiki had a great section on how to convert a MySQL Amarok collection into an SQLlite one. This was the key to importing my old 1.4 collection into the new 2.2 nightly version of Amarok.
Uncategorized
amarok, data, database, import, linux, music, processing, ubuntu
This is possibly the best one-liner I’ve ever written:
gcc -x c -o /tmp/out - -lgmp <<< '#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <gmp.h>
void omg_i_love_leonardo_of_pisa(uint32_t num, mpz_t * result) { mpz_t retval, last, tmp; mpz_init(retval);
mpz_init(last); mpz_init(tmp); uint32_t i = 1; if(num == 0) return; mpz_set_ui(retval, 1U);
mpz_set_ui(last, 0U); for(; i < num; i++) { mpz_set(tmp, retval); mpz_add(retval, retval, last);
mpz_set(last, tmp); } mpz_set(*result, retval); } int main() { uint32_t num; mpz_t fibo; mpz_init(fibo);
omg_i_love_leonardo_of_pisa(1000001, &fibo); mpz_out_str(stdout, 10, fibo); printf("\n"); return 1; }
' && time /tmp/out
It compiles a C program given from STDIN, puts it in /tmp/out, and runs it with time to find the time it takes to run. It generates the 1,000,000th Fibonacci number. Try it!
Uncategorized
awesome, bash, c, code, linux, one-liner, programming, shell