RSS
 

Archive for the ‘Tech’ Category

Whoopsie…

30 Nov

Just noticed that I made a mistake when I reinstalled my webserver.

Installed server – Check.
Updates? – Check.
Installed LAMP – Check.
Moved all files – Check.
Moved databases – Check.
Moved configuration files – Check.
Check if site works – Fail.
Enabled htaccess – Check.
Site works? – Check.

Now here’s where it went wrong, I never checked that any sub-pages work, just the front page. So in short, fail.
I forgot to enable rewrite for Apache. *Doh!*

Oh well.
Shit happens and then you fix your mistakes while maintaining the illusion that next time you’ll remember it.

 
No Comments

Posted in Tech

 

Conditional formatting in Excel 2007 and 2010

28 Oct

I upgraded to Office 2010 this week and was today playing around in Excel. (I consider myself somewhat of an Excel power-user.)

Apparently there’s a bunch of new stuff you’re supposed to be able to do with Conditional Formatting, but I would’ve been very happy with them just working for starters.

Scenario A: Need to color cells in columns J:O based on the values in B:G on the same sheet.

This seemed simple enough and I quickly worked out that I could just use the normal format the cell depending on a formula. 3 rules to format in 3 colors. The formula itself was quite simple, an IF() to compare value1 with value2. Value1 and 2 fetched with INDEX().

Like this:
=IF(INDEX($A$1:$O$38;ROW();COLUMN())>INDEX($A$1:$O$38;ROW();COLUMN()-8);TRUE;FALSE)
=IF(INDEX($A$1:$O$38;ROW();COLUMN())=INDEX($A$1:$O$38;ROW();COLUMN()-8);TRUE;FALSE)
=IF(INDEX($A$1:$O$38;ROW();COLUMN())<INDEX($A$1:$O$38;ROW();COLUMN()-8);TRUE;FALSE)

Short explanation: INDEX(A1:O38; …; …)  this grabs the values so far as an array. ROW() and COLUMN() just return the current row and column numbers so index can return the content of the cell.

Scenario B: Same thing as above, but use Icon Sets with arrows up, down and sideways instead of coloring the background.

I first tried to set the > and >= to use Formula. This resulted in the formulas disappearing from the input field half the time. Apparently they did not disappear, they just showed blank though the formula was in there. Reading invisible stuff is a bit of a challenge for me at least.

Switched to using type Number instead and just fetching the correct cell with INDEX($A$1:$O$38;ROW();COLUMN()-8), but this resulted in most of the arrows pointing in incorrect directions. Very odd, I would have imagined that this one would work right off the bat.

About 15 minutes later I realized that if I use INDEX() on just a single cell like I described above, it worked! Meaning I could now use the format painter to paint one cell at a time and it would show the correct arrow. At this point everything was more or less hunky-dory, until I gave the formula to a colleague who has Excel 2007… and of course that did not work at all.

*&%#¤!!

Scenario A worked in 2007 though. It also seems that if you’re not careful when entering the formula as Number, it will add =” ” around INDEX. This caused some of the problems I was seeing.

One really weird thing I saw in 2010 was that when I looked through the list of Conditional formatting rules, the “Applies to”-section would become blank as I scrolled down and back up. See the screenshots below.

Conditional Formatting rules, before scrolling

Conditional formatting rules, scrolled down a few steps

Conditional formatting rules, back to the top

 
No Comments

Posted in Tech

 

How-to: mysqldump

24 Oct

Note to self:

mysqldump -u USER -p PASS -databases DB1 DB2 | gzip -9 > dumpfile.sql.gz
 
No Comments

Posted in Tech

 

Samsung Blu-ray problems

06 Oct

Uncommon customer care? Yeah, spot on.

Uncommon customer care? Yeah, spot on.

A while back (in August to be precise) I bought a brand-spanking-new Blu-ray surround system from Samsung (model HT-D5550), installed it at home together with the TV (also a Samsung), hooked up the Xbox 360 without problems. It’s got a nice glossy black finish (kinda plastic on closer inspection though) and the birds have been singing since then…

Until yesterday that is. My wife told me while I was at work that she couldn’t get the new Lion King-disc to work on it, I figured to myself that it’s probably just a question of who’s holding the remote.

Alas, it wasn’t. After getting home and turning everything on, shoving the disc into the player it starts up. I see the Disney castle. How quaint. The water is moving below the castle. Very nice. Checking what the info-button says on the remote yielded the positively delightful answer that this will go on for another 18 minutes. It didn’t.

