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 :-).

torsdag 26 februari 2009

Swedish postal services suck

Just a quick note, Swedish postal services suck. They are completely retarded to deal with. Since christmas, I've ordered 5 packages sent via "Posten", 4 of those are lost/stolen.

I've spent over 8 hours on hold and in phonelines to posten trying to report these different losses etc. If you read this, and use Posten for package delivery, or you are a company sending packages to Sweden, please use another service. A list of the packages that has been lost so far:

1. An Acer Aspire One + extra ram, stolen over 1,5 months ago, still haven't received payment for the laptop. According to my research, it could be up to 4-5 months before they get their thumbs out of their asses and pay money to me.
2. Electronics, it was delivered to package delivery, but i never got notified, and after 7 days it was returned -- packages are supposed to be left for 14-30 days, and you're supposed to get notified. Elfa was kind enough to repay me in full.
3. Cell phone, it was delivered in Alvesta since posten claims it's my closest pickup point. For those not knowing, Alvesta is 300-400km away from me. Again, no notification. No payment done in advance.
4. Replacement cell phone, sent over a week ago. Still no notification, possibly gone?

As you can understand, I'm not happy with the services. The only package that I did receive? It was sent with inWarehouse to their own pickup point, 1,5km extra travel to pick it up, but sooo worth it.

Off-work robot fun

As of late, I've been having loads of fun with an old robot of mine, Robby RP5. My biggest complaint at all times has been the fact that it has a horrible 8-bit processor with "some kind of" Basic interpreter/compiler that I never quite figured out because it is so boring and ... well, let's face it, you will never be able to do anything "wow" in a language that is more or less assembler having 4k flash and 256bytes ram where only some 60 bytes are actually available.

As of late, we've been having some fun with zigbee modules at work, and I figured out a way to have fun with my old Robby again. Robby has a serial port, and I'm connecting one zigbee module to that one, and on the other end I've got a zigbee module connected to my computer via USB. On the Robby processor, I got a very simple program that simply talks a protocol sent over the zigbee connection and "implementing" the commands sent in packets. There are 3 packets that can be sent, TrackData, SensorData and RequestData. TrackData packet sent from computer sets speed of both tracks individually, RequestData is sent from computer to Robby and contains a request for a packet back. The Request can either be TrackData or SensorData. SensorData contains data from all sensors supported (currently only IR range sensors).

My first demonstration program on the computer is connected to a joystick and simply transforms the joystick input and sends it to the robot. Pushing button 0 requests sensordata and 1 trackdata.

Right now, I'm looking at porting my robot drivers into the Player/Stage project which I've been looking heavily at as of late, and seems damn cool. I've been testing some of the example robots in the Stage simulator, and if I would port my setup into that project, I should be able to use the available robot "behavioural modules" straight on my robot, and/or test my new modules in a simulator before actually running in the real world. In all honesty, I think player/stage is the best thing I've ever found since sliced bread, it simply opens up for sooo much fun :) . Connect this with a couple of zigbee modules, you can build very simple and cheap robots that are extremely powerful. 60ÜSD robot chassis, 5USD processor, 10USD junk, 30USD for 2 zigbee modules, add some sensors, and you've got as much as you can ask for. Robby for example is around 110USD, probably much lower, a pair of zigbee modules are 30USD.

And yes, I will open this once I feel that I'm closer to finished :-).

tisdag 27 januari 2009

Work? What work?

So, just a brief update. I've recently (a few months back *cough*) taken over our Linux "education" group at work, and it's interesting. The sad part is, we mostly only see people who already knows what Linux is as we're working internally in a world where most people are rather Computer savvy as it is. It's given me a few new viewing angles though, and I'll get back to that at a later point.

Currently working on some Trac guidelines for our Change Management process as well. Working from home today to actually get something done with it, as most of the days I wind up getting too many disturbing calls, talks and discussions to be very efficient. Our first two tries at making a decent workflow winded up a bit messy, and I think we really must get this down properly this time.

There are some other things I react on, and want to fix, for example, as it looks now, every single project sets up their own bugtracking/ticketsystem, and every project uses a different system (trac, mantis, clearcase, dimensions, etc). Preferably, this should be centralized in some fashion, and if possible I'd love to get a bit more homogenized environment. As it is, I try to tell people "look, here's a system for handling your day to day tasks, use it!". First time, the workflow got overly complex, second shot was also overly complex, and people where put off by all the choices and steps to take. This problem mainly stems from project/change management criterion.

