Blog moved to Nesta CMS

Finally! It took me almost 8 hours to completely recode my HTML-output of this blog to Markdown, but now finally the whole site is running Nesta CMS.

Mainly the goal was to speed up the page and having more control over it, which is definately the case when i do things myself. Anyway, works like a charm and now we have also a working Atom Feed.

Nesta is a small CMS/Blog written in Ruby. It is slim (uses Sinatra and static files) but still gives me a lot of options (haml, Textile, Markdown).

You should definately check Nesta out, i am running my company website of Bettag Systems UG (haftungsbeschränkt) for quite a few years. Running stable and without any hassle.

Cheers

Homebrew for OSX

Homebrew is the missing Package Management Software for OSX. It is also a new kid on the Block, since it is an alternative to MacPorts which is IMHO good, but from past decade!

Homebrew consists of a git repository which has “recipes” for how to install certain software. Basically like NetBSD pkgsrc, Gentoo’s portage or Archlinux PKGBUILD. Luckily, these scripts are super-easy ruby scripts which can be commited to Homebrew through Github pull-requests. I myself recently added two packages and another one way back (tho not through a pull-request doh).

For academic cough reasons i updated Metasploit from 3.4 to 3.7.1 and added THC amap. If you look at the ruby script, it’s really super easy. Even Monkeys could do it.

https://github.com/fbettag/homebrew/blob/10808a4d1a4793e7fb961c954f367f629eb54ad5/Library/Formula/amap.rb

So that’s me for tonight, i’m back from my vacation, so expect some more content soon. Also, i am planning on moving this Blog once and for all away from posterous, as the performance seems really bad.

Google Dorking with Ruby

Today i’ve written a little script which helps you dorks out there googling. ;)

It’s nothing fancy, but it might help you beginners get started and maybe some of you advanced dorks save some time.

Check it out, it’s free so grab it while it’s hot.

iOS/iPhoneOS Equalizer with libsox - doing some effects

Today i will show you how to do sound effects from within iOS using libsox.

It is pretty straight forward, the code is here:

I’ve added a variable (int)tprofile which can be used for different effects without having to rewrite or copy everything. Simply apply your effects in an if-clause and be the king of the hill! At least know i am! :)

best regards fellow Apple survivors

iOS/iPhoneOS Equalizer with libsox - making it a .framework

So i’ve spent the past few weeks with an issue i’ve been having for quite a while now: Equalization on iOS.

I’ve tried everything, from AudioUnit, OpenAL and FMod. None of which worked.

  • AudioUnit needs formulas which look like they’ve found on a ship at Roswell..
  • OpenAL seems to have all of it’s effects ripped out by Apple..
  • FMod requires you to know it’s own language..

Frustrating.. i even thought about having a Webservice do the job, but that seemed useless for offline usage.

I once again checked out all available options when one thing seemed ideal, sox! You may know sox if you’ve played around with Audiofile conversion on Linux, especially PBX Setups which require you to convert you favorite MP3s into something your PBX can play.

Anyway, i checked out all libraries, ffmpeg, libav and libsox. Since the command line version of sox delivered nice test results with my equalization attempts, i started to try to get the current release to compile on SDK 4.3. I had massive troubles at first, but then i found this post.

I have modified the script to make it work plus have it create you a SOX.framework:

Please excuse my lazyness, i didn’t cleanup the script, but it works. ;)

It autocompiles the lib for armv6, armv7 and i386, therefore making one big massive framework for all 3 architectures using Apple’s lipo utility (which is included in xcode).

With this script placed in your sox source folder you simply have to run it.

What you finally need to do is to add the SOX.framework and two headerfiles sox.h and soxstdint.h to your Xcode Project.

If you want all files seperately, i took the liberty to adjust the script’s output path to $sox-srcdir/iOS-<Version>-<arch>. Every file needed will be in those folders from withint your sox sourcedir:

  • iOS-4.3-i386/
  • iOS-4.3-armv6/
  • iOS-4.3-armv7/

Having that done, you can do an #import “sox.h” in your project and start working on some effects.

In my next post i will be covering how to do those effects.

My absence

I want to apologize for my absence in the past few months, but there have been some decision i had to make.
One being that i quit my full-time job being an Objective-C/iOS Developer, since my contract says that i am not allowed to perform commercial iOS Coding, i will be doing something else for a while. That does not mean that i won’t blog anymore, i will just alter my focus from iOS to something else.

Another decision is, that i want to leave my workspace as clear as possible, meaning that i want to introduce and guide my fellow coders (currently being 1 apprentice) into my code, so they can go on. So far i’ve gotten very good feedback that my code is wonderful to read. Although i don’t seem to make much comments (i’ve been told), my code is pretty much self explaining. Who doesn’t love to hear that?

I don’t know what the future holds for me, i hope it has better plans than it had in 2009 and 2010 for me. My biggest customer going broke which lead to the unemployment of 5 people (which still bugs me) and the closure of my company and of course my biggest loss, my favorite grandma passing.

