Yet another MySQL vs. AppArmor barf

I freaking hate AppArmor! Of course only because I don't want to be bothered when an update makes a mess of it - I really don't know how it works but I don't want to need to know either. Some months ago I tried out Logitech Media Server on my box, and it screwed it up big time. Now it seems there has been an update, so it doesn't accept symlinks anymore. It seems logical that it shouldn't, but Ubuntu could have done a better job fixing it - or maybe it's because I had already edited it, that it didn't get updated..? A search lead me to an issue at Launchpad about it, but I've only skimmed through it. Anyways, today when I rebooted MySQL wouldn't run and /var/log/syslog was filled with entries like this:
Mar 30 11:55:31 tanghus kernel: [ 1309.198481] type=1400 audit(1333101331.343:97): apparmor="DENIED" operation="mknod" parent=1 profile="/usr/sbin/mysqld" name="/run/mysqld/mysqld.sock" pid=7192 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=114 ouid=114
Mar 30 11:55:36 tanghus kernel: [ 1314.463559] init: mysql main process (7192) terminated with status 1
Mar 30 11:55:36 tanghus kernel: [ 1314.463606] init: mysql main process ended, respawning
Mar 30 11:56:01 tanghus kernel: [ 1339.105333] init: mysql post-start process (7194) terminated with status 1
Mar 30 11:56:01 tanghus kernel: [ 1339.111425] type=1400 audit(1333101361.335:98): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=7291 comm="apparmor_parser"
To fix it edit /etc/apparmor.d/usr.sbin.mysqld and replace the lines: /var/run/mysqld/mysqld.pid w, /var/run/mysqld/mysqld.sock w, with: /run/mysqld/mysqld.pid w, /run/mysqld/mysqld.sock w, and restart mysql by running sudo service mysql restart - if it doesn't respawn by itself. AppArmor should automagically refresh from the change of it's configuration file, otherwise run sudo service apparmor restart.

Flattr this!

Is Kubuntu up for a great future?

One could argue so. Harald Sitter (apachelogger) tells that a lot of the base software Kubuntu relies on, will move from the main to universe repository, and that it:
(...) bares a great deal of opportunities for Kubuntu. Primarily it gives the community yet bigger control over what the distribution looks like as we do not need to get software approved to be worthy of Canonical’s support. At the same time it also reduces the policy overhead (main inclusion for those who have heared of it). The detanglement allows us to move even closer to KDE without having to worry about conflicting interests (...)
I have used Kubuntu since one of the first releases (something with a hedgehog?) and enjoy that KDE packages appears in the PPA fast and well tested. One of my major complaints about Kubuntu is that packages such as qtwebkit are totally out of date, and causes crashes and lack of functionality in the up-to-date KDE programs and libraries. Maybe a really community driven Kubuntu will prove to be much better in the long run? Via How Kubuntu Did Not Change | Apachelogger's Log.

Flattr this!

Posted in KDE, Kubuntu. No Comments »

Still not wanting it

Like so many other people have said: It's too little, too late. Google has scared away a LOT of people, including me who wasn't even subject to their name witch hunt. I have deleted my G+ account, and I don't want it back. I don't want to be part of a "community" where I can risk being asked about identification, or if I know the right people. The former sounds like a police state, the latter either as a fancy night club, or the local biker gang - I'm not sure which is worst.

Flattr this!

Posted in Personal. Tags: , . No Comments »

Syncing your N900 with ownCloud

The other day I was lucky to get my hands on and old, solid Nokia N900 device. As I'm very enthusiastic about ownCloud, and currently also coding a bit on the Contacts App, of course the first the I had to do, was to set up syncing ownCloud Calendar and Contacts. Unfortunately that involved getting my hands dirty with syncevolution. I have tried that before with different configurations and devices, but I have always caved in after battling with the huge amount of configuration options and files. It took me from 9 PM to 9 AM to get it to work, but now I do believe I've got it right. Still a little rough around the edges, but that I can always fix, ha :-) As it involved editing a lot of files and running commands in a terminal window, I started with setting up an SSH server on the device. DuckDuckGo came to the rescue, and I found instructions on getting root access and connecting to the device over WiFi with SSH. Once you're logged into the device remember to change to the normal user account with the command 'su user' and go to the users home directory with 'cd'. In this example owncloud refers to the URL to the root of your onCloud installation e.g. http://example.com/owncloud, user is your login and password is - you guessed right - your password 😉 The default first calendar in onCloud is called default calendar. The space in the name is asking for trouble, so I created a new calendar and called it calendar. Easy to remember. First setup the sync to the ownCloud server:
syncevolution --configure \
             --template SyncEvolution \
             backend=CalDAV \
             --sync-property username=user \
             --sync-property password=password \
             --sync-property syncURL=owncloud/apps/calendar/caldav.php/calendars/user/calendar \
             --sync-property deviceId=n900 \
              consumerReady=0 \
             target-config@owncloud-calendar
