PHP Testfest in Munich

We will have another great PHP Testfest this year in Munich on Thursday and Friday 16th/17th April. This time we will also have a nice evening event with some talks around testing PHP and PHP’s internals. So it’s not just a great place to get in contact with other people from the community but also to learn something.

No knowledge about C or PHP’s internals is needed. We will provide you with everything you need.
Check the wiki page for more information about the event. It’s definatly worth joining us.

Merge vs. Rebase – A deep dive into the mysteries of revision control

I remember the days when I started learning Git about two years ago. I crawled through all the available commands and read the man pages what they are for and I remember when I stumbled over rebase and stuck. After figuring out what it actually does, I start loving it, but didn’t understand it’s dangerousness until someday I somehow got duplicated commits after pulling from another repository. So let me explain what goes wrong and why merge and rebase are often misunderstood. I’ll also present a list of golden-rules about their usage. Before we start with explaining both commands, I would like to give you one of the most important rules, in case you don’t want to read the complete article.

Never rebase branches or trees that you pulled. Only rebase local branches.

Read the rest of this entry »

A really unfriendly and not so fair approach to GIT vs. Mercurial

Okay, this is one of the posts I wanted to since about 1 year, but now, nearly 2 years after the first git vs. Mercurial blog post I finally made it to actually write a second time about this topic. A first notice: I won’t cover bazaar. I personally hate it with passion and think it is the worst approach to DVCS ever. Nevertheless git and Mercurial fight in the same game with the same weapons (unlike bzr which is just far behind).

WARNING: This is the most subjective, most pointless approach to this topic ever. I didn’t read it myself a second time, I just published it.

I will start the same way as last time:

git
Git is a decentralized version control system written by Linus Torvalds to replace bitkeeper as the version control system of choice for the kernel because of licensing issues (okay I know this is the short story and it was much more complex and you can write a thousand lines about that, but it’s enough for most people). Git is designed to be fast. Everthing is optimized in that way. It contains a huge C written core with a lot of bash and perl scripts around it. A few years ago the C written part formed the so called plumbing. Nowadays the git community tries to replace high-level commands written in bash and perl that call the plumbing commands with c-written code to get a more consistent code base.
Let’s make a long story short:
Git is powerful. Awesome powerful. This is true since git’s beginning, but back then it lacks a good interface and the git community did a great job in improving the horrible interface git had once. Git is still awesomely fast. Commits, bisecting, everything works like a charm particularly on big projects like the kernel. They can rewrite history, they are doing a great job in helping intergrators to apply patches, reviewing them, and pushing to multiple sources. Everything about git is really unique, their focus on a powerful command set, their branching support and their targeted audience. I want to talk a little bit about that fancy branching support. Frankly, every version control system, even the 3rd generation decentralized ones have a pretty conservative way of doing branching by giving every changeset a name that the changeset belongs to (at least this is true for mercurial, and called named branches there). Git just gives a sh** about that and takes a version control branch the same way as a tree branch. It’s just an unnamed branch of the DAC. This gives you the awesome possibility to great huge set of local branches, to merge, rebase them without any bigger problem or even just discard them (actually that is one of the biggest problems in mercurials bookmarks implementation). Another just great feature in git is the staging area. You can stage hunks, as a virtual repository that is used to actually commit the ‘selected’ changesets. That’s awesome and I’m really missing that in most of the version control systems that I use. The idea of a staging area is just a huge win for git. It’s so incredible powerful. Okay to put it in a nutshell: git is just awesome, but….