I turned off the player, back on, checked for firmware updates (“No new updates available”, of course) and hit play again. Same story, same castle, same moving water for 18 minutes. This is the point in time I opted for the W-T-F-question-mark-combo.

A little googling later it appears some Disney movies might have playback problems in Samsung players. Effin beautiful.

Right, back to the shelf to grab half a dozen other blu-ray discs.

  • Pirates of the Caribbean: On stranger tides (Disney)? Nope.
  • Prince of Persia (Disney)? Nope.
  • Gran Torino (WB)? Nope… uh, what?
  • Bucket List? Yep. No problem.

After poking around the player to find where the serial number was located (in the back-bottom-corner of the player which is held quite firmly in place by all the cables in the back, of course) and rigging up a mirror to snatch a photo of it, I went to Samsung’s delightfully unhelpful support-pages to look for where I could submit a ticket, case or whatever they opt to call it. I spotted the “Ask us by e-mail” link and filled in the form with pretty much all the information I’ve just described here above.

Today I was being carefully hopeful while waiting for an answer. Pling! went the phone, new mail. Yay!

After scrolling through the mandatory mail-headers I found the reply to my question. It went pretty much like this:
Typically it’s the software which causes playback problems on some discs. In that case you will have to wait for a new update which will solve this. In your case when you already have updated the firmware you can either wait until the next update, to see if your movies weren’t included, or you can turn to your store so they can have a look at the equipment.

Please contact us again if you have any additional questions.

Best regards,
Samsung Support

Wait, what?

I can either continue to wait and see, if the next firmware update solves my problems or go back to the store (how easy that is, considering it’s online with offices in the other end of the country) with the equipment?
Let’s see. A surround-system with integrated blu-ray player should, by definition, play blu-ray discs.

Right?

Well, it doesn’t. What it does is play DVDs though, but had I wanted a fancy DVD-player for that amount of money, I probably would have bought one.

I guess you might read between the lines at this point and take a wild shot in the dark on what I selected in the feedback section under “This information was useful to me”.

I have a bunch of circle-shaped pieces of plastic in my shelf which are pretty much worthless now. So the big question is what the heck do I do now?

Contact the store?
Disney?
Samsung’s delightful “uncommon customer care” again?

 
1 Comment

Posted in Tech

 

Expressen.se XSS vulnerability observed

04 Oct

It’s been a “while”… nevertheless, I saw something interesting today. One of the bigger newspapers in Sweden apparently had a XSS vulnerability on their site. I say had, because at the moment the offending piece of code has been removed. In it’s simplicity it was quite interesting to see some really good thinking.

They accept reader-submitted travel-photos, so someone figured they would submit a picture with <script>alert(‘wasp’)</script> as the title for the image.

Screenshot from the front page:

JavaScript injection on Expressen.se

Screenshot from the gallery-page:

( http://www.expressen.se/resor/1.549780/lasarnas-resbilder-del-1 )

JavaScript injection on Expressen.se, part 2

 

 
No Comments

Posted in Tech

 

What’s wrong with the Google Webmaster Central Blog?

03 Jun

Got a weird surprise today when I was catching up on the nights posts via google reader. The feed from Google Webmaster Central Blog had a bunch of photos, which turned out to be the flickr feed of the user nismo334.

I wonder what happened… did feedburner screw it up? Did google reader get confused and syndicate the wrong feed?

Nevertheless, here’s a screenshot of the cock-up.

Google webmaster central blog feed mixed up

 
No Comments

Posted in Tech

 

Rooting Desire – a lesson learned

20 May

I never thought that rooting a HTC Desire (not HD) would be as complicated as it turned out to be.

A couple points to take into consideration when doing it:

  1. Use Unrevoked3.
    You’ll save youtself a bunch of steps/time by using the linux version. No need to install custom hboot-drivers for Windows, etc. It just works. :)
  2. If it fails (in this case with a “process com.unrevoked.zysploit has stopped unexpectedly”), try doing a factory reset before running Unrevoked.
  3. Don’t forget to put the custom ROM of your choice in the root of your SD-card. I’d recommend CyanogenMod, if you’re having trouble deciding on what to try.
  4. Don’t forget to wipe your phone from the clockworkmod recovery (phone, cache, dalvik-cache) before installing the new ROM.

Oh, also gave the newest CM7 based Elelinux-variant for the Hero a try. Seemed to run nicely (plus it’s Android 2.3.4). :)

 
No Comments

