Wednesday, 23 December 2009

Love my Netbook

Netbooks have been around for a couple of years now and I have an eeePC 901. I have just started thinking about how much it has changed the way that I work.

I should say that my eeepc runs eeebuntu not xp which came with it. This is an Ubuntu distribution that is made for the eeepc and it work flawlesly. Super quick to boot and hasn't slowed down over time.

I used to have a full sized laptop that went everywhere with me. It had about an hour's battery life so needed to be plugged in to actually get any work done.

I now carry my eeepc around in my satchel as a matter of course. It is solid state so there is no HDD. If I drop my bag the netbook is fine. At a pinch I get 5 hours of work out of it which is enough for emergencies in my experience. If I am at a customer site for an extended period I either borrow an LCD, keyboard and mouse or bring my own. Then it is just like using a desktop. The eeeBuntu OS connects through my nokia 6600 slide to get the internet. I can work anywhere.

I still use my desktop for heavy development work but the old laptop has been seconded by my kids cause I never use it.

The key to the success of my netbook I think is the fact that it has no HDD and can handle the knocks. It is always with me and because of that I am always using it.

Wednesday, 16 December 2009

Personal SSL Certs PHP Curl

Needed to connect to a gateway that used personal pkcs12 (p12) SSL certificates and could not find any decent docs online. The whole SSL thing can be confusing at the best of times so I thought I would note down my experience.

PHP does not like pkcs12 certificates so you need to turn them into pem

openssl pkcs12 -in cert-they-gave-you.p12 -out key.pem -nocerts

openssl pkcs12 -in cert-they-gave-you.p12 -out cert.pem -clcerts -nokeys

If they gave you a password and one is requested here use that.

test at command line with

curl --cert cert.pem --key key.pem https://url-to-service

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://url-to-service');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/certs/cert.pem');
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, 'password');
curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM');
curl_setopt($ch, CURLOPT_SSLKEY, getcwd().'/certs/key.pem');


/**

Word press will not allow me to post the execution command snippet so you need to look it up
**/
echo $result;
curl_close($ch);



PHP 5.2.3
cURL Information libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
Ubuntu 9.04

Tuesday, 15 December 2009

Skype Video on Linux

I recently set up an Ubuntu 9.10 machine for a customer that wanted to use it for Skype, Web and Email. In my experience Ubuntu is a great desktop in these instances.

This time however I hit a real speed bump with the Video in Skype. Every time the user tried to initiate a Video call Skype would close. This is strange because I have used it before with no problem.

The solution is to turn off video calls by default in the Skype settings, wait for the other person to initiate a video call, click on the video camera icon at the bottom of the picture, set the screen to double size and then turn on your video through the same menu. Not ideal I agree but good enough.

Thursday, 3 December 2009

Email on your phone - should you make the jump?

If you thought Crackberrys were addictive and that the novelty would wear off.. well think again.
Now that the rest of us can also have some too

But if it to become something as normal as having your phone with you, then it must be

easy


reliable


not run your battery down!



Applets for the mass market produced by such heavyweights as Nokia or Google, and used by millions, are certain to be easy to use, and as reliable as the network that carries them.

The problem is that the push technology they are based on means that the signal is on a lot more than the occasional call or text. And my experience is with the battery lasting less than half a day!

So getting used to them is no problem, but

Not that the email is always tightly integrated into the other aspects of the phone, which for me is the main criterion for choosing which method to use.

For the record I am on the New Zealand Telecom XT network and have a Nokia 6120 Classic (which has the  Symbiam60 operating system).  It appears that Symbian40 does not allow some of these apps to be used..

There are several options - three amongst which I have tried
- Google's own app (m.google.com.mail)
- Mail for Exchange
- Nokia's Messaging

Google's app whilst looking good, surprisingly, didn't integrate well with the phone's contacts list, instead presenting the txt interface each time an address is typed in. Most irritating!

