Christer’s blog o’ fun

February 3, 2010

Book review: Zend Framework 1.8 Web Application Development

Filed under: Books, PHP, Reviews — Tags: , , , — christer @ 3:24 pm

I got a copy of Keith Pope’s book Zend Framework 1.8 Web Application Development from Packt Publishing last year but didn’t find the time to read through it until the beginning of this year. Here are my thoughts about the book.

The book starts off by giving you a very good introduction to the MVC architecture in general and how to create a simple Zend Framework MVC application using tools given by the framework. You will also get some insight about the directory structure used by default by Zend Framework, how controllers/actions work and how the view part of MVC is used. The first chapter is a good starting point if you don’t really know what MVC is all about and haven’t used any of the MVC parts of Zend Framework yet.

In the next chapter Pope goes deeper into the MVC parts of Zend Framework and describes the possibilities of customizing the different parts of the framework to your needs, like using a non-default directory structure, creating front controller plugins, creating custom classes for requests, responses and much more. Here you will learn allot about how easy it is to make Zend Framework fit your exact needs and that you aren’t tied down to a strict set of rules set by the framework.

From here on you will start building a storefront application from start to finish. The book covers most aspects of a more or less complete storefront with customer registration, a shopping cart, admin-area to administer products and categories and so forth. It also has a small chapter in the end dedicated to testing your applications using unit tests which in my opinion is a very important part of an application. Zend Framework will let you solve a problem in many different ways, and Pope usually describes his decisions by listing pros and cons which I found very informative. I enjoyed reading the book from start to end and will most likely refer to it again from time to time whenever I’m using the MVC parts of the framework.

In conclusion I would say this is a very good book. It’s easy to read from start to end, and it’s easy to use if you only want to look at a certain part of the MVC stack. In the preface it says that the book is for developers who want to get started with Zend Framework. I would say that the book is also for people who have been using the framework for a while and simply want to get more out of it.

January 22, 2010

New books!

Filed under: Books — Tags: — christer @ 3:15 pm

Received a package from Amazon.com today with the following books:

I have read many other books by Stephen R. Donaldson as well. Check them out if you’re into Sci-Fi/Fantasy.

I’m looking forward to getting started with these! I finished the Zend Framework book a couple of days ago as well and have started on a review for it. Hopefully I’ll get to finish it this weekend!

January 8, 2010

Photos of yours truly climbing at Sella

Filed under: Climbing, Photography, Trips — Tags: , , — christer @ 3:34 pm

I spent Christmas 2009 and New Year’s Eve 2009/2010 in a town called Villa Joyosa on the east coast of Spain. Louis (that I also travelled to Kalymnos with) took some photos of me doing a couple of routes at Sella. Check them out! Here are some previews:

Me climbing a route at Sella

Me climbing a route at Sella

Me climbing a route at Sella

November 30, 2009

New Zend Framework book

Filed under: Reviews, Technology — Tags: , , , — christer @ 3:26 pm

Book cover The other day I received a book — Zend Framework 1.8 – Web Application Development — for review. I’ll read through it as soon as I can and write a review that I will publish on my blog.

November 29, 2009

1:1 NAT with a Linksys WRT54GL router (with Tomato firmware)

Filed under: Technology — Tags: , , , , , , — christer @ 2:33 pm

For a long time I have used a Debian based machine called megatron as a gateway at home. Megatron had two NIC’s where one was connected to an SDSL modem, and the other was connected to a Linksys WRT54GL router (which is running the Tomato firmware). These two switched places a while back so that the router is connected to the modem, and megatron is behind the router. There are a couple of services running on megatron that needs to be accessible from the internets, so I had to do some iptables magic on the router to be able to do this. This post is more of a reminder to myself of how to do this, but there might be someone else out there who wants to do the exact same thing.

Earlier megatron had two official ip addresses (I have 5 from my ISP) on the NIC connected to the modem. One of them is used for SSL traffic to megatron and the other is used for everything else. The setup now is that megatron only has one NIC with two internal addresses: 192.168.1.10 and 192.168.1.11. My router has three addresses. Lets say these are: 193.n.n.122, 193.n.n.123 and 193.n.n.124. The first one is the one I will let the router have and the other two I will forward to megatron.

First I had to add two addresses to the router since it only had one. To do this I logged in the router using ssh and ran the following commands:

# Add ip addresses
ifconfig vlan1:1 193.n.n.123 netmask 255.255.255.248 broadcast 193.n.n.127
ifconfig vlan1:2 193.n.n.124 netmask 255.255.255.248 broadcast 193.n.n.127

To test if these two worked I simply pinged the new ip addresses.

Now I needed to tell the router to forward traffic on these two addresses to the ip’s specified on megatron. iptables to the rescue:

# To megatron
iptables -t nat -I PREROUTING -p all -d 193.n.n.123 -j DNAT --to-destination 192.168.1.10
iptables -t nat -I PREROUTING -p all -d 193.n.n.124 -j DNAT --to-destination 192.168.1.11

# From megatron
iptables -t nat -I POSTROUTING -p all -s 192.168.1.10 -j SNAT --to-source 193.n.n.123
iptables -t nat -I POSTROUTING -p all -s 192.168.1.11 -j SNAT --to-source 193.n.n.124

# Accept all ports
iptables -I FORWARD -p tcp -d 192.168.1.10 -j ACCEPT
iptables -I FORWARD -p tcp -d 192.168.1.11 -j ACCEPT

And that’s that really. One last thing I had to do was to make these changes permanent. This can be done by putting the ifconfig and iptables commands in this post in the Administration->Scripts part of the Tomato web-gui. Click on Administration and then Scripts in the gui and enter the commands in the firewall tab:

Remember to click the save button on the bottom of the page after these changes.

November 12, 2009

Photos from Kalymnos

Filed under: Climbing, Photography, Trips — Tags: , , — christer @ 4:46 pm

Check out some photos from my trip to Kalymnos in September/October over at my flickr account.

Some previews:

Me at Grande Grotta

Louis at Grande Grotta

October 15, 2009

From Kalymnos #3

Filed under: Climbing, Trips — Tags: , , — christer @ 1:38 pm

Sorry about the total lack of updates from this years trip to Kalymnos. I’ve been busy doing everything else than sitting on my computer. Now we’re only a couple hours away from starting the trip back to Norway. It’s been a great month of climbing, and I’ll most likely come back some other time. I’ll try to post some pictures in a day or two!

September 19, 2009

From Kalymnos #2

Filed under: Climbing, Trips — Tags: , , — christer @ 5:51 pm

A few more days have gone by and I’m still living the “hard” life at Kalymnos. We (as in Louis which I’m here with and myself) have been climbing today and we’ll go out again tomorrow. When tomorrow is at an end we have been here for a week and have climbed 5 days. We have done some very nice routes as well! I’ll include a tick list when I get home from this place for those who might be interested in that.

We have been bathing and swimming every day as well. It’s about 21 degress in the ocean here so it’s quite nice. It’s very refreshing to take a quick dip after climbing all day long. We are going out to eat today since we forgot to take anything out of the freezer yesterday.

You’ll hear from me later!

September 15, 2009

From Kalymnos

Filed under: Climbing, Trips — Tags: , , — christer @ 6:03 pm

So, we’ve been here for a couple of days now. We arrived around 1800 on Sunday and didn’t do much that evening. The room we are staying in is not really that good. The “kitchen” is a small portable gadget with one plate to cook on and a fridge that barely works. Not too great if you want to make rice, sauce and some meat. We have been talking about looking for some other place to stay if there are better options regarding the kitchen around here. Since we’re staying here for over a month it would be nice to have a decent place to make some food.

Today we are having a resting day after a long climbing day yesterday. We went to the capitol of the island earlier today and picked up some food since there is no butcher shop around here. We also spent some hours sleeping in the sun on the beach after a short swim. It’s a hard life we are living here…

We are going to climb tomorrow and Thursday and we’ll rest on Friday again. I’ll write some more later and post some pictures as well. There won’t be too many pictures until some more of our friends arrive here. When it’s only the two of us climbing there is no opportunity to snap some photos as well.

Anyhoo, hope everyone back home is having as great a time as myself. Later everyone!

September 10, 2009

Firefox + Spotify in Wine

Filed under: Technology — Tags: , , , — christer @ 1:03 pm

I run Ubuntu on all my workstations. I also run Spotify in Wine and use Firefox 3.0 as browser of choice. Until now I haven’t been able to click on the spotify:* links in Firefox and have it open them in Spotify. The following small changes made this possible:

Start Firefix and enter about:config in the address bar. Click past the warning that comes up, right click somewhere in the list of settings and click on new -> boolean. Create the following setting:

network.protocol-handler.expose.spotify

and set it to false.

Right click again to add another setting:

network.protocol-handler.external.spotify

Set this to true.

Now, lets create a small shell script that Firefox can use to start Spotify. I chose to place it in the Spotify installation folder:

vim ~/.wine/drive_c/Program\ Files/Spotify/spotify.sh

Enter the following:

#!/bin/bash
wine "$HOME/.wine/drive_c/Program Files/Spotify/spotify.exe" /uri "$1"

Then make the file executable with the following command:

chmod +x ~/.wine/drive_c/Program\ Files/Spotify/spotify.sh

Now, click on a spotify link (like this one for instance) and select the newly created shell script to see the magic happen!

Older Posts »

Blog at WordPress.com.