Archive for the 'Personal' Category

WordPress replacement?

Friday, September 3rd, 2010

Being frustrated with soooo many security vulnerabilities of my current blogging engine, I decided to find a replacement. Here’s a list of requirements I came up with:

  1. Not written in PHP
  2. No known security vulnerabilities.
  3. Supports customization – I would like to have a Tadek’s theme on it.
  4. Can import my current blog content.
  5. Supports markdown (or a similar syntax. The only thing I hate more than writing html, are bad UIs for generating it).

Since I already have a server, I didn’t want to go for a hosted solution (though I may change my mind on this one, as I did with my e-mail). I quickly discovered that excluding PHP, there’s little out there. Also, I didn’t want to jump to a full-bodied CMS for my puny website.

The more I thought about it, the more I realized I wanted have something very much like WordPress (willing to compromise on some bells and whistles like WYSIWYG editor I personally hate) that is not-Wordpress. Knowing what I to look for, I quickly came across Zine, which is exactly what I was looking for:

  1. It’s written in Python. Yay!
  2. It’s seems pretty nicely written and haven’t seen any mentions of security vulnerabilities (given, it’s a niche product).
  3. It’s really nice – I ported Tadek’s theme in no time. I also really liked the templating language.
  4. I managed to import my blog content in 2 min (I spent another 100 trying to identify two records-of-death).
  5. It has a markdown plugin. Yay!

While playing with Zine, I realized that PHP, with all its drawbacks and issues, has one big advantage: most programs are simple drag-n-drop and modules are very well supported on Debian I run. Having gone through a mixture of obsolete Python modules and easy_install, I started to appreciate simplicity. Ah, did I mention that my swigged psql module would crash apache workers with SEGV at random times?

It sounded like a challenge and, after two evenings, I actually do have a running Zine-powered WordPress replica in Python (I even started implementing some missing functions like adding counts to post categories and search function). The admin UI is awesome and I really like it. With a few days of evening hacking, I would have a really awesome blog in Python. It was only that when I realized that… the Zine and Python are slow. Not just slow, but it’s excruciatingly slow. My server is not the most powerful machine and having to wait almost 10s for the initial page load was way more than I could handle (to give justice, you can enable mamcache/file based caching). This is when I decided to grind my teeth, upgrade the WordPress blog one more time and give another try.

As of now, I am still not writing Zine off, but WordPress is to stay for now (well, at least till I get really annoyed).

T.

PS. I still cannot comprehend why getting WordPress behind SSL (under a different path) is sooooo hard. There used to be a plugin that did this but it since stopped working. But then WordPress’s security track record shows that maybe there’s more to worry about than somebody sniffing your password – just don’t reuse it ;-)

PPS. WordPress Android app is awesome and just works. I can share photos I took with just a few clicks.

I am on the cover!

Saturday, August 28th, 2010

image

Second from the top ;) “Diagonal” (6a) at Ueschenen – an awesome climb with SAC!

Life is Orange

Wednesday, July 28th, 2010

One of the highlights of summer in Zurich is the Orange cinema by the lake. The cinema plays one movie a night mid-Jul till mid-Aug and, as with many good things in Zurich, most tickets sell out on the first day.

image

PS: I took this photo with my Nexus One and uploaded it using an Android app. Cool.

Tadek’s back?

Tuesday, July 27th, 2010

It’s been… almost two years since I blogged anything, so I think it’s time to do something about it, either declare blogging dead for me or… start posting again? ;-)

With a plethora of ways of expressing yourself on the web, including tweeting, status updates, buzzing, broadcasting yourself, not to mention blogging (which seems so passĂ© by now) there’s little excuse and maybe the reason for silence is the most dreaded obvious… maybe don’t have that much to share? ;-)

To prove wrong, I am making a resolution to resume short and more regular blogging.

T.

Cake++

Saturday, December 13th, 2008

We recently visited our friends who started their own start-up. No, not in the Silicon Valley, but here in Kilchberg. And not in IT, but in pâtisserie.

http://cake-plus.ch/

We heard the chocolate cake is to die for. We are so getting it for Christmas, topped with Christmas decorations. Sweet ;-)

Saturday procrastination – how to recognize a good programmer

Sunday, January 13th, 2008

I found this essay on Slashdot yesterday: how to recognize a good programmer. Some of the comments were quite insightful, but many followed the following pattern.

"I am a good programmer myself and I match X% of the qualities you mentioned. Therefore, your article is excellent/good/not so good/crap (depending on the value of X) ;-)

I also read two other articles on the topic:

Pondering about a prime lens for my camera – a scientific approach

Tuesday, March 27th, 2007

I recently got caught up in a discussion about getting a prime lens (== a fixed focal length lens) or another zoom lens for my camera. It seems that I will not be getting a lens anytime soon, but I wrote a cool perl script, which I want to share here ;-)

I decided I should analyze what focal lengths I used while taking my photos so that I can take a more conscious decision. After some trials and errors, what I came up with was:

find . -exec exiftool {} \; | perl -ne  '/^Focal Length.*equivalent:(.*)\)/ && print "$1\n";' | sort | uniq -c

which runs exiftool on all my photos, extracts the 35mm equivalent length (I took my photos with at least 2 different cameras) sorts them and generates a pseudo-histogram.

I thought I was done, but I then realized that something must have been wrong with the data as some of the focal length ranges were well beyond what any of my camera has. I investigated a little and found out that some of the photos from my G3 have an incorrectly calculated 35mm equivalent. This means that such a simple script will not do.