Test to see if there is a connection to the server by listing the events:
syncevolution --print-items target-config@owncloud-calendar calendar
If you get any errors try to have a look at the access log for the webserver ownCloud uses and read the one syncevolution produces. It's very verbose to say the least. Next setup the connection to the calendar on the device:
syncevolution --configure \
              --template "SyncEvolution Client" \
              syncURL=local://@owncloud-calendar \
              evolutionsource=N900 \
              username= \
              password= \
              type=maemo-events \
              consumerReady=1 \
              owncloud-calendar calendar
The username and password fields are empty on purpose because the credentials for the server sync is used, but for some reason they have to be there. Now it's time to see if it works by running the first sync. It has to be run in slow mode the first time, and yes, it is really slow.
syncevolution --sync slow owncloud-calendar
Syncevolution is very picky on the validity of the data and I had a couple of disturbing error messages during the first sync, but everything seemed to work OK. For doing normal incremental sync run:
syncevolution owncloud-calendar
Of course you don't want to have to open a terminal everytime you want to sync, but I'll leave that as an excercise for the reader 😉 (Hint: look in the Resources section) Now for the Contacts. Set up the server sync:
syncevolution --configure \
              --template SyncEvolution \
              backend=CardDAV \
              --sync-property username=user \
              --sync-property password=password \
              --sync-property syncURL=owncloud/apps/contacts/carddav.php/addressbooks/user/default \
             --sync-property deviceId=n900 \
              consumerReady=0 \
              target-config@owncloud-contacts contacts
And again a test:
syncevolution --print-items target-config@owncloud-contacts contacts
Set up sync to the local address book:
syncevolution --configure \
              --template "SyncEvolution Client" \
              syncURL=local://@owncloud-contacts \
              evolutionsource=file:///home/user/.osso-abook/db \
              username= \
              password= \
              type=evolution-contacts \
              consumerReady=1 \
              owncloud-contacts contacts