The Nokia app, however acts in an much more Google-like way in the address line - suggesting possible matches in a drop-down as you type the first letter or three.

The other key criterion was to have gmail's contacts list seamless with the phone's. This was best accomplished using Mail for Exchange. At time of writing, contacts, tasks and email can be synched to gmail, so this is another good option, and it can be set to check periodically, say every 15 minutes is probably enough and will make the battery last more than just a day.

The Nokia app redeems itself by allowing scheduling of a download window. So it easy to be checking email only during your preferred work hours, and weekdays. BUT when on, it seems to be always on... thus my battery issues.

Be warned however, that the Nokia app appears to be in beta, or given away free for the time being.. The beta was supposed to have been pulled at the end of September - yet it is still going strong two months later.. I could find no more info on what plans are available - suffice to say that the only plan available is still the  "Nokia Messaging trial". http://e71bynokia.blogspot.com/2009/09/nokia-messaging-trial-ending-this.html

Well, you can't have it all, I suppose.

SIDENOTE: Tasks is not yet synced with any of these methods - but is possible with a £5.99 plan at http://www.goosync.com/About.aspx



Access Details

Google's own applet:
To download the app, point your mobile device's browser to http://m.google.com/mail.

Mail for Exchange can be freely obtained here

http://europe.nokia.com/get-support-and-software/download-software/mail-for-exchange

Download Nokia Messaging software can be done by regisering a Nokia account, and getting a link sent by text message sent to your phone here https://netac9.vie.hosting.nokia.com/account/getSoftwareAfterLoginUI.action

Alternativley, a direct download can be started by browsing from the phone as the instructions below indicate.

If you're having trouble receiving the text message with the Nokia Messaging software, you can use the web browser on your phone to directly download the software.


1 On your phone's web browser, go to: email.nokia.com


2 Select the button to download the Nokia Messaging software.


3 Follow the instructions on the phone to download and install the software


4 Enter the email address and password of your Nokia Messaging account to log in and start using the service.

Wednesday, 2 December 2009

Humility in IT

It's nice once in a while to be pleasantry surprised by an error message that actually apologises for the inconvenience - and means it (and offers a couple of useful options to try - other than just the choice of OK or Cancel ! )

[caption id="attachment_51" align="alignnone" width="659" caption="Firefox could not restore a previous session - and was actually honestly sorry.."]Firefox could not restore a previous session - and was actually honestly sorry..[/caption]

Sunday, 29 November 2009

Cloning an Ubuntu Server

I recently needed to clone an Ubuntu 9.04 server to another machine for one of my customers thinking that it would be simple. It wasnt. But here's how I got it to work.

Firstly from searching the net it would seem that there are a lot of different ways of doing this. dd, ddrescue, partimage, ping. They did not work for me for various reasons. I ended up using the tar method.

You will need a LiveCD that you can boot on the machine that you are copying to. And your original Install CD of Ubuntu. Because my original was server which is not a live CD I used Minibuntu. You will also need a USB drive that is big enough to hold the image.

First log in to the machine that you are copying. cd to /. sudo su.
tar -cvpzf backup.tar.gz -–exclude=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media /

Copy the backup.tar.gz to  a USB drive attached to the machine.

mkdir /mnt/usb


mount /dev/sdb1 /mnt/usb
(sdb1 may be different on your machine dmesg | grep -i "SCSI" should list it with sd?)

cp /backup.tar.gz /mnt/usb


Next install a basic Ubuntu Server on the new machine.  Reboot and plug in the USB drive. Mount it as before and copy the backup to the root directory of the new machine. Then extract the archive.
sudo tar -xvpzf backup.tar.gz -C /

Reboot but this time to the LiveCD. If you use Mini Buntu command line LiveCD you need to select another terminal after boot. Ctrl-Alt-F2.

Since you are running from a live cd you need to mount the HDD of the machine. Same way as mounting USB.

Then you need to install grub again to get the boot stuff correct.