My latest and greatest (yeah yeah) workflow should alleviate some of these problems by making some of the choices less visible to normal users. Ie, we have one task management system and a problem and change management system baked into one, but normal users (programmers) only use the task management system, while the project manager, tech project manager and CM also have the ability to handle problems and changes in separate workflows.

We're also adding the ability to have supertickets, where a single problem report can contain several tasks. This is a pseudo development so far, as we're not actually adding the whole deal right now, we're just adding the idea of it, not bounds checking or views/reports of it. Basically, every ticket can have a superticket (we add a numeric field to the ticket), which can point to another ticket, which is the "parent" ticket. This makes it possible to handle a large and complex bug in several smaller tickets. Anyways, the idea is there, but it's not fully implemented. If our management likes it, and the others like it, we could implement it for future usage. I'm worried it's too complex however. At the same time, one complex system might be better than 6 alltogether different systems as it allows for longer time to learn? Kind of like... well, unix for example. Once you find ls, its a darn good bit faster than having to click your way through a whole heap of paths to find the specified file list.

At the same time, both me and PM are a bit tired of Trac's shortcomings, maybe change to Mantis for example? My general thought to this however is, we need to stick it out i'm afraid... one more system will just make the normal user less interested in the new tool and hence taking even longer to learn. As it is, people use it at a bare minimum cause they dont know it, give them time to learn it properly, and they might come to like it. Comments on this line of thinking?

For now, tata. Back to writing.

söndag 4 januari 2009

Christmas ending

So, christmas and new years holidays is coming to an end. A long and arduous autumn/winter at work has ended, and an equally joyful christmas holiday is ending. This has been the year of working for my part, and the experience has been incredible. In all honesty, I've never had the opportunity to work in such a stimulating environment as I have the last few months, and I'm very happy for it.

Me and the girlfriend had the bad habit of buying an Xbox 360 for ourselfs this christmas, which made us realize we have a really small tv, so within 5 days we bought a new one. Then, we realized how bad speakers we have, so we winded up buying a set of bose speakers and new spdif cables within 2-3 days as well. This in turn, and the fact that I finally had some spare time, lead to me spending a lot of time finally getting the HTPC configured and working.

The entire HTPC is worth mentioning since I've put it together from parts, and installed/configured everything on my own. My opinion is that mythtv and ubuntu (mythbuntu) has come a long way as a platform for end users, but they still have a long way to go I'm afraid. My biggest annoyance is still the same it was 12 years ago unfortunately, and I think it's to some extent become even worse over time. Graphics and Sound drivers...

I personally have fairly new nvidia card which I want 3d graphics on, and all the hardware accelerations etc, in other words I'm stuck with the nvidia drivers. You would think it would be easy with the proprietary hardware drivers stuff in Ubuntu, but it's not. It's actually worse than some years ago when I last handled these setups, then all you had to do was compile and install drivers in the correct kernel modules directory. Now you have to fight with umpteenth other installers which crashes and overwrites eachothers and so forth, and then when you do an update, all of a sudden you overwrite your working drivers with nonworking versions and you're stuck trying to figure out just what happened. Also, the choice of good graphics cards has become smaller imho. If you want something powerful, you're stuck with nvidia or ati. Both drivers are completely horrible to get working. I'm hoping the rumours I've heard lately will turn true here, and we'll finally see better support for open source software from both companies, at least if they could make a single decent installer for the proprietary drivers in the common Linux distributions.

And my final gripe, which isn't so large as the other ones, the sound drivers. Sound was absolutely horrible back in the days with OSS, whatever soundcard I tried to install, I winded up with either having to run the trial OSS drivers, or choosing between no sound and buying the OSS drivers. This has become much better happily. It's still not working flawlessly as I just found out (SPDIF took a few hours to get working, and I still haven't gotten 5.1 output to work correctly over SPDIF).

These are critical areas of an OS (you expect sound and graphics to "work out of the box" these days, not having to screw around with settings/drivers/installers as soon as you deviate by a single micron from the specifications.

On top of this, I had some more serious issues with my iMON PAD remote, once again after reinstalling the system. That I can live with, but it's a serious annoyance. For some reason, the configurations shipped with mythbuntu had a bunch of codes that where off by a few numbers every here and there, and then there was a lot of buttons not connected between lirc to mplayer and mythtv.

Apart from this, I'm very happy with the setup by now. The basic functionality is there, but it's made for tweaking and having fun, so there's still a lot of things I'm interested in doing on it :-).

By now, I'm mainly waiting for work to start again, I feel rested, I've gotten to fiddle with some hardware and software, and I got new energy for the new year. I just need to try and get working on my webpage and stuff like that a little bit more so I can finally finish it. Like all IT projects, it's running very late ;-).