A Linux guest in VMWare is pretty common. And I think the most commong reason for installing VMWare Tools into the guest is to improve graphics performance and allow mouse tracking (so you can slide in and out of the guest window with Ctrl + Alt clicking).

But if you use Linux Guests for servers, you probably have a console only install. One problem we’ve found is that VMWare does not initiate an ACPI shutdown call when you power off from the VMWare Console. The option is there in the Virtual Machine settings (Power -> “Shutdown Guest OS” / “Power Off”), but it doesn’t do anything unless you have the VMWare tools installed.

Generic installation instructions for VMWare Tools into Debian Linux guest OS:

The “Install VMWare Tools” option from the VMWare Console just remaps the guest CDROM to the local host ISO of the tools.

Typically, the tools need to build the kernel module (at least, I’ve never used a kernel that they support properly). So, from console Debian, as root:

1. apt-get install linux-image-2.6-686
2. apt-get install linux-headers-2.6-686
3. shutdown -r now (to activate the new kernel)
4. mount /cdrom
5. cp /cdrom/*.tar.gz ~/
6. cd
7. tar -xvzf vmware…tar.gz
8. cd vmware-tools-distrib/
9. perl ./vmware-install.pl
10. Spam enter key
11. shutdown -r now (to activate vmxnet)
12. Complete ;)

Written on May 16th, 2008 , Informative

One of my clients had an iPhone with a lock code on it, and someone messed around with it and entered the lock code too many times. Now, the iPhone will let you try to unlock it about a half a dozen times, and then it starts to introduce a lockout time “iPhone is disabled, please try again in 1 min” then 2, then 5, then 15 then 30, then 60..etc. It seems to double each time. Well my clients phone got to 4226381 minutes until he could retry somehow!

We knew the correct passcode but we could not enter it!
So I took it back and tried iTunes. Nope, it says it’s locked. So I factory reset by holding the home button when I place it one the USB cradle, and iTunes starts and tells me that the iPhone is in restore mode. I proceded to restore, and the only option is to restore and upgrade. So I did that. And it turns out the SIM card that was in it won’t work with the iPhone. So it needed unlocking.

Enter Ziphone! I have to say this is one of the best hack software utilities I have used. Very easy, good options, good interface. And it looks pretty with the new logo…and it worked 1st time :)

So big props to http://download.ziphone.org/ -> Ziphone!

PS: This is an iPhone in Australia being unlocked to use an Optus prepaid SIM. Like I said, worked 1st time.

Written on May 12th, 2008 , Informative

Streber is a Project Management System / Content Management System. It’s somewhere in between, lacking the full features of either, but that makes it really good if you want something inbetween! I had some problems with file uploads though, and there are 3 things to be aware of.

PHP limits the default file upload size to 2M. So if you want to be able to upload files large than this, you need to increase that.
Streber limits the default file upload size to 8M. This actually matches the post file size default of PHP. See, when you upload a file, it’s actually just using a form of method POST to post the binary data back to the webserver.

So you need to edit php.ini (Should be in /etc/php5 or /etc/php4 in the apache sub directory) and setup:

post_max_size = 8M
upload_max_filesize = 2M

And streber/conf/conf.inc.php
‘FILE_UPLOAD_SIZE_MAX’ => 80000000,

Note that variable in streber is in bytes, so I’m saying ~80MB right there.
Then you can upload properly!

Written on May 5th, 2008 , Informative

I’ve just got my new Macbook Pro (they’re sweet machines by the way, I’m so glad I didn’t get the Air), and it came with Mac OS X Leopard. I quite like the picture of the Earth horizon, but the Earth is on the right hand side. Because the earth is bright, and the icons are bright, when they are both on the left hand side sometimes they are hard to see. I wanted to flip the picture, but I had trouble finding it. So, for anyone looking for the location of those pictures i the Finder, they are in /Library/Desktop Pictures.

Also, I’ve posted the flipped version of the picture here (I just opened it in Preview, horizontally flipped it, ad saved it without the EXIF rotation information).

Written on May 3rd, 2008 , Informative

Anyone who has used the SFTP command line client to do bulk transfers has probably run into the problem that it will not copy or get files recursively. That means, it won’t spider into directories. It just gets files in the current (or specified) directory.

The normal solution is to use scp -r instead, since they both us the SSH protocol. However, I’ve run into a problem with Gippy hosting where they only allow SFTP and not scp. Of course, I could use a GUI client. But GFTP crashes when copying bulk files (common error in Ubuntu Edgy / Feisty / Gutsy), and kftpgrabber refuses to connect.

Enter lftp. It doesn’t actually recursively copy as much as mirror. But it mirrors the directories you tell it, which is effectively a recursive copy.

Usage:

lftp sftp://user@host
mirror remote-dir local-dir

A full usage list of the mirror options is:

mirror [OPTS] [source [target]]

   Mirror specified source directory to local target directory.   If target directory ends
with a slash, the source base  name   is  appended  to target directory name. Source and/or
target   can be URLs pointing to directories.

-c, --continue      continue a mirror job if possible
-e, --delete        delete files not present at remote site
--delete-first       delete old files before transferring new ones
--depth-first        descend into subdirectories before transferring files
-s, --allow-suid         set suid/sgid bits according to remote site
--allow-chown   try to set owner and group on files
--ascii         use ascii mode transfers (implies --ignore-size)
--ignore-time        ignore time when deciding whether to download
--ignore-size        ignore size when deciding whether to download
--only-missing  download only missing files
--only-existing download only files already existing at target
-n, --only-newer    download only newer files (-c won't work)
--no-empty-dirs don't create empty directories (implies --depth-first)
-r, --no-recursion  don't go to subdirectories
--no-symlinks   don't create symbolic links
-p, --no-perms      don't set file permissions
--no-umask      don't apply umask to file modes
-R, --reverse       reverse mirror (put files)
-L, --dereference   download symbolic links as files
-N, --newer-than=SPEC    download only files newer than specified time
--on-change=CMD      execute the command if anything has been changed
--older-than=SPEC    download only files older than specified time
--size-range=RANGE   download only files with size in specified range
-P, --parallel[=N]  download N files in parallel
--use-pget[-n=N]     use pget to transfer every single file
--loop          loop until no changes found
-i RX, --include RX include matching files
-x RX, --exclude RX exclude matching files
-I GP, --include-glob GP include matching files
-X GP, --exclude-glob GP exclude matching files
-v, --verbose[=level]    verbose operation
--log=FILE      write lftp commands being executed to FILE
--script=FILE        write lftp commands to FILE, but don't execute them
--just-print, --dry-run   same as --script=-
--use-cache          use cached directory listings
--Remove-source-files    remove files after transfer (use with caution)
-a             same as --allow-chown --allow-suid --no-umask

   When using -R, the first directory is local and  the  second   is remote.  If the
second directory is omitted, base name of   first directory is used.  If both directories
are  omitted,   current  local  and  remote directories are used.  If target   directory
ends with a slash  (except  root  directory)  then   base name of source directory is
appended.

   RX is an extended regular expression, just like in egrep(1).

   GP is a glob pattern, e.g. `*.zip'.

   Include and exclude options can be specified multiple times.   It  means  that  a file
or directory would be mirrored if it   matches an include and does not match to excludes
after  the   include,  or  does not match anything and the first check is   exclude.
Directories are matched with a slash appended.

   Note that symbolic links are not created when  uploading  to   remote  server, because
ftp protocol cannot do it. To upload   files the links refer to, use `mirror  -RL'
command  (treat   symbolic links as files).

   For  option  --newer-than  you  can either specify a file or   time specification like
that used  by  at(1)  command,  e.g.   `now-7days' or `week ago'. If you specify a file,
then modi-   fication time of that file will be used.

   Verbosity level can be selected using --verbose=level option   or by several -v options,
e.g. -vvv. Levels are:
0 - no output (default)
1 - print actions
2 - +print not deleted file names (when -e is not specified)
3 - +print directory names which are mirrored

   --only-newer    turns   off   file   size   comparison   and   uploads/downloads only
newer files even if size  is  differ-   ent.  By  default  older  files  are transferred
and replace   newer ones.

   You can mirror between  two  servers  if  you  specify  URLs   instead  of  directories.
FXP  is  used  automatically for   transfers between ftp servers, if possible.

   Some ftp servers hide dot-files by default (e.g. .htaccess),   and show them only when
LIST command is used with -a option.   In such case try to use `set ftp:list-options -a'.
Written on May 1st, 2008 , Informative

SirSpanky.com – The Secret Diary of James Pearce Aged 20-Something is proudly powered by WordPress and the Theme Adventure by Eric Schwarz
Entries (RSS) and Comments (RSS).

SirSpanky.com – The Secret Diary of James Pearce Aged 20-Something

Personal jorunal of a professional geek – James Pearce in Perth, Australia