Initial slow sync:
syncevolution --sync slow owncloud-contacts
And incremental sync:
syncevolution owncloud-contacts
Syncevolution saves the configuration in ~/.config/syncevolution, so if you mess something up, just run rm -rf ~/.config/syncevolution/* (yes, I have once tried to add an extra space when running a similar command...) This setup will likely also work on the Nokia N800 and N9 and possibly on other devices too. Update: I have made a follow-up on this post with a simplified and more correct configuation. Resources: Sync Maemo 5 / Nokia N900 How to synchronize your Nokia N900's calendar with any calendar accessible to evolution (also if you usually use Thunderbird Lightning, Korganizer, ...) [SyncEvolution] CalDAV/CardDAV backends available How to connect PC to my Nokia N900 over WIFI? Root Access

Flattr this!

Posted in ownCloud, Sync. Tags: , . 68 Comments »

Multiple variable assignment in Javascript

I've been searching for a way to assign values to multiple variables from an array. This is very easy to achieve on Python where you can do something like: fam, giv, add, pre, suf = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';') But I haven't found a solution in Javascript. I've tried: var [fam, giv, add, pre, suf] = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); Which works in Firefox but not in Chrome var (fam, giv, add, pre, suf) = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); Which doesn't work in Firefox. So I give in and try with two-liners instead: var fam, giv, add, pre, suf; (fam, giv, add, pre, suf) = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); or var fam, giv, add, pre, suf; fam, giv, add, pre, suf = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); But none if them works. Finally I tried: var tmpnam = 'Swanson;Graham;Rudolf;Dr.;MD'.split(';'); var fam=tmpnam[0], giv=tmpnam[1], add=tmpnam[2], pre=tmpnam[3], suf = tmpnam[4]; Which works in Firefox, Chrome and rekonq (KDE WebKit based browser). Is it really not possible to do one-line variable assignment like that in Javascript?

Flattr this!

White fish and veggies

This is a very easy dish, where you can pretty much use whatever is in the fridge/freezer - provided of course that you have fish and vegetables 😉
I normally eat it with organic "browne" rice, but you can use basmati rice, jasmine rice or even noodles if you prefer that.
First cut some carrots julienne.
Carrots Julienne
The rest of the vegetables are onions, red peppers, mushrooms and tomatos.
Dice, slice and mix with spices and a generous amount of olive oil.
Dice and Slice
Add the fish on top. It can be any kind of white, firm fish such as pollock or cod. I used some cheap, frozen Alaska pollock.
Add fish
Make a mix of spinach (I use the cheap, frozen stuff), bread crumbs (the stuff you can buy ready-made is just fine), olive oil and season it with salt, freshly ground black pepper and lots of nutmeg.
Spread the mix on top, sprinkle with more bread crumbs and grated cheese and bake at 210° centigrade for around 35-40 minutes or until the the cheese is golden.
Serve with rice.
Cheap, tasty and healthy :-)
 

Flattr this!

Posted in Food, Personal. No Comments »

The Great Features of KDE Workspaces and Applications

Martin Klapetek of KDE fame has made a great blog series of KDE Workspaces and Applications and their many features. Currently he has made three articles:

Dolphin

File Manager.

Klipper

Clipboard Manager.

KSnapshot

Feature rich screenshot utility.

KIO

KIO is a technology that makes arbitrary resources available. Updated to add part IV. via Marty's typepad.

Flattr this!

Posted in KDE. No Comments »

Google Translator discontinued

Google is shutting down their Translate API come December and they have already started to require a REFERER in the request. I would have to make quite a lot of changes to make it work just for the rest of November, so the Google Translator Plasmoid is officially discontinued. https://code.google.com/apis/language/translate/overview.html

Flattr this!

Currency Converter 0.6 released

It took me almost a full year but here's the 0.6 release of my Currency Converter Plasmoid. Most noticeably is the use of Plasma::PopupApplet which let you dock the Plasmoid in the Panel. The (almost) full list of changes can be seen in the Changelog. Download at Google Code or KDE-Look.org or get it via "Add Widgets" from the Plasma Desktop. =-=-=-=-= Powered by Blogilo

Flattr this!

Are you experienced?

Well I'm not, but I'm having a lot of fun :-)

My first two Plasmoids are very simple but gave me a brief look into the possibilities of the Plasma Workspace, and I had to ask a lot of newbie questions on plasma-devel which is a very responsive mailing list. I cannot remember any of my questions that have gone unanswered and most of them with very good solutions and/or answers.

My latest endeavor is a bit more challenging. Plasma doesn't have a simple ListView so you'll have to use a Plasma.ScrollWidget and implement the methods yourself. For me that was somewhat annoying primarily because I'm still fighting a stale battle with the Qt layouts :-)

Now I have to figure out how I'm gonna the cache Last.fm feed and all the pics that I'm downloading. For 3 reasons, the most important is of course performance, followed by the fact that the tests I've run on my crappy HW results in X pixmaps getting corrupted [*], and lastly that it's a part of the Last.fm ToS...

For now I use job = KIO.get(KUrl(url), KIO.NoReload, KIO.HideProgressInfo) and connect to job's signals to get the the feed and to download the thumbnail pics of the events I use KIO.file_copy(from, to). This basically works but how can I get the HTTP Headers? I need to know if I should reuse the data I already have or if I should download it again.

Regarding the actual caching I was considering using a combination of:

KStandardDirs::addResourceDir()

KIconLoader::KIconLoader(const QString &appname = QString(), KStandardDirs *dirs = 0, QObject *parent = 0)

KIcon (const QString &iconName, KIconLoader *iconLoader)

But I'm uncertain how to use them.

Comments are very welcome as I'm a bit stuck here.

[*] I have no idea what I'm talking about here, but I get black icons after running X number of tests :-/

And are no screen shots in this post as the work has mostly been "under the hood".

=-=-=-=-=
Powered by Blogilo

Flattr this!

Posted in KDE, Plasma, Python. Tags: , , . 2 Comments »