Posted in Tech

 

Linux on a Soekris net4801

19 May

It’s been a while, but I’m back again. :)

This time around I had the dubious pleasure of trying to figure out how to put Linux on a Soekris net4801 (a little ugly box with 3 ethernet ports, 128Mb RAM, 266 MHz CPU and a 4 Gb Compact Flash-card).

A lot of trial/error and various guides around the net:

I tried at least four different installations of Ubuntu before I gave up, there was always something that went wrong. The Debian Squeeze-variant seemed simple enough, so that’s what I ended up installing and then troubleshooting for a few hours.

A few issues which arose during the installation and configuration:

The passwords for the default users (root & soekris) were missing from the tarball. Supposedly the file was called “Squeeze-On-Soekris-passwords”, but it wasn’t there. However, you can mount the CF-card on another Linux-machine and modify /etc/shadow and remove the passwords. (A really neat trick I didn’t know about.)

Grub (v2) was more or less screwed and kept spitting out Error 15: File not found for the first couple of reboots, I did manage to push the older version, which I’m a lot more comfortable configuring by hand, on to the CF-card. Seems it did not like working with UUIDs at all. Took a few tries entering the kernel parameters by hand to get the box to boot.

With the older version of Grub you easily get just garbage printed out via the serial-cable, the fix for this this turned out to be a line called “terminal serial” (instead of the long “terminal –timeout 5 serial console”).

The box would die on a server panic of sorts complaining about clocksource-something, I got past it by adding “notsc” to the kernel-line.

Now after a few days of searching, troubleshooting and a load of trial/error the box is happily up and running Squeeze. :)

 
No Comments

Posted in Tech

 

Yay! CyanogenMod 7 is stable!

11 Apr

I just saw in my RSS reader that CyanogenMod 7 is now stable. Fantastic!

I was running an Elelinux variant which was based on RC’s, with both good and bad results. Right now I’m waiting for my newly flashed Hero to boot up so I can see what the clean CM 7 has to offer. :)

It’s a good day, even though it’s Monday…

PS. Damn cool boot animation on it…

 

Edit: Need to download and install the google apps separately, I grabbed the CM7 gapps from here.

 
No Comments

Posted in Tech

 

Intel 120gb SSD vs. WD 160gb 7200rpm

06 Apr

I’m considering switching the old harddisk in my wife’s laptop to a SSD, but like in most things in life: there’s way too much to choose from for the uninitiated. A co-worker was kind enough to let me try out his “old” Intel SSD (which is about a month old or so), thanks Leon.

So, since the dear local government is busy with the usual all-important-life-or-death surfing for the evening I spent a few minutes switching the drive into my own laptop for comparison. I can’t say that it’s very scientific measurements, but at least I can say there’s some crystal clear differences between the two.

I did a fresh Ubuntu Desktop 10.10 installation on the SSD (which btw, took just a few minutes) which I compared against my current Ubuntu 10.10 installation on the 7200 rpm 160 gb Western Digital. Yes, yes – I’m aware that I’ve got a bunch of custom configuration things and services on the “real” HDD and absolutely nothing but a clean installation on the SSD.

Harddisk models:
Intel SSD 2.5 inch X25-M 120GB MLC SATA300 (SSDSA2M120G2GC)
Western Digital HDD 160GB SATA 7200 rpm (WD1600BEKT-60F3T1)
(I’ll just call them SSD and WD respectively, because the full names are a mouthful to say the least.)

Time to login screen from power on
WD: about 44 seconds
SSD: around 19 seconds

I used the disk utility included with Ubuntu for the read tests.

Min read speed:
WD: 40,3 mb/s
SSD: 137 mb/s

Max read speed:
WD: 87,8 mb/s
SSD: 140,6 mb/s

Average read speed:
WD: 67,0 mb/s
SSD:  139,4 mb/s

Starting to see a pattern?

Here are the mandatory screenshots of the performance tests:

WD 160gb 7200rpm info

WD 160gb 7200rpm info

WD 160gb 7200rpm performance read test

WD 160gb 7200rpm performance read test

Intel 120gb SSD info

Intel 120gb SSD info

Intel 120gb SSD performance read test

Intel 120gb SSD performance read test

 

Edit: Added another screenshot of an old Hitachi 160gb 5400rpm IDE drive, accessed via USB.

Hitachi 160gb 5400rpm IDE read performance

Hitachi 160gb 5400rpm IDE read performance

 
No Comments

Posted in Tech