Vertical label creation

[problem]

You want to generate a vertical image, with text over the top.

[/problem]

[solution]

Here is some code I wrote, which is used extensively on my sites:

  

[/solution]

[reference]

Give it a blast on this site, like this: http://coding-school.com/common/label-up.php?label=your+text+here

Automatically calculates size required. You can also add font=# – where # is 1 to 5, like this:

http://coding-school.com/common/label-up.php?label=your+text+here&font=3

I’ve now created an online tool, using this code

[/reference]

[tags]Image, PHP[/tags]

libcurl lookup taking long time

[problem]

You notice for some hosts curl and/or libcurl are taking 7 or so secs to lookup the host. But nslookup or dig respond almost immediately.

[/problem]

[solution]

Try doing curl -4 -w “time_namelookup: %{time_namelookup}n” …. and try without the -4. If you see drastic differences, you could be falling foul of the IPV6 bug. To work around this, you can either just use -4 with curl or set CURLOPT_IPRESOLVE with libcurl.

[/solution]

[example]

I spents hours and hours and hours, trying to get this working with libcurl and perl. It turned out I need to upgrade to WWW::Curl::Easy version 3.0 – as opposed to version 2. Do a search on search.cpan.org for Curl and it will tell you how to check your version.

Then if you like me upgrade, you need to also modify all your code from: Curl::easy::setopt($curl, … to $curl->setopt( …

[/example]

[tags]libcurl, resolve, namelookup[/tags]