3. Dec 2009

How a non-tech-savvy user can use the Statkart resources

Statkart.no recently released their map data for free usage (at least to a certain degree) – but how can non-tech-savvy users / non-webdevelopers use this?
I’ll try to post some suggestions here – first out is

Swap to more interesting map data on Dagbladet a lot of sites with Google Maps:

Added autodetection – sites with a Google map (GMap2) stored in a globally accessible variable named map or gMap should “just work”.
For the non-tech-savvy: Try clicking the bookmarks while on a page that has a map with the Google logo on it – it might just work! :-)

Note: The links below currently violates the terms of usage as they do not add the proper copyright notice under maps.
This can be solved with some more javascript (inject a div under the map, for instance), I’ll see if I’m able to do so later.

Add the following links as bookmarks and you should (at least in Firefox, Chrome and IE8) be able to swap maps while on an article with a Google map @ db.no.
ProTip: Add a new folder to your bookmark toolbar (or Favorites bar in IE) and store them all in there – that way they’re easily accessible.

Kartdata2

Sjøkart

Topografisk kart

Topografisk kart gråtone

Topografisk rasterkart

Europakart

Post to Twitter

2. Jun 2009

Adobe Creative Suite 2 and Windows 7 (64bit)

Ever since the Windows 7 RC came out I’ve been testing it at work, and to my great surprise most of the software I run on a daily basis just works. Netbeans, Tortoise, WAMP, they all work as expected. I had not, however, even dared to try Adobe Creative Suite 2 as I’ve heard people complaining about lousy compatibility even under Vista. It all changed today!

I’ve spent the last month with Photoshop/Illustrator only available on my tiny Macbook Air, and I grew tired of it eventually. Since I felt really lucky today I decided to go be an idiot and try to get CS2 up and running in Windows 7 :-)

During the setup my first problem occured – invalid path name. I’m running Windows 7 64bit and it automatically puts 32bit applications in the Programfiles (x86) folder. The CS2 setup wasn’t too happy about it so I changed it to the regular path, C:\Programfiles. CS2 installed as expected – awesome I thought!

I expected Photoshop to keep nagging me about registration over and over again until I ran it as administrator, similar to the problem under Vista. But nay, Photoshop gave me a short error about “user name, organization, or serial number is missing or invalid” meaning it had to terminate without me painting a single pixel. After some research I found that this was a problem that would occur under 64bit versions of Windows XP as well – and the solution for Windows XP 64bit users worked for me!

According to Adobe, you have to get your Creative Suite installation into that x86 directory, and here’s how to do it:

Uninstall Creative Suite completely, when installing again use C:\Progra~2\Adobe as your installation path instead of the one suggested. If your “Next” button is disabled after pasting it, try clicking “Browse” then “Cancel” and it should be reenabled.

