fredag 20 november 2009

Moved blog

The blog and all posts has been moved to my main site:
http://www.frozentux.net

If you wish to read new or old material, please go there instead.
Thank you!

Oskar Andreasson

söndag 13 september 2009

Example transforming videos

I recently made some video editing on videos i copied to and from my cell phone and realized some of the stuff might be rather esoteric and hard to find good examples on how to do. Basically just going to post some minor tips and tricks that I picked up, and some very simple commands to use with mencoder, ffmpeg and kino.

I used mencoder and ffmpeg to do some of the basic edits, like turning videos around etc. After the basic video snippets where done, throw them into kino and make the final cut, and then recode the video into a distributable format (10 minute video in dv format as used in kino = 2.1gig data, while 10minute divx of the same video = 170 meg).

#Rotate video 90degrees
oan@laptop4:~$ mencoder -o lala.avi -vf-add rotate=1 V170709_12.54.AVI -oac copy -ovc lavc

#Postprocessing filters, ac = high quality
oan@laptop4:~/Desktop$ mencoder -o lala.avi -vf pp=ac V170709_12.54-recode.AVI -oac copy -ovc lavc

#Transcode video so it works on cellphone (KC910), this "works for me"(tm)
oan@laptop4:~/Videos$ mencoder -o lala.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4 alice-final.avi

# Create a black 2 second frame (25 fps, 50 frames), I used this as a filler between
# two movies. There's probably easier ways of doing this, but it "works for me"(tm)
oan@laptop4:~/Pictures/2009-08-01$ ffmpeg -r 25 -loop_input -i black.jpg -vcodec mjpeg -vframes 50 -y -an test.avi


Finally I put the videos together in kino in the order I wanted, with black frames in between and effects fading from the videos into black, and so forth, making for smooth transitions.

torsdag 20 augusti 2009

Dpkg and apt-get reading database is really slow [fixed]

I've had problems many times with the "reading database" step in deb package based systems getting really slow. Today it took over 1,5 minute on a quad core machine with 4 gig ram, which is simply over the top for me.

Within 5 minutes of searching I found this:

http://antti-juhani.kaijanaho.fi/newblog/archives/521

So a total of 7 minutes later, it takes me less than 2 seconds to install small packages again. I should've found this earlier :-).

söndag 16 augusti 2009

Migrating windows to virtualbox

I finally got rid of the last windows computer in our home. My laptop had a backup installation of Windows XP just in case I realized I had either forgotten something on that partition, or I realized I had some need I had forgotten. This partition has now been moved to virtualbox on my workstation via the http://www.virtualbox.org/wiki/Migrate_Windows how-to.

Also, my wifes laptop running Windows Vista stopped working (again), and she had finally had enough of the problems that Windows installation has caused so she asked me to remove Windows Vista and install Ubuntu 9.04. The harddrive was also copied over to the workstation and I tried the same how-to as above, but it didn't work properly unfortunately, so I winded up just moving the harddrive inside my old Windows XP installation.

Once this is done, I'm planning to reduce the size of the harddrives. This is 220gig data at the moment, so it could be a good thing. I will try http://forums.virtualbox.org/viewtopic.php?p=572#p572 and see how it goes. Once that is done, I'm almost 100% free of all the problems we've had with Windows. The only windows I have left is the backups for emergencies.

fredag 24 juli 2009

LG KC910 woes

As I've already said in earlier postings I relatively recently got myself a LG KC910 Renoir phone. The phone has been the cause of a lot of woes and problems so far and I'm afraid I must say I regret not getting a proper Android or iphone from the beginning. As it is, I'm stuck with this phone for another year+ until the subscription runs out - or get some other phone on my own tab.

The one really great part that I love about the KC910 so far is the absolutely wonderful camera, it has a 8MP camera that takes rather splendid snaps for a cellphone camera. Also, the video recording function, and video/music playback is rather nice.

For the really really bad part, well, look at the rest. Three of the main reasons I got this phone was for the ability to get some websurfing done "on the go", and to get a good calendar that could be synced vs my work and private calendars, and finally I wanted to use the phone straight off for connecting to the internet instead of some dongle. Both these functions are completely botched in the KC910 as the, the webbrowser lacks a lot of functionality practically making most of the internet unusable on the phone, and the browser is also horribly slow, taking tens of seconds to "calculate/draw" complex webpages after its actually loaded. This problem should be easily solvable by downloading and installing another browser such as Opera you say, sadly, the install process hangs halfway through on the Renoir, and I have so far to find another browser that actually installs at all, which kind of brings a fourth point up (applications/third party market).

