Moving things around

An obvious thing that changed here is the different theme. Actually, it is just the default wordpress theme for 2019. Behind the scenes, I am moving my services to a different hoster. My ownCloud instance will likely be hosted at home, where I can toy around with traefik and docker compose to get a better understanding of how to run a reva based infinite scale deployment…

I also plan to investigate the indie web a little … maybe move this blog to hugo to get rid of dynamic content as much as possible.

Finally, I plan to move away from google for mails, contacts and calendar. Maybe kopano

Anyway … just letting you know that I am moving things around. Change is welcome!

Why I work on ownCloud

While it is nice that Heise and even Spiegel Online (not to mention great publications in the US as well) are writing positively about ownCloud, I have yet to see an article that captures my personal motivation for working on it. Most articles mention the NSA and how great it is to reclaim the control over your data.That certainly is true. But while ownCloud Inc. is concentrating on file synchronization and solving the Dropbox problem, I think the ownCloud community has set out to do a lot more.

Independence

Looking at the apps repository you can easily recognize one google app replacement after another: calendar, contacts, mail, mapsnews, music, pictures … even documents. Or the Android app. So much for the googleverse. All in all that is a solid foundation on which to get self-hosting again. My main motivation.

Opportunity

Replacing the googleverse is far from easy. And I certainly am aware of their search capabilities. I already started working on a lucene-based full text search of the users files and we will be redesigning ownCloud search for OC7. Maybe at some point in the future someone will start integrating yacy.

Microsoft started integrating their outlook.com accounts with their operating system and allows users to login with an online account. With Gnome and KDE the two big linux Desktop environments also have started integrating ownCloud. Not only as a contacts or calendar backend but also as a music source for Rythmbox / Amarok. That’s only the start…

The nice thing is that ownCloud faces so many challenges, so many opportunities to experiment with the next technology stack, over-hyped framework or whatnot that I’ll never run out of ideas to try out next. Another huge motivation for me: it keeps my mind busy.

Choice

All the related projects and technologies bring me to another motivation: choice. Should I get bored customizing ownCloud, I can always shift my focus to working on a specific app. That already happened and I meanwhile worked on the gallery, search_lucene, music and the files app among other. Should I ever get bored writing PHP I can always go back to Java and work on the Android app, learn Objective-C with the iOS app or maybe C# with the Windows Phone app. I might even shift my attention to the Mirall desktop client which is C++ and Qt. Anything is possible.

The right thing

Faced with data silos like Google, Facebook and Dropbox I fear the power these services could assert over any of their users. I don’t care if their motto is „Don’t be evil“ or whatever nice claim they might come up with. The fact is that humans work there and that other humans have access to my personal data. And humans can do very irrational things.

While the commercial where a father manages a google account for his child until it grows up as some kind of lifelog is touching … it is also frightening. Very frightening. Your whole life digitized. Searchable. Machine readable. A double edged sword if you ask me.

Who would you want to hold it? Someone who earns money by giving away your very personal information? I know the answer to that. And I will do anything I can to allow future generations to wield their own sword.

Join the community

I already became medieval so let me rephrase the above: „Brace yourself! Winter is coming.“ I laid out my personal motivation. Maybe one of them resonates well with your own. Help us shape the future and join the ownCloud community. Start by installing ownCloud now!

Partitioning the SD card for app2ext with adb shell