I’d also like to point out that I ran my setup as Administrator (browsed to the DVD drive then right clicked setup.exe and chose (“Run as Administrator”) the second time just to be sure.

It worked out quite well actually, hooray!

Post to Twitter

9. Dec 2008

Distribute Windows XP VPN-settings

As our Oslo branch has been gradually shut down, we now have very few (but some) users left in Oslo. Our office there has always been connected to the branch in Fredrikstad where all our servers reside trough a Firewall level VPN link making connections across the two subnets pretty transparent. Since so few users are left in Oslo however, we’ve decided to cancel the inet line subcription and connect them to sister companies in the same building, where other policies apply and a bridge between networks is out of the question.

We’ve had a VPN available for users working remotely for quite some time already, thanks to our beloved Dlink DFL-800’s. The challenge now was that we’d like to make the transition to client-based VPN links as easy and invisible for our users as possible.

Our Windows XP VPN-configuration required several custom, non-standard settings (such as no ‘Use default gateway on remote network’) in order to work, and we couldn’t expect our users to know these things. Most sysadmins tend to create a frustratingly long guide with lots of screenshots to make sure the user will set up a connection properly, but these are easily too complex and all in all pretty demotivating for the average user. Creating such a guide was not an option for us as it would ruin our goal all by itself; make the transition almost invisible to users.

Hoping that I could find a way to export these settings, then distribute them to our users, I googled and googled. I couldn’t find a good way to do this from the command line either (you do have rasdial, but it didn’t cover nearly all my needs).

After a lot of searching I came across some forum post (my apologies to the author of it for losing the URL) about a file called rasphone.pbk. And yes, this was what I was looking for, indeed. That’s where all the magic is stored!

So, here goes, “How to distribute VPN-settings to multiple users”:

As mentioned, the file we’re looking for is called rasphone.pbk and can be found in C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk by default on a Windows XP English install.

Each VPN-connection has a pretty long entry in this file, so it’s important that you copy the file out, open your fresh copy in a texteditor and edit out all other connections. Username, password and domain is not stored in this file, so no need to worry about clearing it!

VPN-connections are identified by [ ] around their name, and all lines until the next name between [ ] belongs to that VPN-connection. When you’ve edited out all other connections you can in fact distribute this file to others. When they double-click it they will be able to load VPN-settings on the fly.

Problem solved one might think, but no. Windows XP will not add this information to connections, so it’s not a persistent solution. My take on this was that I’d have to append my .pbk-file to the existing one. This was accomplished with a neat little bat-file:


echo. >> "%allusersprofile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
type YourVeryOwn.pbk >> "%allusersprofile%\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"

The first echo puts in a newline to make sure we’re moving onto a separate line.
The second command, type, works pretty much like cat under linux; it catenates the given file to standard output. We then append this to rasphone.pbk with >>.

Please note that I use %allusersprofile% here, as you do not have an environment variable available that goes directly to the Application Data directory of All users (you have %appdata% for regular users). This prevents your bat from working under localized versions of XP. My solution for this was to create another bat for those who run a Norwegian version of XP.

Another note: after the bat has been run you’ll have to right click and select Refresh in your Network Connections overview for the new connection to appear. Once this has been done it’ll be available as any ordinary created VPN-connection.

I’ve began looking at Nullsoft Scriptable Install System (NSIS) to ensure Vista support and automate it further; localization will not be a problem there as you have $APPDATA depending on your ShellVarContext. I’ll most certainly publish my NSIS source code here if I decide to go down that approach.

In addition to appending VPN-settings I also encountered a problem with our internal DNS not being available, so our mailserver and more would not be available for Outlook once the DNS cache had been flushed. This wasn’t much of a problem tho, I just threw in some extra lines in my bat that appends necessary DNS overrides in Windows’ hosts-file:


echo. >> "%systemroot%\system32\drivers\etc\hosts"
echo #### MyCompany Mailserver #### >> "%systemroot%\system32\drivers\etc\hosts"
echo 10.0.0.1 mailserver >> "%systemroot%\system32\drivers\etc\hosts"
echo 10.0.0.1 mailserver.domain.local >> "%systemroot%\system32\drivers\etc\hosts"

Have a blast distributing VPN-settings!

Post to Twitter

20. Nov 2008

Optimizing Adobe Acrobat Reader 8/9 in 10 seconds on Windows XP

I’ve seen some posts about disabling plugins in Adobe Acrobat Reader in order to boost it well into pdf-heaven, but there are several solutions floating around on the web. I thought I’d sum up what I consider the best way to make the reader very fast while still keeping the functionality. And if you’re fast it can be done in less than 10 seconds!

As we’re currently designing a new system image for all our machines and therefore have a test group, I was fortunate to get some user feedback on this method. They were all positive once I had the right files in the right place.

So, here goes (make sure Adobe Acrobat Reader is NOT running while doing this):

  1. Navigate to your Adobe Acrobat Reader installation directory as a user with Administrative rights.
    The default path is %programfiles%\Adobe\Reader 8.0\Reader\ or  %programfiles%\Adobe\Reader 9.0\Reader\ depending on your version
    To go there quick, presuming you’ve kept the default directory, hit Windows button + R and enter the default path given above, then hit Enter.
  2. Go into the plug_ins (retarded name btw) directory, hit Ctrl + A to select all files and Ctrl + X to cut them to your clipboard
  3. Go up/back to the installation directory and enter the “Optional” directory. Paste the files here with Ctrl + V.
  4. While holding Ctrl click on the following files:
    • AcroForm.api
    • EScript.api
    • IA32.api
  5. Hit Ctrl + X to cut these, go back to the plug_ins directory and hit Ctrl + V to paste them back where they once were.

Voila!

Your Adobe Acrobat Reader should now open PDFs as fast as Preview in OS X or Ghostview in Windows / Linux.

There are a couple of remarks here:

  • By putting all files into the Optional folder these plugins (e.g. text2speech) will not be loaded when Acrobat Reader is started. They will instead be loaded when explicitly asked for / needed.
  • Why did I move some files back you might ask yourself? Well, without these files you won’t be able to load Acrobat Reader in a browser window without the browser going bananas.

While some users (probably 3 in the whole world) might need all those plugins immediately we quickly realized that our average user does not.

This trick, in part, is possible in earlier versions of Acrobat Reader as well, but the older it gets, the less plugins it has, so.. :-)

