tag:blogger.com,1999:blog-73890959638630336792024-03-14T11:31:16.189+08:00...es darf keinen größeren geben.computer related nonsense...Svenhttp://www.blogger.com/profile/15657446981130073963noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7389095963863033679.post-80284337263500992622008-11-19T16:07:00.005+08:002008-11-19T16:22:01.875+08:00Opera and SCIM...How to use the SimpleChineseInputMethod with Opera on Linux:<br /><br />Just add the following lines to your /usr/bin/opera file:<br /><br /><code># Activate Chinese input<br />export LANGUAGE="de"<br />export LANG="de_DE.UTF-8"<br />export LC_CTYPE="zh_TW.UTF-8"</code><br /><br />Actually you only need to set the LC_CTYPE variable... but anyway ;-)Svenhttp://www.blogger.com/profile/15657446981130073963noreply@blogger.com0tag:blogger.com,1999:blog-7389095963863033679.post-15109499264556984502008-11-12T22:24:00.011+08:002008-11-13T12:38:59.716+08:00Strange behavior with mplayerI mainly use a 32" flat screen tv to watch my anime series... but sadly, the resolution of this nice piece of hardware is lower than the resolution of my every-day-use 19" monitor. 1366x768 compared to 1440x900.<br /><br />After fiddeling around some time I found that cloning the main monitor's output with nvidia's Twinview option would leave me with a still quite reasonable performance on my desktop and still offer the possibility to 'view things' on my tv.<br /><br />I set up a "TVtime" <span style="font-weight: bold;">nautilus-actions</span> with <span style="font-weight: bold;">path</span><br /> <br /><code>mplayer -fs -ass -xy 768</code><br /><br />and <span style="font-weight: bold;">parameter</span> <br /><br /><code>%d/%f</code><br /><br />Bad thing is that now *every* movie on the main screen is played with a 786 resolution... even if I don't use 'TVtime' or if I start my movies with -xy 1440. The window size is ok, but when I switch to fullscreen *zang*... probably a bug in LinuxMint/Ubuntu's MPlayer 1.0rc2 and/or compiz' fullscreen hint. (Just a hunch.) Anyhow, an unbearable situation.<br /><br />To get past this I modified the <span style="font-weight: bold;">menu entries</span> for MPlayer a bit, using the X11 video output and -zoom option:<br /><br /><code>gmplayer -vo x11 -zoom %F</code><br /><br />Performance is still very good, in spite of the use of software scaling (-zoom). And I never ended up with more than 65% CPU usage on an aged E6300 system with real 1080p encoded x264 material running a bunch of normal apps in the background.<br /><br />Just a reminder to myself...Svenhttp://www.blogger.com/profile/15657446981130073963noreply@blogger.com0tag:blogger.com,1999:blog-7389095963863033679.post-81912398543067234662008-09-14T16:57:00.017+08:002008-11-22T19:47:54.946+08:00Linux Mint - SCIM<em>Here I'll just try to present an easy and simple method to help any user set up SCIM in Linux Mint, an Ubuntu variant I found a couple of weeks ago...</em><br /><br />Most of this little guide is found in the <span style="font-style: italic;">official</span> Ubuntu Documentation at <a href="https://help.ubuntu.com/community/SCIM">https://help.ubuntu.com/community/SCIM</a>, but there are some small changes, as I don't need the full Chinese language pack (e.g. GIMP and OpenOffice's Chinese documentation...). So if you're using a western system and just want to input and display Chinese (for Japanese etc. just change the language code, ja instead of zh) this guide is for you. Let's start:<br /><br />First of all you have to install the Chinese language support. Just type<br /><br /><code>sudo apt-get install language-support-input-zh language-support-fonts-zh</code><br /><br />in the terminal and press Enter or install these packages via the Package Manager.<br /><br />Since Linux Mint doesn't have the <span style="font-family:courier new;">scim-bridge-client</span> installed by default you have to install it, too. Type<br /><br /><code>sudo apt-get install scim-bridge-client-gtk</code><br /><br />This will install the <span style="font-family:courier new;">scim-bridge-client-gtk</span> (for Gnome) and <span style="font-family:courier new;">scim-bridge-agent</span>.<br /><br />Now we just have switch the Input Method on the X Windows System (Gnome)...<br />One last step, and you're ready to go:<br /><br />Type<br /><br /><code>locale |grep LANG</code><br /><br />This will display your locale. For example, Spanish (Spain) is "es_ES.UTF-8"<br /><br />then type<br /><br /><code>im-switch -z (your locale) -s scim-bridge</code><br /><br />for example<br /><br /><code>im-switch -z de_DE.UTF-8 -s scim-bridge</code><br /><br />Voilà!<br /><br />To use your shiny new input method right away simply restart X. (<ctrl+alt+backspace>)Svenhttp://www.blogger.com/profile/15657446981130073963noreply@blogger.com0tag:blogger.com,1999:blog-7389095963863033679.post-82254946103894132142008-03-19T19:18:00.017+08:002008-09-15T16:55:36.392+08:00gawk vs. mawk und KonsortenA co-worker of mine somehow lost (deleted?) her e-mails... at least some of them quite important. As it turned out, three months worth of mail mysteriously vanished from her Thunderbird Inbox.<br /><br />A quick search on the internet revealed a nice little article "<a href="http://jivebay.com/2007/02/09/restore-deleted-email-in-thunderbird/">Restore Deleted Email in Thunderbird</a>" on jivebay. Exactly what I needed! The only problem: My co-worker's Inbox wasn't just "over 90MB", it was about 850MB. So even my favorite Windows text editor (for those who want to know: It's <a href="http://www.jujusoft.com/software/edit/index.html">JujuEdit</a> - can handle very! large files, has support for regular expressions, among other goodies, and is freeware) couldn't handle a job like this in a reasonable amount of time. As far as I recall JujuEdit would have worked for about 2~3 hours to replace all the 'X-Mozilla-Status: xxxx's with zeros.<br /><br />I decided to have a look at some command line tools from the UNIX/Linux world: <span style="font-weight: bold;">awk</span> and <span style="font-weight: bold;">sed</span>, both designed to process text-based data (like the Thunderbird mbox files). And after a while studying the sed and awk syntax I ended up with two perfectly working 'one-line scripts'.<br /><br />Both versions work as expected, but they differ in execution time, and this is - at last - why I'm writing this... a short and completely fragmentary speed comparison between some text-processing tools.<br /><br />The scripts:<br /><br /><code>awk '/^X-Mozilla-Status: [0-9]*/ {gsub($2, "0000\r")} {print}' Inbox > NewIn</code><br /><br /><code>sed -e 's/^X-Mozilla-Status: [0-9]\{4\}/X-Mozilla-Status: 0000/' Inbox > NewIn</code><br /><br />I 'time'd both snippets several times on a (Ubuntu) Linux box and this is what I've got:<br /><br /><span style="font-weight: bold;">(m)awk</span>: ~50s<br /><span style="font-weight: bold;">sed</span>: ~1m40s<br /><span style="font-weight: bold;">JujuEdit</span> (Windows): approx. 3 hours<br /><br />I know, my testing environment is somewhat unique and the results are not really representative, but IMHO impressive none the less.<br /><br />This way I found out that Ubuntu's standard awk is in fact mawk, and that mawk is (in this special case) about twice as fast as sed... even though awk is a full blown programming language and sed 'just' a Unix utility.<br /><br />Today I added GNU awk (<span style="font-weight: bold;">gawk</span>) and, of course, <span style="font-weight: bold;">Perl </span>to my little test suite, and tried it on my own Inbox (about 160MB) in a small VM Ubuntu installation.<br />The gawk code snippet is similar to the awk version, the Perl line looks like this:<br /><br /><code>perl -w -p -e 's/X-Mozilla-Status: [0-9]{4}/X-Mozilla-Status: 0000/' Inbox > NewIn</code><br /><br /><span style="font-weight: bold;">mawk</span>: ~25s<br /><span style="font-weight: bold;">Perl</span>: ~26s<br /><span style="font-weight: bold;">sed</span>: ~35s<br /><span style="font-weight: bold;">gawk</span>: ~40s<br /><br />My conclusion:<br /><ul><li>mawk is indeed a very fast implementation of awk.</li><li>I couldn't get the quantifier / repetition operator {} work in awk.</li><li>Perl is such a nice thing to have.<br /></li><li>I still like Linux.</li></ul>Just my two cents.<br /><br />It is possible, or even likely, that I made some mistakes here. Comments are welcome, I'm eager to learn... BTW, I'm well aware that zeroing out the Mozilla-Status is not the perfect solution to get deleted mails back, changing 0008 to 0000 or 0001 should do the trick.<br /><br />Useful links:<br /><ul><li><a href="http://www.eyrich-net.org/mozilla/X-Mozilla-Status.html?en">Mozilla X-Mozilla-Status explained</a></li></ul>Svenhttp://www.blogger.com/profile/15657446981130073963noreply@blogger.com0