My Motorola Milestone kept nagging me with “Not enough free disk space”. As I am running the latest FroyoMOD, I started investigating the built in app2sd / app2sd+ / app2ext. Unfortunately, I did not have an SD card reader at hand and tried to use an adb shell to set up the needed partitions while the card was in the phone. Following these steps I soon ran into problems. Nevertheless, it put me on the right track to free some of that precious space on the internal flash and this is what worked for me:

  1. Connect your mobile phone in USB debugging mode and enable “mass storage share”.
  2. Backup your SD card with rsyncI recommend rsync becaus the USB link may not be very stable and copying 16GB of data might need several runs of rsync.
  3. No, seriously! Backup the complete SD card with hidden folders and everything, or else the apps you already moved to the SD card with app2sd will break in this process and leave you with half dead apps that need to be shot.
  4. After the backup, disable “mass storage share”.
  5. adb shell to your device.
  6. Unmount the SD card partitions with umount /mnt/sdcard/.android_secure and umount /mnt/sdcard
  7. Use fdisk /dev/block/mmcblk0 to repartition the SD card to your liking (recommended: 512MB Linux partition for app2ext, rest of SD card for FAT)
    1. Delete the old partition table: d Beware! This is where you wipe the SD card. You did make a backup, right?
    2. Create new primary partition: n p 1 enter +15500M Adjust the value to the size of your SD minus ~512MB.
    3. Mark it as FAT: t b  This will be the new partition visible as „mass storage share“.
    4. Create new primary partition: n p 2 enter enter This will use up the available space of your SD card for the app2ext Linux partition.
    5. Print the new partition table: p
    6. Check that you now have a WIN95 FAT32 partition /dev/block/mmcblk0p1 and a Linux partition /dev/block/mmcblk0p2 If not, read up on fdisk and go back to step a.
    7. Write the new partition table with w.
  8. Format the FAT partition with newfs_msdos -F 32 /dev/block/mmcblk0p1
  9. Format the Linux partition with mkfs.ext2 /dev/block/mmcblk0p2
  10. Convert the ext2 partition to ext4 with tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2 (if you want to use ext2 go to step 11)
  11. Force a filesystem check with e2fsck -fDC0 /dev/block/mmcblk0p2 Fix any errors with y.
  12. Reboot your phone with reboot, FroyoMOD will now automagically mount the partitions as /mnt/sdcard and /sd-ext, move your remaining apps from the phone flash to the new ext partiton on the SD card and in general do some crazy mount and link magic. Read: you do not need to wait for anything to happen at this point.
  13. Enable “mass storage share”. Don’t worry, this will not interfere with the previous step.
  14. Restore your SD card with rsync. This will also restore the apps you moved to the SD with app2sd. Nice to have a backup, right?
  15. Disable “mass storage share” to give your phone complete access to the SD card again.
  16. To move the app2sd apps on the “mass storage share” partition to the new app2ext partition go to Menu -> Settings -> Applications Manage Applications -> On SD Card and move the apps back to the “phone”. This might be confusing, but the app2ext partition is transparent to app2sd, so moving an app to the phone actually moves it to the new app2ext partition on the SD card.
  17. Congratulations, you are done! Enjoy more free space on the phone and slightly better performance (depending on you SD card)!

Bonus hints gained while investigating:

  • The available milestone kernels are missing the swap module, so don’t bother setting up a swap partition.
  • I have not tried creating the 512MB ext partition first and then auto filling up the rest of the SD with FAT, tell me how it goes. It should work.
  • Unfortunately, there is no mkfs.vfat on a running FroyoMOD busybox. And I could not boot into Recovery Mode to see if it was available there.
  • My linux fu is still usefull on an android phone and it was interesting to see the way android taylored linux to its needs.
  • I still don’t understand the difference between app2sd and app2sd+ … if such a thing even exists …

Leave a comment below if I could help you with this.

so long

Ted on a Round-Trip

I recently stumbled upon abstratt’s blog post on Anti-patterns in code generation and could not resist the call for comments. My response got a little bit longer so I am posting it here. I may be biased, because I work at Yatta Solutions, but to keep Ted from pulling out his hair forever, I would continue his story something like this:

Finding the ring in the Land of Mordor

Loosing himself in the World Wide Web looking for the right search terms, Ted falls asleep and starts dreaming…

He finds himself in a bare cold land – alone and freezing, only with his Modeling IDE on his laptop. In the far distance he sees his destination: Mount Doom. A shiver runs down his spine. But being a brave developer, Ted starts to find his way through the Land of Mordor. He keeps his distance from all the beasts, struggeling to find his path. His idea: separating model and code! But then, some rather deep pitfalls are becoming evident, more and more single guards (like his team mates) are gathering. The horde is rising! Finally, a good man comes along, a sage. He tells Ted to think of the solution, not the problem. „Ted, you need help to find your way through Mordor. Find your Sam!“

Suddenly, Ted wonders why his modeling tool is no aid at all. It screws up his changes when generating code and jumbles his model when reverse engineering. „What if it was never meant to match model and code?“ For a second Ted’s pale grey laptop seems to have a wicked evil grin.

At the orc camp

Ted takes a rest to think his mission through. An idea is growing in a corner of his mind. He needs help, he needs another tool! Being a good software engineer, he starts to work out his solution. He starts to build yet-another-case-tool! His idea, now: matching code and model as he, the typical enterprise software developer, wants! Ted thinks about pattern and best practices, about all the things his tool will be able to do. He gets really excited about his tool, his precious tool – his one ring…

