Pages

2009-11-03

Spam and malware, with screenshots

Got this fake antivirus message yesterday and thought it might be worth sharing:
This one was rather well crafted, but they obviously didn't take the time to check operating system, even though they found my ip address. (See bottom left.) Here's another one. This one I got in mail a few weeks ago, from a friend who obviously got her email account stolen:

It's in norwegian, and it's readable, but it is quite obvious that she didn't write it. I guess they fed it through google translate. Translated back to english it would become something like (errors intended): "I need you help NĂ… How is you? ..." Wonder what this is going to look like in a couple of years when automated translation gets getter : )

2009-10-29

Windows 7 fail

I downloaded the Release Candidate of Windows 7 earlier this year, and today I decided to give it a try. After booting from the dvd and asking a couple of questions it asks for a cd rom driver(!). What did you say, Microsoft? You are booting from that CD rom drive. You also have a whole DVD to store whatever drivers you need. Every major linux distro I've tried manages include drivers for my cd rom on a CD! Of course, like every other Windows installation it stops more than one time. And of course it doesn't boot into live cd mode before start asking questions, but that is hardly anything new for anybody who has installed Windows more than a couple of times.
Update 2010-06-13: Finally managed to get some trial running on my laptop, and have used Windows 7 for a couple of weeks on my laptop. It behaves a lot better on my three year old laptop than Windows XP ever did, but I don|t know if this is because of Windows 7, or because it doesn|t contain hp drivers.

2009-10-18

Creating Drupal themes from scratch

If you want to create Drupal themes from scratch, i.e. you do not want to modify an existing theme but rather paste your own html and insert placeholders, MODx style, then this post is for you.

MODx has long been my favourite framework because of it's simple and powerful templating system (copy and paste your html, insert placeholders, go), but recently the lack of visible activity has convinced me to look for other alternatives. I bought "Using Drupal" and "Joomla! A User's Guide: Building a Successful Joomla! Powered Website". One of the reasons I never started to use Joomla! was that it always seemed like it would force me to organize content into two levels. After reading a few pages of the book I found out that it was in fact true. So I put the Joomla! book down and started reading "Using Drupal".

Drupal seems a lot more flexible. The thing that has always scared me away from Drupal and back to MODx is templating. Here is an example: http://drupal.org/node/11774 The templating system is very flexible, -and may seem very complicated.

In addition to this, the ultimate beginners theme, Zen, actually complicates things further if you, for instance, would like to move an existing site to Drupal, or if you want to unpack the html from the designer, insert your placeholders and test it. At least that's my conclusion so far.

Here's a simplified version of my current workflow: 
  • Use a standard theme for your admin pages:
    • Adjust settings under http://<yourservername>/admin/settings/admin
  • Download an empty theme. The best I've found so far is foundation
  • Unzip and paste into themes folder.
  • Rename page.tpl.php in the empty theme to something else.
  • Paste your html to a new file called page.tpl.php.
  • Using the old page.tpl.php as reference, insert similar placeholders into the new one.
  • Enable and test.

2009-10-15

I'm new with drupal, and I wish sobody told me this yesterday: To make an absolute link to an image in a theme, without worrying about where the theme is going to be installed, you can do the following:

<img alt="logo" src="<?php echo(base_path().drupal_get_path('theme','your_theme_name'))?>/img/some_image.png" />

If you are using phptemplate, the drupal_get_path-call might be substituted by just $directory, making it even simpler:

<img alt="logo" src="<?php echo(base_path() . $directory )?>/img/some_image.png" />

The second one was found here:  http://drupal.org/node/52520

Netbeans got a nice css preview

Was doing some spare time drupal work in Netbeans 6.8 when I suddenly found out it had working css preview. See screenshot below for details:
Logging into my other (work ) account I found it in Netbeans 6.7 too, which explains why it wasn't mentioned in NetBeans 6.8 -- New and Noteworthy

2009-05-10

The "bug"

A couple of days ago I troubleshooted some code that was supposed to take a ResultSet as input and return a String as output. For some reason it would just skip the entire resultset, regardless of what I did. In hindsight, it's funny. That last() gave me a lot of debugging, including looking for possible concurrency issues. Don't know why I put it there in the first place either :)

2009-05-06

A very short review of the N82

I got my Nokia N82 about one year ago. Here is my short review: The good
  • Built in camera is good!
  • Build in GPS is decent. I like it. (the reason I say it's decent is that my brother, who was used to the Nokia navigator phone says the N82 it's horrible in comparison.)
  • Makes good use of features. Examples:
    • Camera can geotag pictures automatically.
    • The "Sports tracker"-program uses both GPS and motion sensor to provide detailed information.
  • Stable. (Was horribly slow a couple of days ago, but that problem disappeared after uninstalling shozu. Also this was the first time I experienced real trouble with this phone.)
  • Handles 1500 messages in sms inbox withouth a hitch.
  • You can search for keywords and the phone will find all occurrences in calendar, mail, addressbook, music etc. And it is resonably fast.
  • Go back to previous suggestion feature when writing sms
  • Syncs with eGroupware. (Takes some effort to get it right, but that is mostly because of eGroupware, not because of the phone.)
  • Alarm clock: You can choose which days it will ring.
  • You can access the phone using bluetooth easily under Linux (Ubuntu, at least.)
  • Wifi.
