Recently I've been pushing my Movable Type installation over several domains and in the processes I lost javascript functionality on one of the blogs, I didn't see the fancy editor, I pretty much couldn't use the admin system.

Javascript gave the following errors:
"MT is not defined"
"JT is not defined"

And so on. After a little searching I came up with this post which states that the problem is due to a corrupt mt.js (in mt-static). If your file is below 10 KB, you have a problem. Simply download the installation files from movabletype.org (matching your version, of course) and replace mt.js. It should now be ~100 KB.

Worked like a charm

Programming for the iPhone

| | Comments (0)
Just recently I started programming for the iPhone. It's awkward at first being objective C, but after only I few hours I've come to love the iPhone SDK (xckode, the simulator, Interface Builder) and it's documentation.

For starters, register on Iphone Dev Center and download and install the SDK. Read the objective c primer and at least fast-read through iPhone development guide. Then the fun starts - making your own application.

The absolute best resource for this (IMO) is icodeblog.com (Iphone Programming Tutorial) There you will find step-by-step tutorials on both how to get you started as well as how to use the different components
On pretty much every of my projects (which I run on apache) I have the need to automatically rewrite all requests without www to the corresponding adress with www. It's simply, and this is the code I use (over, and over again). It rewrites (for example) http://luradittbarn.se to http://www.luradittbarn.se. If you request a page (i.e) http://luradittbarn.se/archives.html to http://www.luradittbarn.se/archives.html

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_URI}\\/%{HTTP_HOST}/www. ^/+(.+/)?[^.]*[^/]\\(/)([^w][^w][^w][^.].*/(www\.)¦.*)$ [OR,NC]
RewriteCond %{HTTP_HOST}/www. ^(/)?(/)?([^w][^w][^w][^.].*/(www\.))$ [NC]
RewriteRule ^ http://%4%{HTTP_HOST}%{REQUEST_URI}%2 [L,R=301]


The code is originally from Webmasterworlds forum (a very old thread, which can be found here)
Ett av mina många privata sidoprojekt är www.luradittbarn.se - en snäll sida med ett provocerande namn. Sidan samlar de små, charmiga tips och tricksen som gör livet som förälder lite lättare.

http://www.luradittbarn.se
Sen i maj har jag arbetat på företaget Happyplace (www.happyplace.se). Företaget är en nystartad digital kommunikationsbyrå. En reklambyrå, fast på internet. Jag trivs som fisken i vattenet och får en möjlighet att utveckla företaget i en expansiv fas.

Igår släppte vi en första version av vår site, kolla in http://www.happyplace.se
Recently I've purchased a Mac Mini for my home network. The mini is connected directly to the internet (no external firewall connected), since it's a media hub I wanted to:

   Be able to reach files on the computer from anywhere
   Be able to view the screen from anywhere

First one was easy: SCP. Second was more though, while OS X Leopard has the built in screen sharing (vnc) I didn't feel like opening up the screen sharing to the world. Therefore I started looking for resources how to tunnel VNC over SSH and at the same time restrict screen sharing to local IP (without using external firewall to block)

I found what I needed on http://fotinakis.com/blog/blog/2008/secure-mac-screen-sharing/

Basically what I did was:

   1. Changed port on the sshd and then starting the remote login (ssh from system preferences) - I followed http://www.macosxhints.com/article.php?story=20050707140439980 I used 22222
   2. Deny all incomming connections to port 5900 and 88 from everyone but me using ipfw

Then when I want to connect to the shared screen, I open up my SSH tunnel:

ssh username@ip_address_or_hostname -L 5901:localhost:5900

And connects (Finder -> Go -> Connect to server) to vnc://localhost:5901

Note though, you must tunnel it from a port that is not 5900 otherwise you will get a "You can not connect to your own computer"

Recently we bought a mac mini for e-mail server at work. This works great but since I have no external screens I will have problems setting up the headless mini.

I will give http://jamieorc.wordpress.com/2008/03/23/setting-up-a-headless-mac-mini-without-a-monitor/ a shot, basically:


  1. connect a keyboard to the Mini
  2. start the Mini in FireWire Disk Mode
  3. connect the MacBook Pro to the Mini with FireWire cable
  4. restart the MBP using the Mini as the boot disk
  5. setup the Mini with network access and remote management (Sharing)
  6. reboot the MBP with its own disk
  7. disconnect the Mini and reboot
From the above mentioned source.

(PS: On leopard server? Try http://www.bos89.nl/1218)

Djangosnippets.org has a great tutorial if you need to send (form) file uploads as email attachments in django, check it out
For various reasons, you might end up needing to put your mod_rewrite syntax in your httpd.conf, usually if you want to use basic rewriting, but with .htaccess support turned of.

In that case, you need to be aware that you need to add a / for it to work, like this:

From http://drupal.org/node/9418:
herefore :
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
becomes
RewriteRule ^/(.*)$ /index.php?q=$1 [L,QSA]
in my case


Hyper Island Seminars

| | Comments (0)
Yesterday I held my first seminar for Hyper Islands Interactive Art Directory students. It consists of four parts. First seminar, which I held yesterday, goes into the basics of HTML/CSS/Javascript and Flash. Also touches their upcoming portfolios and the web world as whole.

Second seminar, which I held today, was more in-depth on their upcoming assignments but also gave them a deeper understanding of Javascript and Ajax, "Web 2.0".

Third seminar which will be held on Monday focuses on the actual creation of HTML/CSS/Javascript. How do you make a website?

Fourth seminar will be held on the 8th of October and is when then will be showcasing their experiences. I will update with more information later on..