At this point, i want to write a few lines about my grandmother. She was and will ever be the most inspiring person to me, she knew everything. She was the first one who stressed me how important it was to learn english while she herself spoke and understood 5 or 6 languages fluently. I only know about German, French, English and Italian, but she also has a lot of cookbooks in alot of different languages. The thing i loved so much about her was, that she cooked the shit out of any kitchen. Although her food might have been a bit exotic for a little boy, but that’s how she tought me to always try food first before saying “eww”. “Only dumb kids judge food by the way it looks, the smart kids judge by the taste!” was what she used to say to me. And today? I eat almost anything, tho i have my problems with worms, bugs and other creepy stuff. But really, who likes that?

Looking into the future, i am currently thinking about developing for Android, since i have gained a very good insight on how to work with mobile devices during my almost two years it iOS development now.

Since i am still working until end of March, i will be busy until then after that i have planned some months of vacation. I guess i’ll be off the grid from April to June to rearrange a few of my thoughts and priorities.

Maybe i will blog from where i am or where i’ve been, depending on the WiFi and 3G coverage of that particular area i am in. Since i don’t know where i will go, i won’t be able to answer this upfront. :)

So wish me luck for the future, i’ll be back in a couple of months.

cheers

Beware of upper()/lower() in PostgreSQL

Happy new year to all of you.

Today i’m going into performance impacts which can come from upper()/lower(). If you were already aware of these things, you won’t be impressed, but if you’re like me, optimizing your setup which is 5 years old, you will be amazed.

So i was upgrading my PowerDNS setup for my new customer interface, when i stumpled upon this:

This query is performed on a view which is mapping my ruby DataMapper Models into one that is by default usable by PowerDNS. After i’ve killed the upper() (god know’s why i’ve placed it there 5 years ago), the query looks like this:

Seem’s like i’ve just made a timewarp from 3.5ms to 0.3ms querytime.

What did we learn? Audit and Benchmark old stuff once in a while, or at least when you’ve learned a lot since you’ve last touched it.

ArchLinux domU - Setup Script

Today i played around with ArchLinux, a very neat distro!

I am always trying to keep my software as minimalistic as possible, so i can easily reproduce my setups. Having similar setups helps you to keep administrative tasks to a minimum.

For the past 8 years since the first official release, i was a Gentoo fan. Sure, i used some Debian boxes for this and had BSD boxes for my most precious tasks. Gentoo was always this comfortable distribution that didn’t dictate which features i had in my default packages, since i could choose “USE”-Flags myself.

These days, having over 55 Gentoo domUs, i managed to get around with a bindist host and some custom scripts, but that’s over.

ArchLinux

ArchLinux gives me that extra “slickness” i wanted, by removing compile-time depedencies on the core-system. In Gentoo i hardly customized settings there, except build flags, but hey.. Anyway, the ArchLinux base seemed slick enough to beat Gentoo’s, so i gave it a shot.

The first thing i do when i try a new distro is to reproduce existing setups, because i mostly have the config files for the service i want to have running. I had chosen to replace my primary nameserver, which i had replaced in under an hour.

The biggest problem for a distro like ArchLinux is, that they have still a bit too much packages in the base, so i found my self removing usbutils, rp-pppoe and some mkcpio-crap for creating kernel images. Anyway, i found that instead of installing it from the dom0 with -S base, i could specify my own packages.

Before you run this script, you need to install pacman. On gentoo i could emerge it, otherwise check archlinux.org.

So i thought that i could customize that script, but i ended up only stealing the “echo” lines. It looks like this:

Please read and customize it before using it!

I am NOT responsible for any data-loss, corruption or alien invasions!

It downloads the latest version of packer from github, which is by far the niftiest client to xmlrpc which wraps makepkg and pacman i’ve ever used. Wait what? Yeah, that’s right! It’s a shell-script which helps you install custom PKGBUILD scripts. ;)

So, i consider this my Christmas present to you all, so have fun trying out an ArchLinux domU!

git lol - the other git log

So i got tired of the git log default output, since it was simply too bloated for my Macbook Pro Terminal. It’s ok my 30” Apple Cinema Display (or one of the other 22” surrounding it), but even there it doesn’t show me enough for my taste.

The default output looks something like this:

Imagine this for 300+ commits, you literally will never see the end of it.

After diddling around with git log parameters, i’ve come up with this neat constellation.

Enjoy

Ever forgot to sync one of your hundred git repositories?

I guess it happens to all of us, you sit at work, you commit your changes, then you go home. While driving in your car, you might come across the thought “darn, did i push my changes?”. If you are one of those people who have so much repositories, you cannot track in your head which one needs a pull or push, then git-sync might be your solution.

It is by no means perfect, it’s just a little script i hacked up this morning:

Now when you run “git sync”, it will sync all your repos found in $REPODIR. Crontab it to like 6pm, so when you get home, you can be sure everything is pushed. Also you could do this in the morning to ensure your nightly changes you might have made at home are on your workstation.

Enjoy.