The bad
  • Lacks autocomplete on entering phone numbers.
  • Two needlessy easy-to-hit shortcut key to access media features.
  • If you store the same cell phone number on two contacts, just the phone number will be shown in the display, with no warnings given.
Edit 2009-05-21: Add the point about storing the same number under two contacts.

2009-04-13

Updated the pomodoro timer

I've finally upgraded the pomodoro timer. List of updates:
  • You can now open the applet in a pop-up window. See fourth tab on the top.
  • Buttons instead of small links. (Thanks Sten, Johan)
  • Fixed a bug that prevents new unplanned and urgent items beeing added after the last one has been moved up.)
If you are a pomodoro fan without a physical timer, -go ahead try it! You are encouraged to leave feedback on http://www.itlanddata.no/the-pomodoro-technique/feedback.html If you like it, you are also encouraged to give me a link back. (Thanks again, Johan.)

2009-03-27

Inverting the colors

is as easy as pressing Win + m (on my machine, Ubuntu 8.10, "Extra" desktop effects)

Makes programming a little easier on the eyes a late friday night.

2009-03-17

A four leaf clover!

(Picture is from last summer, found it today before work and thought I'd like to share it anyway. And yes, I feel lucky :)

2009-02-16

What does "cd -" mean?

I didn't know until I read the free ebook "Linux 101 Hacks.

(It lets you change between the two last directories.)

Oh, -the book is really free. At least I found the password at the web site without registering my email address.

2009-01-05

Making a screencast from Ubuntu 8.10

(Hopefully I'll get back to this post with more details later. Bug me if I've left out something important.) I've been planning to make a couple of Norwegian Linux screencasts for some time, and yesterday night i sat for several hours to try to figure out the best way to do it. After figuring out most details I guess there is enough stuff interesting details to make a new blog post.

First attempts: Istanbul and Byzanz

Istanbul looked very promising, but after a couple of failed attempts (flickering in output video) I gave up. Byzanz seemed so limited that I didn't care to even test it.

Next attempt: vnc2swf

Back in September (according to timestamps on the recorded files) I tried vnc2swf, and got impressed by the ease of use and the size of the recordings. So I decided to give it another try. The reason why I didn't just use it in the first place this time was because of a gut feeling that there was some tricky detail I had to figure out. I was correct. Getting started is easy enough (here is a recipe that helped me getting started: Creating training movies with VNC2SWF. It describes the whole process, including how to record just a piece of your desktop.) Problem was just that the resulting file sizes quickly reached above 2 MB for just a few seconds of recording the terminal. Trying to find a solution to this problem I sat until 2 am in the morning before I went to bed, adjusting settings, using the edit program that comes with pyvnc2swf and trying different versions of pyvnc2swf. I also switched off desktop effects and tried to record from KDE. A funny detail I noticed was that recordings from my terminal window seemed to be bigger than recordings of nautilus. Today I found the solution: I just switched off the transparent background in gnome-terminal, and the video sizes was back to acceptable values. Inspired by the success of turning of the transparent background in the terminal, I went back to istanbul to see if the recordings would flicker less when I'd turned off transparency on the terminal background. Disappointment: I didn't. Then I clicked a checkbox saying "record 3D", and suddenly the recordings where OK. Summary: I now have two working solutions for recording desktop screencasts. :)

More information

Here are some more details that might be interesting if you want to record screencasts under Ubuntu Intrepid:
  • Resizing a window so it fits into your screencast: http://stackoverflow.com/questions/288512/resizing-a-window-to-a-set-size-in-linux.
  • The pick feature in x11vnc mentioned at Creating training movies with VNC2SWF is nice, but for some reason it doesn't include window decorations. Luckily x11vnc allows you to specify exactly what piece of the screen you want to record with the clip argument, e.g: -clip 640x480+600+400 .
  • pyvnc2swf documentation mentions pymedia. There's no package for it under Ubuntu 8.10 (Intrepid Ibex), but here's a howto that describes the process (I didn't find g++-3.4 in the repositories, and I had to use libmp3lame-dev instead of liblame-dev. Then, when I tried to compile it, I got an error, but I just continued to install it using checkinstall, and it seemed to work fine anyway.) Oh, yes, here is the howto pymedia on Ubuntu Hardy Heron.
  • Edit 2009-01-05: I was searching for a place to download recordwin.sh, until I discovered that it was included in the tar.gz together with the rest of the stuff.