Generate PDF files from PHP

No Gravatar

For a web project I needed to create invoices, to be downloaded or e-mailed to clients in PDF format. The platform is PHP and the documentation for this almost exclusively describe PDFLib for this purpose. I am sure PDFLib is fine, and the tutorials that come with the package looks really good.

But..

You pay for PDFLib – I don’t mind paying for software, you should pay for usable high-quality stuff, which I am sure PDFLib is. US$ 995 is a little steep though – compared to free. The FAQ however mentions a few free alternatives. Right now I am looking into FPDF – which seem to do the trick.

Actually I found out that my previous ISP (invoicing their customers only by PDF invoices via E-mail) use FPDF. This tells me that FPDF is more than ready for production. I’ll let you know if I something disappoints me – although I would hate to bash a truly free initiative such as this one. Oh – and by the way it has another edge to PDFLib – It is written in PFP and does not need server reconfiguration to work. If you want a head start, there are quite an extensive list of code examples available.

How does my website look in ALL the other browsers?

No Gravatar

Wanna know how Mac og Linux users running rare browsers view your website? Then check out http://browsershots.org/. Queue up your URL and depending on the current load, the screenshouts will begin pouring in over the next couple of minutes. Why, oh why should we wait soo many years for a service like this?

The shots are of course static, so it is not possible for you to actually check how your site performs and functions without running the actual browser on the actual OS you want to test. It can however save you A LOT of time, getting rid of the most common errors early in the layout debugging process.

The site features quite a few languages, and more a being added all the time

Attention Profiles may filter news better

No Gravatar

Amazon profiles you by the books you buy. Google sponsored links are displayed by the contents of your gmail e-mails and general website interests. All “Big Brother” considerations aside – this is clever – or at least technically interesting. There are risks of evil marketeers profiling you down to the bone, but on the other hand you probably only see stuff that is interesting to you – as opposed to receiving a load of Viagra spam e-mails. I know – The fact that something really sucks, does not make something that sucks a bit less excellent..

A group is in the process of specifying the APML format. APML is short for Attention Profile Markup Language and will specify a fileformat to express your interests ranked. OPML can already be considered an APML subset describing your feed subscriptions, but APML i more of an aggregation of your interests also including e-mail, browser history and bookmarks.

An important thing about your attention profile is, that is has value – to you as well as to others. Check out AttentionTrust for more..

Why are Wiki’s so darn ugly?

No Gravatar

I am a Wiki-virgin. Not in the sense of being a wiki-reader/contributor, but today I set up my first Wiki which is about to go online. Wiki’s based on the MediaWiki software (which is also used for WikiPedia) are actually skinable, but as content usually is king in Wiki land, very few operators make an effort to change skin before going online. The well known default Monobook skin is used almost everywhere (you know – the one where the monochrome image of an book is the back-drop).

This has one obvious benefit: People recognize it as being a Wiki-type site immediately. Indeed a strong argument to keep things as they are. I may be running my mouth of as the green first day Wiki operator, and maybe I have actually used Wiki based sites that I did not recognize because it used some great unknown skin. But doesn’t the Wiki deserve it’s Kubrick skin – which was considered the defacto blog-look a few years back. People would look at the skin (which is beautiful) and say “Ahh – that’s a weblog”. These days I (and probably a few other) say “Yuck – It’s a Wiki”.

Michael Heilemann did such a great job with Kubrick. Isn’t it time for Wiki’s to have their own updated slick skin? Do you have it or know where to get it? There is one Wiki-skin I like: Cavendish. I would love to be able to create one myself, but my graphic skills are unfortunately only focused around my eyes – not in my hands.

Rebooting for the next couple of days

No Gravatar

Reboot 9Thursday and friday i will be at Reboot 9 – it’s the third time I attend – last time was two years ago, and the first time was actually at the first Reboot conference – pre-bubble, y2k and all. This years theme is “Human”. The focus is rarely technology, but future ways of thinking and working. This year one of the headliners are Dave Winer – a talk on friday I will forward to. I also expect this to be another great networking opportunity.

Windows ‘amp tip

No Gravatar

I was annoyed – but not anymore. I have been developing for Apache/MySQL on my laptop for a while, and in the beginning I would start the Apache and MySQL services automatically as I booted Windows. Recently I embarked to minimize the boot time of my Windows installation – and that included minimizing the services starting automatically – including Apache and MySQL. To start these two services, I enabled the System Tray icons for the two services and when I wanted to start the services I would right click the MySQL monitor and choose “Start instance”, and then left-click the Apache icon and click “Start” in the submenu.

This seems fairly simple, but if you try to navigate icons in the System Tray before everything is done loading, you will know that right-clicking something may give long delays, sometimes sub-menues disapear and you don’t know if it was because of your click, which it did not respond to or if your click was actually registered. So the tip is simple and low tech – perform the same thing in a .bat file:

startamp.bat:

net start mysql
net start apache2

stopamp.bat:

net stop apache2
net stop mysql

Put these on your desktop or quickstart menu..

Microformats starting point

No Gravatar

Microformats logoDive into the possibilities of Microformats from this article at Smashing Magazine. The article points out a few simple additions for your website, that will easily add context to the contents of your site to humans and machines.

An example: If you are selling something, specific crawlers of trade sites will know it as they find the appropriate microformat code on your site. Another example: Make your resume available in hResume format embedded in your regular HTML code and it can be indexed by recruiting companies.

Thanks to Marjolein for the link.

Simple VPN setup

No Gravatar

Up until today, I have had to make important files from the shares of my home Linux server available as Windows Offline files to have them readily available on the road. I could sftp to my home server and fetch the files, but with the overhead of having to remember to actively upload the files again if they have been updated. I had a hunch that SSH tunnels could help me out, but today I finally made everything work, enabling me to map drives to the Samba shares of my home server through a secure SSH tunnel. Here’s how..

Background info

I am creating this setup using my home Linux server connected to my ADSL connection at home. I want to connect my laptop to my Linux server in order to map the Samba shares as drives on my laptop, when I am connected to the internet at the office or at a client. The Linux server is running OpenSSH which enables me to make regular SSH terminal connections using a client such as Putty, SFTP file transfers using WinSCP AND tunnels – also using Putty.

Uninstall File and Printer sharing for Microsoft NetworksA tunnel through SSH works like this: A service is listening for connection requests on some port on the server -A Samba server listens on port 139 (like any Windows machine that has “File and printer sharing” installed does). When you create a tunnel like this one, you are “rewiring” the network of your workstation telling it to forward all connection attempts to the local port 139 to port 139 of the remote server through a the secure connection supplied by SSH. As only one service can listen on one port at a time, you need to uninstall “File and printer sharing” for your network connections. Please note that when you do this, any folder or printer shared by your computer will no longer be available to other users on your network.

Do it

If you have Samba shares and OpenSSH running on your server and you can connect to it using an SSH client, you only need to change the setup of your client pc.

  1. Install Putty – which should be fairly straight forward.
  2. Uninstall “File and Printer sharing”. Note: If you merely disable the element, this will not work as the service will still listen on port 139 and block Putty from listening on the same port. A complete Uninstall is necessary.

  3. If you already have a terminal connection set up for your server in Putty, it can be reused and you can merely add a tunnel to the connection. To make your initial connection in Putty, simply supply your internet IP address (or domain name if you have one) for your home server, and make sure the standard port 22 is NAT’ed in your router to your server. You may choose to increase security by having OpenSSH run on a port other than 22 – but that is a outside the scope of this post.
  4. Open the Tunnels configuration and enter:
    • 139 in the Source port field
    • The internal IP adress of your server followed by :139 to indicate that you wish to connect to port 139 on the server. In the example below, the internal IP adress of the server is 10.0.0.150

Putty Configuration

Apply your changes and open the connection. Once you have succesfully logged on in the terminal window the tunnel will be established and you should be able to start mapping drives to \\127.0.0.1\remotesharenames.

Internet Explorer on Linux

No Gravatar

IEs4LinuxThis post is written from Internet Explorer 6. In itself that is not so strange – I have a large client that exclusively run Internet Explorer 6 throughout the entire enterprise, so my work needs to be 100% tested on this browser. On my Windows XP installation i am running IE7 which cannot coexist with version 6 and i didn’t feel like downgrading. Installing Windows XP as a virtual machine is not an option – as I don’t want the expense of another Windows license.

Wine was apparently not able to run Internet Explorer out-of-the-box, but a bit of Googling gave me what I need: EIs4Linux – a package that can install any (also simultaneously) of IE 5, 5.5 or 6. I used this step-by-step guide to get everything running.

IE7 is currently not supported (by Wine according to the EIs4Linux guys), but it is work in progress.

Focus focus

No Gravatar

Ubuntu logoI like to keep stuff separated, so this blog will contain observations and hopefully conversations about IT, geeky stuff and social software. As I am writing this, I have just completed downloading Ubuntu Linux 7.04 which was released today. Their site still have symptoms of quite a heavy load, as the most of the (geeky) world is probably reading about or downloading version 7.04 of this great Linux distribution.

I was actually about to rant a bit about the pet names they give their releases (this list was nicked from Wikipedia) – I have yet to figure out why animals with distinctions make better release names.

  • 4.10 The Warty Warthog
  • 5.04 The Hoary Hedgehog
  • 5.10 The Breezy Badger
  • 6.06 The Dapper Drake LTS (Long Term Support)
  • 6.10 The Edgy Eft
  • 7.04 Feisty Fawn

In October of this year Gutsy Gibbon (of course referring to version 7.10 of Ubuntu Linux) should once again start an extra fan or two on the Ubuntu download mirrors.