There is Mercurial.
Okay some kind of a warning in advance: I contributed two well known extensions to Mercurial, I hang around in their chatroom and I think that I’m a well known part of the community. Nevertheless if you talk about Mercurial and compare it with git you have to take care. Mercurial is by far not as powerful as git, and…that is just the best think about Mercurial. Matt really keeps it simple and clear for everybody. it’s so incredible easy to understand in the first place. There are no weird commands with a thousand of flags. Okay I try to be fair. Mercurial is much less powerful than git in the first place. Because it tries to keep everything simple. There is no rebase, no cheap branching, no staging area. But there are extensions. You can learn Mercurial and know all it’s commands within 24h. They are really easy to learn, and not powerful, but they can be extended, by a large range of extensions. You can have cheap branching (bookmarks), you can have kind of a staging area (record extension), you can have patch management on top (mq) and much more. With all those extensions, Mercurial is as hard to learn as learning all git commands (which frankly is not necessary at all), but it’s more of a evolutionary approach. I know a thousand people who say that learning git is as easy. Okay, no problem. I don’t think so but it doesn’t matter, but frankly, git is missing 2 big points. Windows and an application integration: If you live in your nice Linux/BSD/foo world you are right. Git is awesome, but come on, I don’t have a freaky Windows machine, but I know that 80% of all people and more than 50% of all programmers use Windows. No they are not these bad, not geeky enough people. They are the real programmers. Those who are not freaks and take programming as a job. They don’t care (and thats good) about their environment, they just want to get things done and want to earn money. That good. And even that is not quite true for most of them, they do their stuff just faster on Windows than on Linux, therefore it’s better for them to use Windows. Okay, you might argue, but there is mysysgit and it’s even part of official git. Oh nice arguement, but frankly, junio doesn’t provide Windows binary, there is no official site to get them from, and ….. git daemon still doesn’t work perfectly nor does git-svn. It just sucks. Big -1 from me for that one.
The second pint is the worse git internal design. It’s soooo unix style. It’s cool for people that love Unix (like I do), who pipe around at least 3 commands, and know that I it starts to get funny if you pipe around 5 commands. But most of the developer want to use a nice integrated version control system. They don’t like to use fancy command line stuff with a thousand of flags, they want to do click&click (the german expression would be ‘klicky-bunti’). They want to have it integrated in their Eclipse, their NetBeans, Visual Studio, their Windows explorer and so on, and frankly, git does a poor job in that area. I know there is an eclipse plugin (but the mercurial one is stilll a thousand times better), and all this fancy stuff, but what do they do, damn, they have to parse the shell output. This means either git will never ever change their shell output (which would be sad, e.g. I hate the # in git status), or they will break older stuff. Mercurail on the other side is really easy to interface with. Okay you need python but that’s all. Everything else is just smooth. It’s easy to handle, it’s easy to integrate, it just works fine. Git really does a bad job on that. And the git community knows it. That’s why they start their libgit, and libgit2 project, because they know something like a git library is needed.

Okay it’s late and I want to finish that without reading it a second time, no frankly, this time I want to be completely unfair, without any objective argument: So here comes my final words, make them:

If you like to play with software, if you really like to have the power, go for git, if you use Linux, even better, go for it, there is nothing equal to the power and the fun you can have with Git. You can be a thousand times more productive. But if you, or people in your team are not tech-geeks. If you use Guis and want to use Windows, believe me, you better use Mercurial. I really love both systems (as long as you don’t use bzr even SVN is fine), but in this use case Mercurial is just better. Think about it.

shame on myself: song for this post: This is the life by Amy MacDonald

This is….

Sind mir €0.99 min. 2h gute Laune wert? Mir schon.

IPv6: AAAA records with Plesk the hackish way

Adding IPv6 addresses to a domain is usually quite simple. Instead of an A record, you hast have to add an AAAA record to your database that points to an IPv6 address. If you use a configuration tool like Plesk, adding those records might be a little bit more difficult, as Plesk – at least in the version my hoster uses – doesn’t allow me to add AAAA records. So here is a short tutorial how to add an AAAA record.

Plesk manages the DNS records in a database. We first need a way to insert AAAA records in the database. Luckily if this is done, we are almost finished as the script that generates the zone files, doesn’t do a doublecheck at all.

First of all login as root on your box. Then login to your mysql server using the ‘admin’ user:

# mysql -u admin -p psa

Now alter the table to allow AAAA records:

mysql> alter table dns_recs modify column type enum(‘NS’,'A’,'AAAA’,'CNAME’,'MX’,'PTR’,'TXT’,'SRV’,'master’,'none’) NOT NULL default ‘A’;

Downoad the dnsupdate.sh script from parallels website. You now just need to add an entry to your database using a INSERT statement and then run the dnsupdate. I wrote a extremly hackish and dangerous to use script for that:

#!/bin/sh
echo “INSERT INTO dns_recs (displayHost, host, displayVal, val, type, dns_zone_id) VALUES (‘$1′, ‘$1′, ‘$2′, ‘$2′, ‘AAAA’, 2)” | mysql -u admin -p psa

sh /root/dnsupdate.sh

Notice that I set the dns_zone_id explicitly. You have to check what id your zone has. If you write a more sophisticated script and like to share it, I would be interested.

Don’t forget the trailing dot!

# sh /root/insert-dns.sh ‘ipv6.experimentalworks.net.’ ’2a01:3332:2324:52aa::2′

Done. Your domain now points to the right IPv6 address.

IPv6: A first overview [UPDATED]

I don’t remember when I heard of IPv6 the first time. Back then I tried to learn it a little bit but it was quite hard to get a working solution. When Benoit told me about a french ISP that provides native IPv6 connectivity, recently, I got attracted again by the technology. This time I spend much more time in understanding how IPv6 works and must admit that I really love the way it works. In IPv6 every machine get an unique IP address, that can be (under some circumstances that I’ll explain later) reached from every point of the world. Therefore it solves my NAT issues, so that I can access every machine in my local network from a remote host (if I would let the remote host through my firewall). As IPv6 allows autoconf, I don’t even have to configure my machines in the network, I just need to route the prefix and and announce the prefix. And: IPv6 is pretty easy to get.
Read the rest of this entry »

Moving to WordPress

When I started blogging, serendipity was my favorite blog system. It was faster and cleaner to me than WordPress. Also WordPress was known for being a insecure at that time.

Well now after 2 years of blogging I took another look at a WordPress and I must admit that I’m impressed by the clean admin interface and all the nice eye-candy. There are also tons of features that I like to use. So that’s why I decided to finally switch over to WordPress. I hope that my rss redirection will work for most of the people. For sure a lot of links on the web will just link into nowhere, but as I guess most of the links out there are not long-living, I frankly don’t care about that (But I care about the feeds, so give me feedback if you encounter problems).

The most notable change is the design. As I do not have the time to port my selfmade s9y design so far, I stick with a standard theme. Personally, I liked the old one more, but I was told by annoyed people, who had to scroll all the way down to the first article, that the big picture at the beginning wasn’t that good at all.

Seven things

As Johannes tagged me, here are my 7 things:

  1. I leared PHP because I wanted to write a form mailer for a website.
  2. When I was 13 years old, I spend a lot of time on a city network called RivalNet, causing a telephone bill of 600DM. There were no flatrates at that time.
  3. I studied analytical philosophy for 6 months.
  4. I make coffee the old-fashioned way by throwing hot-water through the coffee filter. My favorite sort is Jamaican Blue Mountain
  5. I fear of dogs, seriously.
  6. I started reading “Das Kapital” from Marx when I was 18, but still not finished it. Nevertheless, I still insist to call it a book that I’m currently reading.
  7. My last name is spanish but I don’t speak castilian.

And here are the rules I’m supposed to pass on to the following bloggers:

  • Link your original tagger(s), and list these rules on your blog.
  • Share seven facts about yourself in the post – some random, some weird.
  • Tag seven people at the end of your post by leaving their names and the links to their blogs.
  • Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.

And as for chaining, in no particularly significant order:

DTracing PHP

Dtrace is an extremely flexible and powerful tool to trace and debug applications. I recently dtraced PHP a little bit, so here is a tutorial how to start dtracing PHP.
Read the rest of this entry »

Whishlists

I wonder if the concept of amazon whishlists work. Or have you ever got something from your whishlist, because you did something in/for PHP?