sudo grub
will bring up the grub prompt if not
sudo apt-get update
and
sudo apt-get install grub
. Note that you will need the internet for that. If you can not connect to the net just make sure that the LiveCD you use has grub on it. Mine didnt.

at the prompt
find /boot/grub/stage1

root (hd0,0)
(Replace with whatever the find returned)
setup (hd0) 
(Again replace the hd0 with the results of the find)

quit


Now we need to fix up the UUIDs. These are identifiers from the HDD which you have just overwritten. To get the UUID of your drives

ls -l /dev/disk/by-uuid/


or

sudo vol_id /dev/sda1


Note them down and for which partition root and swap. Check them and then check them again.

now change the grub loader and fstab.

sudo nano /mn/etc/fstab
.

update the UUIDs

sudo nano /boot/grub/menu.lst


update the UUIDs


Reboot and you should be a go.

You may get an issue with networking. Because a new card is recognized the ethernet adapter name on my system changed from eth0 to eth1. I worked this out by dmesg | grep eth0. edit the /etc/network/interfaces file and change all instances of eth0 to eth1.

References
https://help.ubuntu.com/community/BackupYourSystem/TAR
http://linux.byexamples.com/archives/321/fstab-with-uuid/
http://stringofthoughts.wordpress.com/2009/05/25/grub-error-15-debianubuntu/

Saturday, 21 November 2009

beware of moving Profiles and User data

In Vista (and Win7) beware of moving Profiles (and so) User data to another drive without doing some reading....

This used to work fine in XP with the standard My Document>Properties>Move>yes

UPDATE: Found MS knowledgebase on this where they say its possible,


BUT DON'T SUPPORT IT, OR RECOMMEND IT. Blah


http://support.microsoft.com/kb/949977



Various alternative methods are discussed in detail here http://joshmouch.wordpress.com/2007/04/07/change-user-profile-folder-location-in-vista/,  and I have quoted extensively from that article, but the outcome of this long discussion is that I would opt to only do this when rebuilding Vista.

As an aside, I learnt a useful tip from the thread - as well as the fact that MS has finally caught up with 'Nix and has symbolic links...

To get a CMD prompt with Administrative privileges, all you need to do is:
1, Click the Start Button
2, Type ‘CMD’ in the Start Search box
3, Press and hold down [Ctrl]+[Shift]+[Enter]
You should then be able to create the links you need (symbolic links)  such as:

http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/



Or use the tool LINKD

Get the tool LINKD.exe from Windows Server 2003 Ressourcekit tools. Copy it to c:\
Start Vista from CD into repair mode Konsole window or you can use BartPE or a second Windows XP/Vista installation.
Now rename c:\users into c:\users.old
type LINKD c:\users D:\Users
Now copy all files from c:\users.old into c:\users Restart.


The thread starts back in 2007, and continues right to the present day. Some ppl have had success using mklink

1) Created a new partition (“d”) for my data.
2) Backed up up my drive (just in case).
3) Loaded the Windows Vista installation disk and got to the command prompt.
4) Once at the command prompt, I entered the following commands:
robocopy C:\Users D:\Users /MIR /E /XJ [Enter]
rmdir /S /Q C:\Users [Enter]
rmdir “C:\Documents and Settings” [Enter]
mklink /J C:\Users D:\Users [Enter]
mklink /J “C:\Documents and Settings” D:\Users [Enter]
The robocopy took about 15 minuted for 5 gigs worth of data. The other commands took no time at all.
5)I exited and rebooted.
6)Voila. I was good to go.




When I look in my c partition, I see “junction pointers” for c:\Users and c:\Documents and Settings both pointing to d:\Users.
Everything seems smooth and I haven’t noticed any slow down.
Then some success:

Richard on January 22, 2009


I think you guys all think Vista is a real new OS. It is much more simple than any of the above optiosn to move a profile directory and maintain its rights.


