Archive for the ‘webdev’ Category

Howto remove ^M characters using vim

Monday, July 5th, 2010

Thanks to this post on Tech recipes I can easily replace DOS/Windows line endings in files:

To remove the ^M characters at the end of all lines in vi, use:

:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:

:%s/^M//g

In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).

Fix ssh ‘Too many authentication failures’

Friday, June 25th, 2010

If you’re like me, you might have a lot of ssh keys installed and this might prevent you from logging into servers with the following message as a result:

“Too many authentication failures”.

As far as I understood this happens due to SSH trying each key on the client for logging and failing due to hitting the serverMaxAuthTries in the SSH server configuration. I use the following quick fix to work around this, by forcing SSH to use a password instead of a public key:

ssh -o PubkeyAuthentication=no username@hostname.com

I’m pretty sure there has to be a better, more durable solution for this issue, but the above fix allows you to at least gain access to your server again. Btw I use this on Linux (Ubuntu 10.04) with OpenSSH_5.3p1 Debian-3ubuntu4.

Nederlandse vertaling voor Limit Login Attempts Wordpress plugin

Friday, March 19th, 2010

Ik heb voor de Wordpress plugin Limit Login Attempts – ontwikkeld door Johan Eenfeldt – een Nederlandse vertaling gemaakt. Het is gebaseerd op versie 1.4.1 van de plugin. Schroom niet om contact op te nemen voor wijzigingen of op- en/of aanmerkingen op de Nederlandse vertaling.

De vertaling is hier te downloaden.

Installatie:

  1. Gedownload zip bestand uitpakken.
  2. Bestanden in Limit Login Attempts directory plaatsen
  3. Wordpress op Nederlands als taal instellen

ps: Ik heb Johan inmiddels ook op de hoogte gesteld van de Nederlandse vertaling en ik hoop dat de vertaling zo spoedig mogelijk toegevoegd wordt aan de plugin zelf zodat je deze vertaling niet meer extra hoeft te downloaden.

Words of wisdom

Tuesday, February 23rd, 2010

Keep this in mind the next time you have to work on somebody else’s code:

So I am a bit lucky in that my father is a very experienced programmer who also gave me the bug. One of the first things he said to me when I started programming for more than just fun or OSS, was that he never judged other programmers code. He would correct it, point out flaws in it, but always with a suggestion of how to do it better. The reason for this is that in the world that we have to live in, of deadlines, PHBs and evil marketing folks who spring new features on a development team right before a release, you never know why someone’s code is the way it is.[...]

source: mprorock on reddit

Nieuwe site NOiV gelanceerd!

Tuesday, January 12th, 2010

NOiv website
De nieuwe website voor Nederland Open in Verbinding (NOiV) staat live. Tezamen met het Utrechtse bedrijf Eend heeft Burobjorn de website van NOiV op basis van Wordpress Mu ontwikkeld. Hierbij was Burobjorn verantwoordelijk voor het opzetten van Wordpress Mu inclusief de structuur, het ontwikkelen van op maat-gemaakte functionaliteiten zoals een filter systeem en het omzetten van de door Eend aangeleverde HTML en CSS (conform de Webrichtlijnen) tot Wordpress templates. Het ontwerp van de site is door Maaike de Laat ontworpen.

Recognizable for every web developer

Friday, November 27th, 2009

Most webdevelopers I know are no fan of Microsoft’s Internet Explorer. It has become a lot better with Internet Explorer 8, but still Internet Explorer usually doesn’t play nice and in general it is hard to debug issues on Internet Explorer.

So here’s a song (see also the embedded movie at the end of this post) by a guy who definitely has experienced these issues and wrote a song about Internet Explorer being mean again. This one is for al you web developers out there. Have a nice weekend! (more…)

Released Wordpress plugin bbRedirector

Tuesday, November 24th, 2009

I’ve just released another Wordpress plugin. This one is called bbRedirector:

bbRedirector makes it easy to redirect a page to another location using absolute urls from within Wordpress. No mod_rewrite nor .htaccess is needed. You just create a page, add a specific customfield and choose the redirect template included with this plugin. It even allows you to set the required http status code (302 or 301). You can also set a default sitewide redirection or setup your own custom redirection.

The included templates should give you an easy start using this plugin.

Download the plugin from http://wordpress.org/extend/plugins/bbredirector/

New Creative Commons NL site launched

Monday, September 14th, 2009

ccnl-homepage

Today I’ve launched the new Creative Commons Netherlands (CC NL) website. CC NL asked me to make their website more similar to the creativecommons.org version, which I did and the result can be viewed online. We used the USA design (thanks to the USA webteam!) as a guideline and tweaked it until we were satisfied. A more in depth posts will be posted in the portfolio after the dust settles.For now I’m too occupied with finishing other projects.

Wordpress simple redirect

Tuesday, September 1st, 2009

Recently I needed an easy way for a client to create a link in a Wordpress powered website that would automagically redirect a visitor to a certain location upon visiting. Part of the requirement was that this link could be easily remembered and used in printed material such as leaflets and magazines. As an extra option it should be easy to change the location towards the redirection would point. I couldn’t find anything like this so I created a very simple little page template.

How it works:
Copy the template page Page Redirect code below to a file and save it as page-redirect.php in your own template’s directory. Create a Page in Wordpress and set the Page’s template to Page Redirect. Add a custom field to this page with the name redirect_url and the full url of the url you want to redirect to.
For instance: http://www.redirected-location.com. Now save the page and you should now test it by visiting the page you created.

For example (I assume you are using nice urls):

http://www.your-website.com/the-page-title-of-the-page-with-the-redirect-template

If all went well you should be instantaneously be redirected (using a standard php redirect with a 302 HTTP redirect) ) to the url you entered in the custom field. You can easily change the redirect location by changing the value of the custom field.

Code:


< ?php
/*
 * Template Name: Page Redirect
 *
 * Makes it easy to redirect a page to another url, using the parameter redirect_url
 */
$redirect_url = get_post_meta($post->ID, "redirect_url", true); 

// Defaults if no options we're given
if( ! empty($redirect_url) ) {  header("Location: $redirect_url"); } else { echo ""; }
/* Make sure that code below does not get executed when we redirect. */

exit;
?>

As I said it uses the standard PHP redirect, but you could easily change or extend it with more specific http headers if needs arise. Feel free to use the above snippet as you see fit, as far as I’m concerned it’s in the public domain. I hope this might be useful to you. If you have any questions, feel free to leave a comment.

Add-ons for Mozilla Firefox and Thunderbird

Sunday, August 30th, 2009

mozilla-dragon-from-archive-mozilla-org

(source: http://www-archive.mozilla.org/party/2000/mozilla2.gif)

I’m an avid user of Mozilla Firefox for browsing the web and Mozilla Thunderbird for reading up email when I’m not in a commandline Mutt kinda mood. Out of the box these applications are already great to use, but by installing some add-ons it gets even better. So I made a list of all the add-ons I regularly use.

Frankly, without these add-ons I would not be able to do my work as a web developer nor would I enjoy the web as much as I do. In fact, without the Thunderbird add-ons I would not be able to keep track of appointments nor would I be able to archive emails in a sane and time saving manner. In other words these add-ons are lifesavers and perhaps you might find them just as useful as I find them. So have a look at:

I plan on updating these collections with future add-ons when I come across new add-ons.

If you know of great add-ons which should be part of the above mentioned collections feel free to leave me a comment below. I won’t promise to make them part of it, but if I find them useful to me I will add them. Otherwise you can easily create your own collections at Mozilla and ignore me :)