Second problem was the calendar, which is unfortunately totally borked. For basic calendar tasks it works fairly well, but very soon you will realize it doesn't work very well. It lacks good support for reoccuring activities, the sync applications has a bad habit of screwing up timezones and actually moving activities/entries around based on timezones and at occasions it deleted entries entirely, and worst of all, LG has chosen to go all the way with their PC Suite set of applications, which essentially bars you from using anything but officially supported Microsoft Windows XP/Vista and Outlook. This goes for pretty much all functionality in the phone. Getting it to work with thunderbird, well, good luck. This is one of the reasons I had to work very hard getting Funambol setup at home to sync the phone and thunderbird with (I can not use a third party server as some calendar entries may in worst case contain sensitive data). The functionality of this setup worked out to be "semi-decent" to crap at best, and in the end I winded up reverting to just using my computer calendars.

My third problem has been internet connections. The only supported way of connecting to the internet is (again) via their PC Suite crapware. All other phone manufacturers support Bluetooth DUN or serial port connections without a problem, but not LG. It halfway supports DUN connections, I get a connection the first time that doesnt work, then get disconnected, and after that it takes 2+ days until I can connect again, and get disconnected again, exactly the same thing happened in Linux, Vista, XP, with/without PC Suite, over USB/Bluetooth, in accordance with 3's and LG's support etc. In the end, after 3-4 weeks of messing with this, I winded up getting a Huawei E180 HSPA USB stick, 30 seconds to unpack, plug in and click two buttons in Ubuntu and I was connected to the Internet.

My final annoyance is the lack of a third party aftermarket of some kind, I'm talking anything like the Iphone/Android app-store. A smart phone without a serious aftermarket support is pretty much as dumb as any old "dumb phone" ever was. LG has some eclipse based SDK's available for download, but they only work for Windows, which has stopped me from actually trying them out at all so far, as I quit using windows completely half a year back. Anyways, the big problem is that there is no coordinated effort to make a decent app-store or app-store-a-like place to go for your applications for this phone. As always, the phone producers completely fails at understanding this part, in this day and age, you need to create officially endorsed systems of managing, getting and paying for applications. Whom the problem should fall upon is a hard question, but just dumping the problem on someone elses porch is not sufficient in this day and age, especially if you want to make phones that tries to emulate the success of "the big one", you need to at least try and understand what made it big. It wasn't a good camera or a nice looking (but slow) gui. It's the ability to be adapted to my requirements, and to perform my required tasks. You can not predict it all (my needs are not your needs), hence adapt to standards (make shit plug and play with others), and make every effort you can to create a third party aftermarket that works (signed downloads, payments, etc etc).

As a verdict, if you're looking for a smartphone/iphone/android, dont get an LG.

söndag 3 maj 2009

Syncing strategies

Another problem has (mostly) been solved for me it seems. I've had quite a lot of problems the last few months with calendars and email and contacts being out of sync between workplaces and my private computers/cellphones etc. The problem has been that I've gotten a new contract and hence am relocated to another workplace. My employer has a stupid (ok, maybe not so stupid, but annoying me nonetheless) policy of not allowing any e-mail to internal addresses be forwarded or fetched from external networks. At the same time, my contracting has put a heavy load on the calendar and all of a sudden I understand everyones problems with syncing e-mail/contacts/calendars etc... it's really a must.