Post to Twitter

3. Nov 2008

Windows update not working after SP3

So, a while back, more specifically when Microsoft pushed XP Service Pack 3 onto Windows Update we started experiencing some problems. After SP 3 had been sucessfully installed, all attempts to update via Windows Update failed. A couple of friends that works in other organizations reported the same problems.

After some extensive research I found out that Microsoft had upgraded Windows Update in SP 3, which to me seemed like a plausible source of the problem.

I checked my version only to find that I ran the old one; something wasn’t right. So, after deep diving into my %systemroot%\system32\ folder I spotted the dll file for the new version, wups2.dll. Since it had not been loaded properly I decided to engage in some trial and failure.

Suspecting that the installation of Windows Update 2 had failed at some point I took a shot in the dark and tried to register the dll so Windows would reckognize it. And voila, it worked!

I am aware that there are fixes available from Microsoft for this issue, but if you’d like to save yourself some time try this little hack (it requires administrative rights on the machine you’re fixing):

Hit start, run and type cmd to bring up a command line prompt.

First you’ll have to stop the Windows Update service. Type “net stop wuauserv” and press enter.
Second, and this is the magic, register wusp2.dll. Type “regsvr32 %systemroot%\system32\wups2.dll” and press enter.
If all goes well you’ll now be able to restart Windows Update with “net start wuauserv”.

Hooray!

Post to Twitter

27. May 2008

List of memes referenced in Pork and Beans by Weezer

Haven’t had time to see the new Pork and Beans music video by Weezer?
It’s probably the most awesome music video ever, having an endless list of references to a bunch of the youtube/internet memes seen the last years.

Take a look below:

Well now, I just couldn’t help but create a list of the clips I spotted. As the gentleman I am, I decided to collect and share links to the videos as well so you can check it out yourself.

However, the list is by far complete. Need some help to put the last pieces together.

Please leave a comment if you’re able to find errors or have additions to make.

00:00 – 00:18
JerryC composition of Canon by pachebel played by funtwo + brief numa numa guy
Edit: And of course, also a reference to One Man Band
funtwo (meme) | JerryC | numa numa guy

00:19 – 00:21
Dramatic Chipmunk / praire dog
Awesome version (meme) | Original clip

00:22 – 00:28
Afro ninja

00:29 – 00:30
JerryC/Funtwo again

00:31 – 00:36
Extreme Diet Pepsi and Mentos Experiment

00:37 – 00:40
GI Joe Public Service Announcement by Fensler Film (Thanks strentax!)
Edit: Also, the glasses are a reference to Guy catches glasses with face

00:41 – 00:45
Extreme Diet Pepsi and Mentos Experiment again

00:46 – 00:50
Guiness World Record for most T-shirts worn at one time

00:51 – 00:55
Extreme Diet Pepsi and Mentos Experiment again

00:56 – 00:58
Afro ninja again

00:59 – 01:02
Chris Crocker – Leave britney alone

01:03 – 01:05
AYBABTU or All Your Base Are Belong To Us (org. from the game Zero Wing)
Awesome version (meme) | Original intro

01:06 – 01:09
Extreme Diet Pepsi and Mentos Experiment again

01:10 – 01:15-
Miss South Carolina Edit: The lightsaber stuff there might be a reference to the star wars kid or the remix of it

01:16 – 01:21
Numa numa guy

01:22 – 01:24
White version of soulja boy (Thanks mats!)

01:25 – 01:29
Evolution of dance

01:30 – 01:38
“Chocolate Rain” by Tay Zonday

01:39 – 01:43
K-Fed Popozao (Thanks strentax and mats!)

01:44 – 01:46
“Chocolate Rain” by Tay Zonday again

01:47 – 01:50
Daft Hands

01:51 – 01:55
Daft Punk Box Girls (Thanks Steve and mats!)

01:56 – 01:58
Guiness World Record for most T-shirts worn at one time again

01:59 – 02:03
Extreme Diet Pepsi and Mentos Experiment again

02:04 – 02:05
“Chocolate Rain” by Tay Zonday again