At the beginning, Ted works out a new kick-ass code generator. In fact, there are many pretty good code generators out there as Ted knows, but he wants his own precious „friend“. So, Ted works hard until it is done. His ring … err, tool … uses templates for code generation. They allow him to stay agile by adapting the code generation to his changing project needs. He develops his own template language – instead of using Xpand/Xtend.

Then, Ted starts working on the reverse engineering: first, he builds a tool to merge all his code changes back into his model. Just having finished (and being a bit jumpy), Ted starts running his tool – and it works! All his code changes were transferred into his model. The model grew and became more detailed. But then, Ted realizes the problem: his model got flooded with implementation details. Getters, setters, toString, iteratorOfStuff … they all got into his pure model – his beautiful clear model, it became ugly and senseless.

After thinking of protected regions – and discarding this non-solution –, Ted starts writing a parser. The parser is meant to recognize code patterns and merge them back into his model. After reverse engineering his project again, Ted gets really excited. „Yes, I did it!“ His model looks as expected, pretty and simple, – and it seems to contain his manual changes, doesn’t it? So, Ted continues developing by modeling some more classes, changing some property names and dragging some new associations. Generating code again, the word „easy“ crosses his mind. Still dreaming, Ted takes a look at the code: „FFFFUUUUUUUUUU… What a nightmare!“ His precious tool screwed up his code again! Somewhere in the guts of the parser there is a mismatch between the details the code generator adds to the code and the details the parser hides from the model.

Suddenly, it hits Teds mind: „Why not useing the same code generation templates for reverse engineering?“

Awakening

Ted awakes with a start and does a quick google search for „template-based round-trip-engineering“: … „Hmm, a scientific paper… another one … come on, I just had that idea, it ain’t rocket science! Wait, what’s that? UML Lab?“

*clicketiclick*

Ted quickly skimms the section on „Round-Rrip-Engineering NG“. Having a look at the screenshots and videos, he decides to download UML Lab ( from the eclipse marketplace | as a RCP ). The tool tour takes him through a simple example, giving him an idea of template-based reverse engineering, modeling, code generation and hacking. He leans back smiling, finally having reached his goal: truly agile modeling and coding.

His nightmare long forgotten, Ted ( coded | modeled ) happily ever after.

A simple JAX-RS security context example in GlassFish

When creating a REST api with Java EE 6 and JAX-RS there comes the time when you start thinking about security. In our case we were trying to set up HTTP Basic Auth for the REST api to identify users and keep them from deleting other peoples stuff. It took me a while to understand the different aspects of configuring HTTP Basic Auth when using GlassFish:

  1. Use SecurityContext in your Java code to access the authentication information.
  2. To enable HTTP Basic Auth add a <security-constraint> section to your web.xml
  3. Map user roles to GlassFish groups by creating a sun-web.xml
  4. Configure a FileRealm / JDBCRealm in GlassFish to store user passwords

I will detail the steps with a simple deleteRating() example and xml snippets.
„A simple JAX-RS security context example in GlassFish“ weiterlesen

Blog migration from s9y to wp finished

I just finished configuring the redirects for the old s9y urls. Posts, Feeds and Tags should now redirect to the proper wordpress pages. Unfortunately, the script I used to migrate the content left out the tags, so I retagged all the posts. On the bright side I now know which posts still need to be fixed because an image did not get uploaded or a link is broken.

I still need to think of a use for categories … so the site will be in flux a few more days. Lets see how google handles the new url, as http://blog.butonic.de now points to http://butonic.de, the new wordpress installation.

updates and breakdowns and upgrades

I don’t exactly remember when the server started to fall apart. I wanted to move from hardy to lucid and ended up juggling the partitions to create a small gap between the MBR and the first partition. You know, thats where the grub bootloader puts some of his code … at least it warns you about this. That star-hosting uses a completely anarchistic rescue image did not make it any easier.

In the process  I also moved from serendipity to WordPress. Mainly because an Android app is availiable. I’ll take this as an opportunity to restart my blogging efforts. So, expect posts more often in the future.

possible nickname explanations

I tried out the Cuil search engine and typed in my nickname. It did not find my website, but I found this in the Hellatine Dictionary of Bureaucratese:

butonic;
n., Any political view or ideology reduced to a slogan designed to fit on a pin, button or other small clothing accessory, as either a symbol or as text. adj.. Describing a political stand which has been reduced, ad absurdam, to fit the limted intellectual or philosophical capacity of its proponent. Also butonism.
(Fr. boutonier: a decorative element worn in a buttonhole)