Anyways, in short, I started out with 4 calendars (workplace1, workplace2, home1, home2(laptop) and cellphone) needing sync, and using Microsoft Exchange weirdo protocols was not an option (I'm not using Windows or Outlook at home anymore). This has later been extended to sync contacts and my two instances of thunderbird (not yet finished). So, in short:
  1. Workplace1 = Windows Vista with bluetooth
  2. Workplace2 = Microsoft Exchange server with limited access.
  3. Home1 = Ubuntu with thunderbird
  4. Home2 = Old Laptop, Windows XP with thunderbird, will likely migrate to Linux soon as well since I barely use it anymore due to the OS on it.
  5. Cellphone = LG KC910 with bluetooth and wifi.
First off, finding a sync strategy wasn't easy. First, decide on where your "central repository" is, or rather which will be your main device. My current solution relies on cellphone (LG KC910) being the central repository since it's the only common gadget at all locations. connection at workplace1 is directly over bluetooth to the KC910 using the LG sync application. The application is absolutely horrible, but it does it's job (barely). Unfortunately LG relies on a proprietary bluetooth protocol for syncing so I have yet to find any decent replacement applications.

My big problem was finding a working solution at home, and I think I finally found it in Funambol (https://www.forge.funambol.org/DomainHome.html) which is a SyncML server. Basically, I got a server on my local network running Funambol, when I get home, connect to the local wifi, and sync with funambol (See http://www.mobyko.com/phoneinfo/lg/renoirkc910Info.do, a bit down for instructions). The funambol server then acts as a "central repository" when I'm at home containing all calendars etc. Thunderbird sessions on Home1 and Home2 uses the funambol addon (https://addons.mozilla.org/en-US/thunderbird/addon/8616) to sync with the funambol server.

WARNING! So far I dont trust funambol to run on the public internet, for one part it seems to be sending passwords in cleartext, as well as data. I'd love to figure out a way to get it all encrypted using SSL/https, but I'm a complete newbie to Tomcat (base plattform for funambol) as well as java. As far as possible, try to use a closed/encrypted network for this unless you get https running imho.

A second note on Funambol is that I had some really funny Timezone problems when setting it up, all devices run the correct timezones, but for some reason my calendars winded up being winded 2 hours into the future at home, I got it fixed by setting all timezones in funambol for all devices manually, and then disabling the timezone handling in funambol... don't ask me why it fixed it etc, I hate working with timezones ;) .

All that said, I really think SyncML was a big saviour for me in the end, but I had a hard time finding a single word on it or anyone really recommending it. Bluetooth just needs to be .... well, better support, and everyone needs to agree on standards. Everyone (companies) seems to be running around doing their own thing, which means Linux has very good basic bluetooth support, but none of the higher layer stuff since it's badly implemented or proprietary.

torsdag 9 april 2009

Inproductive productivity

For a while I've been stuck in slow speed mode again, not really doing great work, just being on average. It feels weird. Don't really get much done, but I have on the other hand had a great deal of time to test some "new" technologies, well, new as in only 10-15 years old I guess :-). I'll get back to that later. Also, I've begun a new contract at "a big telecom company".

This is my first time at a really giant hunk of a company, the biggest I've seen before was circa 500 people in all, and it moved slower (the beaurocracy) than this in all honesty. This BigCompany is actually quite interesting to me. Started off with almost 4 weeks of introductions, courses, and so forth. They have a dedicated TEAM of CM's, that alone is just... wow :-P. I've just been put up to speed and started working a little before this weekend so I might be a bit premature, but I like it so far. The weird part is, things actually happen, but not as I'm used to it. I'm used to 13+hour days and frentic coding/hacking to get things to happen, everyone here eschews away with their 8 hour days -- only working overtime at very special occasions -- yet slowly things get done, new functionality gets added and so forth.

Another thing that kind of amazes me -- and worries me to some extent -- is the kind of planning that is done. I'm used to small scale projects with workpackages or task based development, where no workpackage should ever take more than 4-5 days to implement. This place uses a workpackage development structure where each package takes up to 6-7 weeks for 6-10 people to implement. We'll see how it works out -- at least their "stand-up meetings" actually works :-).

All that being said, I had the time to write quite a bit of python which is a first, then I've looked into d-bus architecture which is also a first, and I also looked into Bluetooth and how to use it -- some test applications running, fetching services and graphically displaying info about all units it finds etc. The complexity of Bluetooth is rather saddening imho, it's a horrible protocolstack to work with in some senses, even though I was really impressed by how much python does for you.

I've been unused to the whole concept of python before this, and just a tad sceptical. Mainly because of all the problems with version matching that you always wind up having to do, to make anything work properly (try getting scons, trac and wamp, and some more tools working on a win32 machine some day for some fun).

Anyways, I always figured there has to be an upside, and there really is -- python is hackfriendly :-) . In less than 3-4 hours I went from writing my first simple helloworld to having a scratch written class based graphical (tkinter) interface implementing some very fundamental bluetooth commands. In my world, thats not bad at all ;).

I've also had time to learn a lot of new tools at work. I'll comment on those some other day as I havent seen much other comments on some of them (some is imho very expensive crap with a nice wrappings, while some actually are completely awesome). Sidenote, I simply adore the systems we are working on 4 xeon with 4cores and 64 gig ram.

I'll get back later :-).