First I did as others mentioned. I changed the default location of users in the registry (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList). I set the Default, ProfilesDirectory and Public keys to point at a seperate volume. (in my case D:\Users}. I then copied the C:\Users\Default and C:\Users\Public directories to the target (D:\Users in this case).


Then I created a dummy admin, and logged in as my dummy admin, confirmed the location of the new admin profile in the secondary volume (i.e. D:\Users\Dummy)


Now the trick: I first set my file view to allow my dummy admin to see invisible, hidden and system files. Then I right-click the Computer icon (or go to System in the Control Panel), select Properties and then choose Advanced System Properties. In the Advanced tab is a User Profiles section. Click the Settings button and you can move each profile right there, Be sure to move the profile to the same folder name. So if you are moving user JDoe and his profile is C:\Users\JDoe then make sure to move it to the same folder (i.e. d:\Users\JDoe). This will move the whole profile and keep the same user rights! No screwing around with command line or anything. In the registry make sure all your user profiles point to the right folders now. The user profiles will start with S-1-5-21-(lots of numbers) usually. If you see Short names like S-1-15-18, those are Service profiles, leave those be, only edit your user profile paths. Now log back in a your migrated user and enjoy.


Caveat: Because you did not change the rights of the original C:\Users\profile directory you will not be able to rename or remove C:\Users. This isn’t a big deal as you are not using it anyway.


Richard on January 22, 2009



Actually a correction to the above. You can actually log in as the migrated user and delete the old C:\User\ profile of that specific user, since they still own the folder.
I menation that for the guy who had a 100 gig profile above. And sorry this still requires a copy.

Some arguments continues as to whether symbolic link should or should not be used, and success with Win7 has been reported:

cdr on October 2, 2009




In our school we have dual boot xp/vista computers.
This is how we move the entire Vista User profiles folder to a different partition
(E: in our case).
First we do a regular Vista installation.
Then we run the following startup script:
REM robocopy the user profiles folder to E:
robocopy C:\Users E:\Users /MIR /E /XJ /COPYALL /DCOPY:T
REM remove user profiles folders/link from C:
rmdir /S /Q C:\Users
rmdir “C:\Documents and Settings”
REM create on C: symbolic links that refer to E:
mklink /J C:\Users E:\Users
mklink /J C:\Documents and Settings” E:\Users
We activate this script with a local policy (gpedit.msc): Computer configuration – Windows settings
– Scripts – Startup. We also enable two other options: Computer configuration – Administrative
Templates\System\Scripts\Run startup scripts asynchronously and Run startup scripts visible.
The script has to be a computer startup script in order to run it before any profile is loaded.
After we reboot the pc and the script has run once, we remove all previously mentioned settings.
We’ve been doing this for some time and until now everything seems to work fine.



Friday, 20 November 2009

Service Packs and Updates keeping us in bacon

To apply, or not to apply.

Until this week, I have been advocating customers to apply any and all Microsoft updates that are available.

I was surprised (but not shocked), that a routine SP1 on Vista Home Basic went up the creek.

I was also surprised that more of a fuss had not been made of it at the time (mid 2008). Judging by the number of similar reports, it was obviously a widespread problem.

In summary, if SP1 was applied whilst the antivirus was not disabled, the file $TxfLog was corrupted and Windows simply got into a reboot loop.

Booting to Linux (Ubuntu 9.04 did it for me), mounting the drive using the third generation ntfs-3g allowed me to delete the file.  Bingo.  Fixed.