Here is my second try:

find . -exec exiftool {} \; | perl -ne '
if (/^ExifTool/) { $camera = ""; $lens=0; };
if (/^Camera Model Name.*: (.*)/) { $camera = $1; };
if (/^Focal Length.*: (.*)mm/) { $lens = $1; print "\"$camera\" $lens\n"; }; ' > photos-lengths.ssv

Now I have a text file with something like:

"Canon PowerShot G3" 7.2
"Canon EOS 350D DIGITAL" 38.0

This file can be conveniently read into R so that I can plot a real histogram:

lengths <- read.table("photos-lengths.ssv")
lengths_camera <- split(lengths, lengths$V1)
num_cameras <- length(lengths_camera)
old_par <- par(mfrow = c(floor(sqrt(num_cameras)), ceiling(num_cameras / floor(sqrt(num_cameras)))))
# one chart for each camera.
for (c in names(lengths_camera)) {
   l <- lengths_camera[[c]]$V2
   # filter likely corrupted data.
   l_filt <- l [ (5 < l) & ( l < 100) ]
   hist(l_filt, xlab="focal length [mm]", ylab="#photos", main=c, breaks = 30);
}
par(old_par);

This little script produces a nice matrix charts with histograms of focal lengths for all the camera. So the conclusions is that I could get a 30mm prime lens, but also a 10-20mm lens would not be a bad idea ;-)

Recovering deleted photos – my experiences

Thursday, January 4th, 2007
  • (playing with the camera) Cool. You can change the format of the CF card… Whops….
  • My CF card got corrupted.
  • The photos I thought had been already uploaded to the gallery were deleted from both the CF card and the harddisk. Moreover, I already took 50 photos on the CF card after reformatting it.

Time and time again, I realize how precious my photos are, only after they are gone. The last time they were my PhD defense photos… Auch. Fortunately, they are gone, but not forever ;-)

You will find several tools for photo recovery on Google, but most of them either commercial or give you a only a “free preview”. Thinking about it, it’s a very good business model: people are very willing to swipe their card if they can see that they get their photos back. Should have written one as well ;-) Fortunately, there are also free ones, two of them I tried by myself.

PC Inspector Smart Recovery is an excellent and easy-to-use Windows application for photo recovery. It is extremely easy to use and does an amazing job. It is also completely free, but I think is fair to reward the author with a PayPal donation.

PhotoRec is a cross-platform program for photo recovery. In fact, it runs on Dos/Windows/Linux/BSD/Solaris/MacOSX, which is really impressive. It also supports a whole range of filesystems, including FAT/NTFS/Ext2/3/HFS+. It has a simple (n)curses based interface, which is a bit of a disappointment in the age of cool animated GUIs, but it’s also relatively easy to use. Also, it has an impressive range of configuration options. And it works on Linux and my Mac. I no longer need Windows! Simialrly, the program is really free (including the sourcre) and you can rewerd the author with a donation.

Both tools worked for me smoothly and (unlike some other commercial ones I tried which ran out of memory) managed to recover almost one thousand photos from my 4GB CF card, including the wanted defense photos ;-) I don’t know which of the tools is better and I recommend both (although I would lean slightly towards the PhotoRec as I don’t have Windows anymore). Also, if you don’t get what you’re looking for, you can try both of them (as a rule all image/disk recovery tools are read-only so you can try all of them many times with no risk).

Two friends: GeoWebStats and GeoBroStats – visualizing Apache and Bro logs with Google Maps

Tuesday, January 2nd, 2007

One of my pet (a.k.a. procrastination) projects has been to visualize my server logs using Google Maps. In fact, this has been my ‘procrastination hub’ giving me excuses to work on a variety of pet projects, including:

  • playing with Bro and packaging Bro for Debian
  • playing with Apache logs and importing them to the relational database
  • playing with Bro logs and importing them to the relational database
  • learning Python and Javascript
  • playing with Google Maps
  • writing a web application to visualize the collected logs on Google maps
  • creating a webpage documenting all the above.

As with procrastination projects, they are by definition never complete. I do have something working now, and you can see it in action (works best in a decent browser, but should show something in IE as well).

GeoWebStats

Visualizing Apache logs on a webpage. Here are three links (it might take a while to load them for the first time, so please be patient):

The script is quite customizable (for example you can specify the regular expressions you want to filter on, group stuff) but for security resons those demo links are locked.

GeoBroStats

Simiarly to GeoWebStats, GeoBroStats visualizes raw TCP/UDP conections based on Bro conection summaries (this might also take a while to load):

The script is also quite customizable, but for security resons those demo links are locked.

Let me know what you think about it. I know that the user interface is very crude and needs some work. I have also almost finished GeoWebStat’s website, but knowing me, it will take a while ;-)

Dr. Tadek

Friday, December 8th, 2006

Woohoo!

After 3.5 years of work, 0.5 year of writing, 5 months of waiting, 2 months of nerves, 2 weeks of getting really nervous and 1.5 hours of defense it finally came through!

That means that after I publish my thesis, I can be called Dr. Tadek ;-)

I feel a big relief to have successfully closed this chapter of my life. To celebrate this we opened a 1975 Colheita Port, which we have kept for over a year for this occasion (I’ve been saying that I will open it only if and when I graduate).

Now it’s time to do all the stuff I have be putting of until I finish and of course enjoying the first really free weekend!