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.
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!
16. Dec 2008C#: Implementing IComparer for FileInfo objects (for binary searching and sorting)
While coding a thingie in C# that will optimize Acrobat Reader automatically I came across the need for interal overriding. More specifically I wanted to do a List.BinarySearch and my List was filled with FileInfo objects. Since one can compare files (for sorting and searching) in so many ways, you’re left on your own to subclass / override with the interface IComparer.
I found a neat example at http://www.mattandchristy.com/post/2008/02/Custom-Sorting-In-C-Sharp.aspx that shows just how easy it is to implement a custom IComparer.
My solution:
internal class PathCompare : IComparer
{
public int Compare(FileInfo o1, FileInfo o2)
{
return o1.FullName.CompareTo(o2.FullName);
}
}
Of course, this could be changed if you wanted to compare bytes, dates or whatever. My binary search was then executed like this:
myList.BinarySearch(myFile, new PathCompare());
Hooray!
9. Dec 2008Distribute 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!
| Posted in Interesting, Technological, Tips and tricks | No Comments »
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):
- 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. - 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
- Go up/back to the installation directory and enter the “Optional” directory. Paste the files here with Ctrl + V.
- While holding Ctrl click on the following files:
- AcroForm.api
- EScript.api
- IA32.api
- 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..
| Posted in Interesting, Technological, Tips and tricks | 2 Comments »
All good things are 3(+1)
So, Kristian got a challenge from his girlfriend the other day to provide 4 answers to a series of questions, then passed them on to me. Here goes:
- Name four jobs I’ve had
So, I’ll at least keep it technically related:- Developer at Derdubor AS
- Sysadmin at Halden Videregående Skole
- Freelance developer (mostly for Datasupporten AS)
- Technician at Tofa Data
- Four movies I could watch again
To make it a good sport I’ll not throw in the most obvious ones: - Four places I’ve lived:
I ain’t got four, but I’ll throw in the two that are:- Dublin, Ireland
- Halden, Norway
- Four TV-shows I like:
I like the idea of downloading these shows, but to keep it legal, let’s just say I watch them all on TV:- Seinfeld
- King of Queens
- Everybody loves Raymond
- IT Crowd
- Four places I have been on vacation:
Hm, just random picks I guess:- Dublin, Ireland
- Stockholm, Sweden
- Oviedo, Northern Spain mainland
- Santorini
- Four websites I visit every day:
Ok, so I was tempted to mention all porn sites, but I’ll keep it a bit serious:- reddit.com
- youtube.com
- vg.no
- My TVersity Media server page (but you’re not getting the address!)
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!
| Posted in Interesting, Technological, Tips and tricks | No Comments »
If you bought $1000 of stock a year ago..
So, I picked up this nice comparison from reddit:
If you bought $1000 of stock a year ago, you would now have:
$91.28 if you bought Washington Mutual
$37.50 if you bought Neomagic
$21.29 if you bought Freddie Mac
$20.79 if you bought Fannie Mae
But, if you had purchased $1,000 worth of beer one year ago, drank all the beer, then turned in the cans for the recycling REFUND… You would have $… 214.00 in cash.
So the best investment advice is to drink heavily and recycle.
It’s called the 401-Keg Plan
PHP Vikinger
So Kristian, Magne, Mats and I took the (quite) long ride over to php Vikinger in Skien (over at eZ systems).
The unconference was a great success in my opinion as we got to learn about some really interesting stuff (such as the new garbage collector in php 5.3). Thanks a lot to all of those who were there that made this saturday session worthwhile. A special thanks goes to Derick who did a superb job supervising and organizing it all!
Mats made som neat notes about what we went trough, be sure to have a look!
27. May 2008List 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
| Posted in Funny, Interesting | 18 Comments »