(Most posts point back to http://www.delmartian.com/workaround-for-stop-0x0000c1f5-0xc1f5-c1f5-bsod-clfssys-kb946084.html so kudos there.)

Problem solved? You'd think.

Up till then I didn't know which update had been the cause, so I ran SP1.

This time I came up with another unusable Vista system, telling me usefully:
!! 0xc0000034 !! 250/53007 (_0000000000000000.cdf-ms)

Fortunately, this too was fairly simply resolved using a Vista Recovery Disc and going back to the last Restore Point, summarised well here: http://ezinearticles.com/?Error:-0xc0000034-While-Installing-Windows-Vista-SP1-Or-SP2&id=2580302


OOPS, spoke too soon, restore shows the point that I wanted (immediately prior to SP1), but never completes.


I ended up backing up (via F11 and saving to a USB disk) and reinstalling ("recovering").






A few things occur to me.

1 How did we fix these sorts of things before we could search (and find) the exact error message, and find multiple hits and usually a solution, or at least a hint which direction to go, thus saving hours of trial and error in getting it fixed.


2 Does Microsoft specifically say that we need to disable antimalware when applying major (or even minor) patches? They probably do somewhere in the never-read "I agree" screens...


3 A new refreshed OS is a good idea occasionally, but only when I choose it, and not on a customer's beloved tweaked and data-laden dust-collector.



4 Restore points are REALLY useful, and we should use them more routinely. (Perhaps we are guilty of jumping to conclusions that fixes should be harder than that, whereas we should be covering off the simplest, built-in methods first).


5 In Vista there are a lot more built-in options to try and fix things at boot time, but the terminology is obtuse and each of the methods seems to confuse the matter further!



For a good run down of the Vista recovery process, see http://neosmart.net/blog/2008/windows-vista-recovery-disc-download/


And lastly, a knowledge of Linux is absolutely essentials these days to fix Windows!




Wednesday, 18 November 2009

What's in a name

We were going to call ourselves HAH – but that’s a bit close to HAHA, although if the domain was still available for that [does quick lookup on the side], it might have been a good idea!

(and yes, is still available at time of writing).

One would think that hha.co.nz would be simple and easy and hard to get wrong.

Wrong. Try saying that to the “representative” on the other end of an 0800 in outer Siberia.

…..”was that “Haitch Haitch ‘ay”, or ‘aitch ‘aitch ‘ey (hey?)”  Eh? Grrrrr

Oh well, what’s branding anyway but a big old con.

It’s our intellect, drive and ambition that count, oh, and being able to get to the phone before it stops ringing ;)

Still, that’s us. Three hard-working boys enjoying making a GO of it

Monday, 16 November 2009

Go

Google have just released a new programming language called go that on the face of it is another 'me too' programming language but I think it could be a real game changer.

In the good ol' days computers used to double in speed every 18 months along with Moore's Law.  For nerds like me this was great. If you got a new PC and your nemesis had one that was a year or more  old you could invite them round for coffee and ritual humiliation. Ahhh good times.

But then Moore's Law ran out. There was no mention on the 6 O'clock news. No funeral. No old Arab women slapping their foreheads and screaming at the sky. Now when I drop $2000 on a new laptop the only thing that it does different to my 3 year old laptop is Bluetooth so it can talk to my cellphone. I am not even sure what they say too each other.

Although some CPU's are in the 3+GHz range most are 2 something and the cheapies are 1.6. To sell more computers the manufacturers are adding processors. Dual core, Quad Core etc. The only problem with that is that it has no wow factor. When you get a new machine it doesn't feel any faster than you old one and certainly wont be scaring your nemesis. The reason for this is that even though the computers have more procs the software that runs on them is still designed for single procs.

Developing software for multi proc systems is fundamentally different and most modern languages are woefully ill equipped to handle it in such a way that moronic developers like me can understand. There have been attempts but they have just not got off the ground.

Then along comes GO.

  • GO from the ground up is designed for multi processor and distributed processing systems.

  • It creates extremely fast executables.

  • It has kept the syntax simple and easy to understand.

  • It is open source.


All that means nothing if nobody uses it but this language is released by Google. I am not completely sure but I think Google owns the internet. If they don't own it they must be pretty close. In Nerdville (where I live) Google has the greatest market share by a mile and the fate of this language will be decided in Nerdville.

If it does take off and desktop software and OS  is written in it then it will no longer be the GHz of your CPU but how many CPUs you have that matter. Twice as many CPU's = twice the speed. Three cheers for conspicuous consumption.