Archive for the ‘science and technology’ Category:
Kubuntu NTFS automount problem
Do you use Kubuntu Hardy and have problems with files and folders not showing up when they contain special characters, which usually are UTF-8 encoded? I noticed myself that if I manually mounted a NTFS formatted device with mount /dev/sdx it displayed all files, but when using the automounter in system:/media/ it always somehow mounted the filesystem wrong, omitting all the files with ASCII extended characters. A simple solution to this problem is to run sudo rm -f /sbin/mount.ntfs-3g to and replace the symbolic link with a shell script doing the following
#!/bin/bash
/bin/ntfs-3g $1 "$2" -o locale=en_US.UTF-8,$4
Save the file as /sbin/mount.ntfs-3g and grant everyone execution rights with sudo chmod a+x /sbin/mount.ntfs-3g
Hope this helped anyone.
What I do for fun
Today, once again, I have been reading various, in my opinion truly interesting articles that I found via random clicking on Digg.com and Slashdot.org. For example, I ended up reading about Bennett Haselton and his crusade against spammers, how he has been suing them and brought them into court. I even went as far as to read a detailed court transcript where his case finally was dismissed, which I think rightfully so, cause he didn’t put forward his case clearly enough… Too bad of course, another alleged spammer goes free.
Oh how I love court drama and the precise semantics that’s needed to state your case for a victory. It’s nothing new of course, it happens everywhere and everytime in many arguments. The ones who talk loud, fast and clear usually get heard. Unless the other one makes up a damn good lie. :D
Anyways, I was supposed to write about the fun I did today.
I took some photos and videos of my brother, doing some parkour and free running tricks. Mainly just some concept shots for an upcoming silly little movie that we’re gonna make one day in the near future. The idea to this movie started from a weird MSN chat the other day with a girl from England I don’t even know… I’ve probably had her on my contact list for a few months, but this is actually the first time we ever talked. I still need to edit the test clips and see if my ideas look any good on screen.
Then later today I went to my cousin and snapped photos of their new family member, a black dog they’ve named Scooby. Luckily it’s doesn’t look anything like Scooby Doo (I totally detest that cartoon btw). I’ll post some photos on Flickr later. Young dogs grow insanely fast and they’re cute only when they’re young. Young dogs tend to be quick on their legs too. Constantly moving around and sniffing on me or my camera. It was hard to take any good photos. I might take some photos in daylight later this week, it already had started to get a bit dusky when I took the first photos outside so I had to crank up the ISO rating on the camera and use the flash, which I don’t like.
Didn’t just read articles and play around with my camera. I also programmed a bit on my Popmundo diary analyzer, Snuggly. Found out that it didn’t work all that well for UK English only for US English, but fortunately the error was quickly solved. I’m still not at all satisfied with the graph output and looks though, and the Apache Commons Fileupload component messes up the UTF-8 characters for some reason. Not a priority right now, but I’ll do fixes and changes to them eventually.
Of course I did read even more articles, such as Tom Robinson’s attempt to recover censored text using Photoshop and JavaScript (some sorts of iterative fuzzy OCR solver). I’ve known for long that you can script Photoshop effects, and much more I suppose, with JavaScript, but I’ve never actually seen it in live action or even tried it myself because I didn’t know where to start or what to do with it. After seeing a flash video I can now say it looks friggin’ awesome!
A comment on his blog suggested improving his pattern matching algorithm with Markov chains, so I went checked out the corresponding article on Wikipedia. Seems like a really good idea, but would of course require a huge database in the right language, so probably hard to implement with a Photoshop script. Then I was remembering how I once at work used the Levenshtein distance to find simple typos or errors in our electronic HTML manual. The algorithm I created was simple enough, but yet accurate enough to help me solve the problem I had.
Later on I found myself reading about N-grams and fuzzy string searches, which I both find highly interesting topics. Naturally I ventured into lots of very scientific articles about spell checking, matrix math, Levenshtein automaton, Turing tests (which happens to be one of my favourite topics, I am both anticipating and dreading the day when conversational AI is good enough to talk with us in a “human way”), language detection, information entropy, text encryption, hard-drive partition encryption… and so on… Can’t even list all the stuff I read, cause the list would be almost endlessly long. I do truly love knowledge, esoteric and common stuff, and don’t think any information is useless. Too bad many interesting scientific concepts go beyond my comprehension: “Some language models built from n-grams are (n − 1)-order Markov models”. After a bit of reading I searched with Google for N-gram databases, and found out that none else than, of course Google released one in 2006! By searching around for applications using it, amongst results I found Chris Harrison’s bi-gram visualisations on his site. Pretty stuff! Be sure to click that link. Structuring and colouring words can actually make a nice poster.
Now, I’m really tired of writing this blog, I don’t even like to write all that much and often. Mostly because I can’t type as fast as I think. While I slowly punch my keyboard I’ve come up with a dozen new ideas to write about. Better that I go back to reading articles… and maybe I’ll blog more about my nerdy habits some other day. So long!:D
Best antivirus for Windows PC
People keep asking me what antivirus software I would recommend them.
Pfft, how the heck would I know, I don’t use Windows or even care so much for anti-virus myself. I don’t even understand how people get viruses in the first place…?! Probably they’re searching Google for, say, Miley Cyrus or Emma Watson’s resent nipple slip pictures and end up on some scam site? Or install dubious pirated software? Haha, deserves them right then! :P
One thing I have to say… People, if you’re running Windows XP, one big thing to improve security is to NOT RUN THE COMPUTER AS AN ADMINISTRATOR. That’s just plain foolish. Only in Windows world you can do that (a stupidity Windows Vista isn’t repeating).
Usually I just said “Use Avast, Avira or AVG”. Those are the three names I can remember by heart. I’ve not done any extensive testing lately, but I’ve generally hear good reviews about them. Time to do a little bit of bit of digging.
Seems like there are people and companies constantly testing these software packages. That’s neat, now I just need to tell people where they can go and figure out for themselves. Here are some links to test results of Anti-Virus software for Windows:
http://www.virusbtn.com/news/2008/09_02
http://www.av-comparatives.org/seiten/comparatives.html (check the Retrospective/ProActive Test for May 2008 unless August results are up yet)
So there you go! Have fun deciphering the results!
ImageMagick
I’m running Kubuntu Hardy 8.04 and was working on a batch conversion script to resize JPEG files and make them look ultra crisp and sharp. I already managed to get a set of parameters for convert that I was quite happy with, but as I was tweaking a bit more yesterday, I found a bug in the software.
convert -version yields:
Version: ImageMagick 6.3.7 02/19/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
When using the parameter -auto-orient images should be rotated according to the EXIF orientation tag. Seems like there’s a bug in this version, cause I can’t get it to work. I found a post in the imagick forums about the same problem:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=11925
Now I guess I just have to wait for the Ubuntu repositories to pick it up so I can get the newer version. Unless I can speed it up somehow, this bug is annoying. Meanwhile I’ll work around it using exiftool and/or jpegorient and/or exifautotran. *Sigh*
Keyboard rant
I’ve not blogged about this or many other small details about my life really, I like to keep many private things private and sometimes I don’t think my small observations are worth writing about. But I think it’s time for me to rant a bit about Linux and software on it. Not just for my readers, but for myself. Maybe I can come back in 5 years time and see if I was right. Oh, and prepare for a long post…
First the backgrounds: I consider myself a power user of operating systems and software, and I would think most people would agree. My work includes designing software for other people too, and my goal is usually to make software simple on the outside but complex on the inside for average users, but enable all complexity for power users like myself. I don’t like having a nerd or geek label on myself though, but I demand lots from my software as any professional would from their expensive power tools. If at all possible, I operate the computer without a mouse and navigate all applications with the keyboard and demand that all applications have good keyboard support. Even on Windows I many times preferred the command line for many batch operations.
Having switched completely from Windows to Linux and the KDE 3 desktop environment, I find myself relearning a lot of basic ways to navigate the system. At first I had custom key bindings that resembled Windows (such as Win+R for run command instead of the KDE default Alt+F2), but after a partial reinstall of some libraries I lost the configuration and use more and more “Linux style” (KDE style) keystrokes. Having a custom set of key command is of course practical for myself, but anyone else using my system would have a hard (or impossible) time to do anything quickly. Security through obfuscation comes to mind, but that’s another topic for another day.
The benefits of having a custom set of keystrokes is of course more operating speed for me, but downsides may be far too many I fear, that I should use them. While I learn my specialized system, some of my unique commands will be stuck in “muscle memory” that aren’t applicable to other systems. So who knows what will happen in some other random system (my clients, friends, family etc.) if I suddenly hit Win+T or Win+Shift+E etc. that may have some meaning on my system, but another on theirs. Sometimes I quickly hit a keyboard command realising too late, that this command is not available on this other system. After a solid 7 months of using Linux, the less I remember how to use Windows. Some would congratulate me for getting away from the Windows habits, but that doesn’t really go well for a computer specialist, who needs to know a fair deal about every system around, and not do any damage when using a borrowed system. Pressing Ctrl+Alt+Del in Linux may initiate a reboot, while in recent versions of Windows it just opens up the task manager. I’m supposed to know and memorise where and when a keyboard command is safe to use. I wouldn’t want to accidentally do a reboot on a system that’s vital to keep online, so I would like to remind myself here and now, that being safe and secure always requires me to think twice before doing anything. Own system = do whatever you want and press your favourite keys. Borrowed system = just use basic commands such as Ctrl+C and Ctrl+V for copy-paste, and use the mouse if you can to slow me down. No job, except hacking in warzones and saving people from burning buildings can be that critical and important that I have to use super fast keyboard commands… right? (Hmm, so keyboard commands are just for my own pleasure!)
On a side-note, I noticed the same happening with mouse gestures for those occasions I actually use the mouse ;) I mainly use the back/forward/close document gestures in Opera and Firefox (easily obtained from https://addons.mozilla.org/en-US/firefox/addon/39). Whenever I use Internet Explorer, I get frustrated for not having gestures there too.
Back to keyboard shortcuts! Today I was browsing my immensely vast collection (no exaggeration here!) collection of photos. From old old habits of some windows software I had, I prefer to hit right and left arrow key instead of space and backspace for browsing to the next and previous image. Depending on the image viewing software, these arrow keys do something else. This time I was using Gwenview on a folder, cause I had just JPEG images. Whenever I press right/left it rotates the image, which totally made me angry.
When you accidentally have rotated an image and then remember to press space, it always pops up a dialogue asking me if I want to save the image changes. I can select “Yes”, “No” and I can also check the a box “Don’t show this dialogue” anymore. I always press NO, because I am viewing images. I don’t ever want to modify my original images. Besides, I don’t trust what it would do to my image. Will it use an internal algoritm, mogrify or jpegtran? Will it preserve EXIF data, will it preserve original modification timestamp for the file? Is there a backup of the original, can I undo the changes? Is it really my job to figure all of this out with this simple Yes / No” dialogue? And what if I actually check the box… where does it store my setting, how can I undo it? If I have the setting saved, will it automatically answer yes or no in the future. Will my image viewer be rendered useless after that? So what do I do, besides get angry? I read the manual. Pressing F1 opens up the Gwenview User Manual. 4 chapters in total.
Revision 1.2.92 (2005-08-21)
Copyright © 2005 Aurélien Gâteau
Table of Contents
1. Introduction
What is Gwenview
2. The interface
Browse and View modes
3. External tools
4. Tips
Using the mouse
Panning with the mouse
Zooming with the mouse
Browsing with the mouse
Key bindings
Docked windows
The manual is from 2005?! You have to be kidding me!! This made me even more angry. In fact, angry to the point that I downloaded the source code by issuing the command
apt-get source gwenview
Then I started examining the source code for the application to see what it did if I rotated the image. It seems to rotate the image just in memory, set a bool mModified to contain true. After a bit of investigation, in the file src/gvcore/document.cpp I disabled the function saveBeforeClosing to do nothing, even if the file has been “modified”.
void Document::saveBeforeClosing( ) {
d->mModified=false;
return;
}
To test my changes, I just needed to recompile the sources. I just recently learned from my friends how to do it the right way in a distribution specific way. Instead of running make && make install, you are supposed to create an installation package with a simple dpkg-buildpackage in the source code root. After that you can just issue dpkg -i on the generated .deb file.
Compilation took a few long minutes but after installation of my custom package, it now stopped asking me about saving my changes. And that’s how I made my image viewer to be less annoying. Of course, I’ve now also changed keyboard shortcuts inside Settings –> Configure Shortcuts to customise my keyboard shortcuts to something that suits me better. Now I have left and right for browse previous and next and Alt+left and Alt+right for rotating the image.
Just don’t let me use your KDE system, I might accidentally destroy your original image files, if your system behaves in the standard, or even worse, in some other custom fashion!
What do we learn from all of this?
Windows is good. Linux is too good.
Now I just need to find a way to disable automatic rotation of the thumbnails and images from the EXIF orientation tag. Some might like it, but it’s slow on my system and I really need to see which images aren’t correctly rotated. Already found the file miscconfig.kcfg, only thing that remains is to understand how it works. Hmm.. Seems to address just the two issues I have with the browser! Don’t ask me about saving and don’t rotate images.
Back to the Configuration dialogue… aha!
It took me the source code not to become blind to the obvious settings! How blind can one get? Back away professionalism, I couldn’t even see the forest for the trees.
I don’t feel stupid for wasting my time trying to hack into the code to solve a trivial problem, not at all. Now I am actually learning how to modify KDE applications for my system, which will undoubtedly come in handy in the future when I plan to submit patches to the official Kubuntu repository :)
Read more about keyboard bindings on KDE here http://www.linux.com/feature/54468
Gallery broken!
Slow turtle
Oh no, there is some database error in my photo exhibition, and all galleries are not shown correctly. I am working on fixing it, sorry for the inconvenience all!
I will try to get it fixed on Sunday. On Saturday I have my sister’s birthday party to attend to.
Edit: So, after a bit of investigation I concluded that there wasn’t an error in the database, but I was merely experiencing a side-effect of being a bit careless.
I suspect a folder got password protected when I edited its name and properties. Firefox 3 has this silly habit of pre-entering passwords into fields, a wrong one in this case, and I missed to clear the password before hitting that save button. Really annoying to say the least. Maybe I should complain to the Mozilla developers about how the password cache works badly, or perhaps I could modify the Photo Exhibition software to use different names for password fields (for login and album properties). That might prevent passwords for getting mixed up liket that.
My website has a forum, webmail, sql administration panel etc. all with different passwords, but somehow Firefox still can’t get it right. Never had the same problem with Opera, by the way. Even Internet Explorer seems to do a much better job at it!
Happy 5 + 10 + 30 years = 2008!
Ooh, I should have written about this ages ago but I’ve been busy, lazy and ignorant for the past month.
2008 is triple milestone in my life.
10 years ago I moved to Finland from Sweden.
5 years ago I started working at the company I work for today.
30 years ago I was born (oh well, later in August. Those other two happened in January)
Happy happy, joy joy?
As it turns out, sure. I’ve had lots of happy times these past 10 years, but I can’t say life always gives grapes, there are bound to be some lemons from time to time.
I’m planning on making some changes in my life this year. Can’t tell yet if they’re for the better or for the worse. Not yet anyways.
I also made a few New Year’s resolutions, mainly as a joke, cause I don’t really like to make them (and I promised in year xxxx that I’d never make then no more).
Of course I chose almost impossible things, so I lasted for about 2 weeks (cause I’m a slave for some of my obsessions ;P). From now I’ll just hold on to my resolution I made several years ago….
Scripting is my passion still it seems. I’ve been working hard (ha!) on the Popodeus scripts, you know, the ones that are supposed to replace my Numeric Grades (+ others). Remember me mentioning that I’m planning to change a few things in life? Well, as a side-effect, I will need to find another server for my website, and I’m currently in the midst of testing it out. If it seems efficient and stable enough (I have my doubts, cause it’s way too cheap….) I’ll move everything there before the big launch of POPODEUS.
Other things hindering development: It requires a version of Greasemonkey not widely available yet…
But we’ll soon be there guys. Grand opening! I promise!
Scripts updated!
Yay,
I posted a revised version of Numeric Grades and Fine Forum helper scripts for Popomundo. They should now be working as usual, if not even better.
Nothing new added though, sorry about that, I only fixed the existing functions to work with the new layout.Since the devs have incorporated some of my script functionality into the core game, I can now remove the skill stars counter and those word-lists from the code. The scriptfiles are now also a bit smaller! Heaps of code gone, and I feel good about it.
Get the Greased machine up and running again…
Okay, so this is pissing me off. I want to code my Greasemonkey scripts for Popomundo. I really do!
But all my time is either spent traveling, or pulling my hair off in despair. Not because of a woman, nooo.. but my computer.
There was a time when I had 1GB of RAM in it, but now it doesn’t boot with the other memory module, so I had to remove it from my machine. Running Windows 2000 server with 512 MB of RAM + Firefox + lots of add-on, a JavaScript development IDE, MSN, Winamp etc. etc. Well. IT IS NOT POSSIBLE! It just trashes memory to the hard drives and is sloooooow.
I hate this! I can’t do any coding on my computer unless I get more RAM and FAST.
It only costs about 30 euros, but I’m too poor to afford it this month.
If 30 of my readers would donate 1 euro each, I’d be quickly up and running again.
(Paypal takes about 30 eurocents per transaction, so giving 1 euro leaves me with 60-70 cents…)
This just sucks!
Help a sad sod to get the greased machine up and running again. Oh Puhleeezze
Edit:
1 donation received so far from Holland! This is making me happy!
Edit 2:
I removed the donation button for now :)
Lost in the secret numbers
I don’t watch that much TV anymore that I used to. One reason for this is that I don’t own a television, and I must confess it is quite liberating.
Still, I do love to watch the occasional episode of CSI, The Shield etc. (I love police/crime/law series and some sci-fi) whenever I get the chance. I’ve always loved shows with witty dialog, smart minds working against each other, and most of times, the good guys win in the end and evil gets what it deserves.
I’ve also been watching the show “Lost”, with those mystical numbers that by now the entire world knows about, and it has that weird island and some stupid fighting between “the others” and the ones from the plane crash.
The show has a really slow pace going on, and the characters don’t ask any intelligent questions when they get the chance. It’s quite annoying, I hate the show, and want it to end because it’s so tedious to watch. But still, I want an explanation for all of it. Maybe I should just wait for the final episode of the final season (whenever that is) and just watch it then. Hopefully all is revealed, but I wouldn’t bet on it. A show with stupid battles in a weird place. Yea. That about summarizes it.
Another set of mystical numbers that has had a wide-spread boom after the Lost numbers, are some sort of encryption (decryption) key for HD-DVDs. (Some better version of the DVD disc) The numbers start as (hexadecimal) “09 F9 11 02 9D 74 E3 5B D8 …” and lots of controversy on the Internet has been raised because of them.
It’s like a Lost-craze, with people wondering what the hell it is all about, are they the code to fame and fortune? Is it dangerous to type them in your online-blog. Will a plane crash if you yell it to the stweardess? Some say it’s a circumvention of the DCMA, some say it’s just a sequence of numbers that pose no threat to the encryption scheme (well, how could it..? You still need some sort of algorithm…)
I haven’t studied this phenomenon too far to know what this is all about. But heck, posting license-keys or secret passwords sounds illegal to me so that’s why the key is not entirely posted in my blog, just to be on the safe side.
But anyways, the reason I started writing this is because I read about a court ruling here in Finland that happened three days ago. The court ruled that unscrambling the old protection scheme in DVDs (called CSS) is not illegal in Finland because the law only forbids decrypting strong protection schemes. I wonder now. Can the HD-DVD encryption scheme (named AACS) be ruled as “ineffective, not strong, thus legal to break” in Finland, now that the decryption key is widely known?
http://www.turre.com/blog/?p=102
Interesting indeed. I hope the smartest guy wins. If not, let’s bring out the battle axes.
Delays
Heya guys. Sorry for not having updated the scripts for a while. I’ve had an interesting and busy period in my life, so no time to sit by the computer! But this weekend I’ll roll out a fixed version that removes features that the devs have added into the game itself so they don’t need to be scripted anymore.
Oh, by the way, did you notice that Greasemonkey was just recently updated to version 0.69? Be sure to get it!
Layout change
Later today I will be uploading new versions that fixes some issues you’ve had with the latest Popomundo scripts. Also, I’m in the midst of changing the layout of my script repository and blog. Even though this current look has gotten some praise, this has only been temporary. Oh, why do all sites want to change looks all the time? Crazy!
P.S.
Retro-looks will not be available.
Changes…
I’ve anticipated some changes on the Popomundo website. Scripts will probably be broken for a few days, but the incompatibilies will be sorted out during this week. Not to worry!
Italian changes again
Small update today.
Updated the Italian numeric grades translation again.
Oh, and from this version and onwards (1.53), the numeric grades update will work again by clicking on the red blinking exclamation mark. I had broken it when I rearranged some stuff on my site.
Italian language change
I’m feeling weird. I don’t need no doctor to tell me that I have a sore throat and headache. Maybe I have the.. cold. Nice. Well, just because of that, I added one change to the numeric grades script. Any songs in the repertoire that is missing a genre will be highlighted. This is for newbies. And for us old-timers, who sometimes forget.
Italian translation was broken, so I fixed that. Revision is now up to 1.5x something…
Main