02:06 – 02:07
Kicesie’s Sex Ed (Thanks mats!)

02:08 – 02:11
Afro ninja again

02:12 – 02:13
Chris Crocker – Leave britney alone again

02:14 – 02:16
Extreme Diet Pepsi and Mentos Experiment again

02:17 – 02:19
Chris Crocker – Leave britney alone again

02:20 – 02:23
Extreme Diet Pepsi and Mentos Experiment again

02:24 – 02:27
Daft Hands again

02:28 – 02:34
Shoes the Full Version (Thanks strentax and steve!)

02:35 – 02:35
Chris Crocker – Leave britney alone again

02:36 – 03:05
Need lots of help here! It’s a mixed sequence with lots of references (even to Will it blend!).
Edits:

Sneezing panda in the corner around 02:36 – 02:38
Charlie The Unicorn seen as a wallpaper in the background around 02:40 and later on
(Thanks for those mats!)

Peanut butter jelly time has several references, most notably around 02:43
Ryan vs Dorkman can be seen referenced several times, most notably around 02:46
The UFO on Haiti hoax UFO flies by around 02:37 and later on behind Miss South Carolina when
she’s referencing Will it blend at 02:54 (trying to blend maps, probably because she’s not very good at geography (thanks Kitsune Sniper!)).
All those Rubik’s Cube videos are referenced at 02:51. One of the most famous ones are 3 Year Old Solves Rubik’s Cube in 114 seconds.

When the camera is panning around 02:37-02:38 you can see a duck that resembles Donald. This is probably a reference to the banner ads talking about lowering mortgage rates, but I do not have a link yet, sorry. (Thanks a million Bizzell!)

03:06 – 03:19
Extreme Diet Pepsi and Mentos Experiment again

Post to Twitter

23. May 2008

blag blag blag

So, Mats got a forward-this-meme thing from Christer that I’ll have to follow up on! It reads as follows:

  1. Pick up the book closest to you
  2. Open page 123
  3. Find the 5th sentence…
  4. …and publish the next three sentences
  5. Link to 5 other bloggers and tell who linked you

So I had a look around; the first thing I spotted at my proximity was the Pys60 Library Reference, but it’s less than 123 pages as I’ve printed it myself on A4. That doesn’t really qualify for a book anyways, so I had to turn elsewhere. And the one other book at my desk is The Hitchhiker’s guide to the galaxy by Douglas Adams. This is, of course, one of my holy books, so I always keep it close.Well now, I turned up to page 123 and what did I find?  Zaphod has just landed the ship on Magrathea and the crew is about to witness the aftermath of the unfortunate fate of a sperm whale, when I quote the 5th sentence:

 With horror they suddenly realized that it was fresh whalemeat. 

 

We all know the tragic fate of that whale; it was spawned at a perimeter not very common for whales, most notably because it’s far up in the air.Well now, nice anecdote right there, I guess today’s lesson is that bad luck can take down even the most kick-ass whale. That’s not very soothing taken into account that I have to deliver my mobile application project in just a few hours.. aaaah screw bad luck. 

Post to Twitter

13. Jan 2008

What are the candidates running?

As part of his “Secrets in Websites II” Robert Accettura has taken the time to give us a technical Presidental Campaign Analysis, telling us what kind of technologies and software the different candidates run their sites on. His article is going pretty indepth and is 100% free of politics!

At first glance this data may not seem very useful, or even relevant, but it is if you think in terms of attitude towards OSS. Microsoft IIS for instance is way more popular among republicans (who would have guessed!?). Additionally, and probably even more interesting, is the markup and charset they serve us their pages in. All candidates are, I assume, interested in as many readers of their messages as possible. However, a lot of them fail following standards and using UTF8.

It’s worth mentioning though that the candidates themselves probably don’t know whether or not their “Homesite is running Microsoft Lunix”. Still, it should be something the agencies designing and deploying these sites think about.

Read the whole article: Secrets in websites, Part II

Post to Twitter

12. Jan 2008

PHP is still my choice, and here’s why

Over at deasil.com there is a well argumented post on Lessons to be learned from PHP.

As a sidenote, the poster is probably referring to Ruby-on-rails at the end of the article though he fails to mention it (mod_ruby for Apache works).

Post to Twitter

11. Jan 2008

Quotes on programming

The other day I was actually looking for a good source of quotes on programming and computers in general.

Then, today, this great DevTopics article got published:

101 Great Computer Programming Quotes

Post to Twitter