2009-08-28

VirtualBox: Boot from a USB Drive (stick or disk) !!

I found this and it saved my day!

Boot your USB Drive in VirtualBox
http://agnipulse.com/2009/07/boot-your-usb-drive-in-virtualbox/

mac os x 10.6: boot from usb

I always like to play around and I hate CDs etc. That's the reason I took an .iso of the dvd and restored it onto a usb diskdrive and restarted the computer while holding down alt(option) key and selected that usb disk.

everything is fine. mac os is now even better than before and the price is more than right. The best feature is the dock and gallery view with scrolling and folder traversing.

BTW: The .iso must be on a mac formated disk, mounted (by double clicking) and then using the disk utility can be restored to the usb disk. But you'll have to drag the mounted iso to source and select the usb disk. somehow I always forget to do that and it takes a few minutes until I realize I need to do it this way.

Have fun.

Unix Bash: test if file or directory exists

test -e test.txt


test -d dir




if [ -d dir ]



       -a file
              True if file exists.
       -b file
              True if file exists and is a block special file.
       -c file
              True if file exists and is a character special file.
       -d file
              True if file exists and
is a directory.
       -e file
              True if file exists.
       -f file
              True if file exists and is a regular file.









       -g file
              True if file exists and is set-group-id.

Unix Bash: replace trailing / from string

a="dir/"

echo ${a%*/}

replace within string

a="awordb"

echo ${a//word/dog}

Unix: find: I always forget how to remove things with find

find . -name "-F" -exec rm {} \;

Unix Bash: find yesterday

date -d '1 day ago' +'%Y/%m/%d'

2009-08-27

outlook sync with google calendar and then import into iphone

Getting started with Google Calendar SyncPrint OverviewIntroductionGet StartedSync OptionsCopyright NoticesTroubleshooting
To set up Google Calendar Sync:
1.Make sure you're using a supported operating system and Outlook version.
2.Download Google Calendar Sync (version 0.9.3.5) at http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe
3.Once a dialog box appears, click Save File. The downloaded file should open automatically. If it doesn't, manually open it from your browser's download window.
4.Click OK to confirm that you're aware this is an executable file.
5.Read through the Google Calendar Sync Terms of Service, and click I Agree.
6.Follow through the Installation Options and click Install to finish the set-up process.
Once Google Calendar Sync is installed on your computer, the Google Calendar Sync Settings window will appear:




Google Sync: Set Up Your iPhone or iPod TouchPrint
To set up Google Sync on your iPhone or iPod Touch device, please follow the steps below for the OS version that you're running.

OS Version 2.2.x


Requirements and Upload1. Make sure your device has firmware version 2.2 or 2.2.1. You can check your current version by going to Settings > General > About > Version. Google Sync won't work on earlier versions of the firmware.
To upgrade, follow the instructions at http://www.apple.com/iphone/softwareupdate/. If your iPhone or iPod has firmware version 3.0, it's important that you follow different setup instructions.

2. Upload any Contacts and Calendars from your phone to your computer before proceeding. The iPhone will delete Contacts and Calendars during setup.
Learn how to upload your Contacts with iTunes: Instructions for PC - Instructions for Mac

3. The contacts that are replaced on your device will be the contents of your My Contacts group. This is the only group supported at this time, so make sure to clean up your My Contacts before syncing.
Tip: If you have a Mac, make sure that Synchronize with Google in the Address Book app is OFF. Otherwise all of your contacts will sync to Address Book.

Note: Mail sync is not yet supported. You may receive error messages if you attempt to turn on Sync for Mail. Getting Started1. Open the Settings application on your device's home screen.
2. Open Mail, Contacts, Calendars.
3. Tap Add Account....
4. Select Microsoft Exchange.


     Enter Account Info5. In the Email field, enter your full Google Account email address. If you use an @googlemail.com address, you may see an "Unable to verify certificate" warning when you proceed to the next step.
6. Leave the Domain field blank.
7. Enter your full Google Account email address as the Username.
8. Enter your Google Account password as the Password.
9. Tap Next at the top of your screen.
10. A new Server field will appear. Enter m.google.com.
11. Press Next at the top of your screen again.


  

12. Select the Google services you want to sync. Currently only Contacts and Calendar are supported.
 Make sure that you have uploaded your data before proceeding.

13. Press Sync twice when warned about data loss.

    

You've set up Google Sync for your iPhone. Synchronization will begin automatically if you have Push enabled on your phone. You can also open the Calendar or Contacts app and wait a few seconds to start a sync.

Next, learn how to choose which calendars to sync, if you'd like to enable multiple calenders.

Tip: If your business, school, or organization uses Google Apps, your administrator will first need to enable Google Sync before you can take advantage of this feature.

OS Version 3.0


Requirements and Upload
1. Make sure your device has version 3.0 firmware or above. You can check your current version by going to Settings > General > About > Version. To upgrade, follow the instructions at http://www.apple.com/iphone/softwareupdate/.

2. Perform a sync with iTunes to ensure that Contacts and Calendars from your iPhone are backed up to your computer.

Note: Mail sync is not yet supported. You may receive error messages if you attempt to turn on Sync for Mail.


Getting Started
1. Open the Settings application on your device's home screen.
2. Open Mail, Contacts, Calendars.
3. Tap Add Account....
4. Select Microsoft Exchange.

    
Enter Account Info
5. In the Email field, enter your full Google Account email address. If you use an @googlemail.com address, you may see an "Unable to verify certificate" warning when you proceed to the next step.
6. Leave the Domain field blank.
7. Enter your full Google Account email address as the Username.
8. Enter your Google Account password as the Password.
9. Tap Next at the top of your screen.
9a. Choose Accept if the Unable to Verify Certificate dialog appears.
10. A new Server field will appear. Enter m.google.com.
11. Press Next at the top of your screen again.

  

12. Select the Google services you want to sync. Currently only Contacts and Calendar are supported.

13. Unless you want to delete all the existing Contacts and Calendars on your phone, select the Keep on my iPhone option when prompted. This will also allow you to keep syncing with your computer via iTunes.

    

You've set up Google Sync for your iPhone. Synchronization will begin automatically if you have Push enabled on your phone. You can also open the Calendar or Contacts app and wait a few seconds to start a sync.

Next learn how to choose which calendars to sync, if you'd like to enable multiple calenders.

Tip: If your business, school, or organization uses Google Apps, your administrator will first need to enable Google Sync before you can take advantage of this feature.

mac os x - apache2 - webpages

look at

http://www.devarticles.com/c/a/Apache/Using-Apache-and-PHP-on-Mac-OS-X/


o start Apache Web Server, you must go into the “System Preferences Control panel located on the “Apple Menu”.
 
Click on the Icon labeled "Sharing". Then locate the tab labeled  "File & Web". You will want to click the button labeled “Start” in the  "Web Sharing " section. This starts up Web sharing which starts the Apache Web Server.

Apache Web Server is now running. Easy, huh? "How can I tell?” you ask. Simple. Start up your web browser of choice. In the web address or URL part of your browser, type: "localhost" (without the double-quotes)

Ex. 
http://localhost

If everything is Okay, your browser will display the following:

"If you can see this, it means that the installation of the Apache Web server software on this system was successful. You may now add content to this directory and replace this page."
 
It worked! Hooray.
 
To access the pages of this directory, double-click on your hard drive and locate the "Library" directory. From there locate the "WebServer" directory and then the "Documents" directory where these web pages reside.
 
Note: If its not running, you either do not have web sharing enabled or   something is wrong with Apache's files. It should work right out of the box.

Since Mac OS X is a multi-user system, every person has their own account and with that brings it’s own set of web pages. To access your personal web pages you must type the following in the browser address:
 
Ex. 
http://localhost/~yourname/
To access your personal web pages, locate your account name directory under   "Users" And locate the directory labeled "Sites".

/Users/yourname/Sites/your web pages are here <---
  

still looking for the best daily log software and what private folders on mac os x

Where are good descriptions for what comes with 10.5.

what is the private folder ?

How to update apache on mac os x?

Excel remove text from the beginning =replace(a1,1,4,"")

Remove the first 4 characters from a string:

1,6,00:00:00:00:00:00

result is

00:00:00:00:00:00

excel is bad - trailing characters is worse

I had to copy some text from a table in IE to Excel and then use a concatenate() formula.

But the result contained always a trailing space or so it seamed.

But =trim() or =clean() did not remove it.

Thanks to the online help, I found the following which solved my problem:

=TRIM(SUBSTITUTE(A4,CHAR(160),CHAR(32)))

apache 2 - beautify directory listings

After a long time I found out:

mod_autoindex is responsible for the generation:

I had to put in the following:

IndexOptions FancyIndexing HTMLTable VersionSort FoldersFirst NameWidth=* SuppressDescription

- Most importantly for me was the NameWidth=*, i.e. automatically size it to the longest name and FoldersFirst so it's like explorer.


IndexStyleSheet "/css/style.css"

- With this I was able to put in a stylesheet and change the font and background

IndexIgnore P*_files components.swf loadflash.js

- This helped to get rid of some files from displaying

2009-08-25

wdtv: making it a wireless streamer

Blogged with the Flock Browser
http://wiki.wdtv.org/doku.php

Get a Mac Apple TV Ad - Top of the Line

Mr. Big!

Link to the apple videos on apple.com

http://www.apple.com/getamac/ads/

Convert vmware machine to virtualbox 3.x

Today I found a nice vmware appliance that was only available as a vmware image. But I dissed vmware server and workstation a long time ago (except fusion) and try to make use of virtualbox.

But virtualbox lacks a lot of things but this is how I was able to move that appliance to virtualbox:

1) the appliance came with the following files:

.nvram
.vmdk
.vmsd
.vmx
.vmxf

2) I started virtualbox and imported the .vmdk

This is really great: Virtualbox can handle .vmdk natively!

3) I opened the .vmx in an editor (for me that means vim) and extracted:

scsi0.virtualDev = "lsilogic"
guestOS = "other26xlinux"
memsize = "512"

4) I created (wizard) a new virtualbox machine using:

Linux, Linux 2.6
512MB ram
use existing harddisk, that's where I choose the disk that I imported in step 2

5) Just for fun I started the machine without changing any settings (like SCSI etc.)

I left all the other settings at default and started the machine, but it crashed:

unkown interrupt or fault at EIP 000000060 c0100295 00000294

and that messages appeared endlessly.

I could not see the previous messages besides uncompressing linux ..... it was too fast.

6) I stopped the machine using HOST+Q then select stop

7) Ok now here come the changes that I should have done before, but I list them here in separate steps.

7.1 Under System -> Processor: check -> Enable PAE/NX


This fixed the unknown interrupt message thing (but the machine would still reboot after the inital steps)

7.2 Under Hard Disks -> Enable Additional Controller->SCSI(Lsilogic)
7.3 and change the attachments-> Slot -> to SCSI Port 0

Now I was able to boot and the system started nicely. But no network!!!

8) vmxnet: Device in slot 0000:00:03.0 is not supported by this driver.
vmxnet: probe of 0000:00:03.0 failed with error -16

Now I immediately new that was bad news and I had to try to get this machine to accept the new network adapter.

The default adapter that virtualbox 3.04 on my machine at least:
PCnet-FAST III (NAT)

I read on a webpage that Intel PRO/1000 MT Desktop would be a better choice.

So I changed it to Network ->Adapter 1-> Adapter Type: Intel PRO/1000 MT Desktop (8254OEM), NAT was ok for me.

9) Still no networking, eth0: error fetching interface information: Device not found

Ok, now I did not really now what kind of distribution it was and I needed to have a look at the network config etc.

9.1) I saw that it was Grub but it looks like it has a timeout=0, because it only displayed the menu very very quickly.

I have not found out how to stop Grub from continuing. Even after 10 times of Host+R

Hitting escape as it was said here did not work:

Occasionally, GRUB requires some simple intervention. Perhaps a new kernel isn’t working correctly with your system or maybe you want to bring the system into a different runlevel than the default. Hit the ESCAPE key to interrupt the GRUB countdown and bring up GRUB’s main menu.

Maybe someone knows how to stop that thing.

9.2) Ok to access the files I used ubuntu-9.04-desktop live iso cd which I added to virtualbox library and then under CD/DVD-ROM -> mount -> iso image file -> ubuntu-9.04-desktop-i386.iso

9.3) I quickly checked the boot order under System->Motherboard->Boot Order and noticed that the default is Floppy-CD/DVD-ROM-HardDisk-Network. That was fine.

10) Live ISO cd running and with ubuntu I just clicked on Places->Home Folder and selected the 4GB Disk it listed. This mounted the hard disk as /media/disk read/write and I did not even have to search for which disk and what parameters to use mount with

11) Using the terminal I checked if there is a configuration like on red hat or on debian but it was not!

12) In /etc/modprobe.conf I found the following statement:

alias eth0 vmxnet

this I changed into

alias eth0 e1000

13) I also changed /boot/grub/menu.lst  timeout=30 just so I can enter single user mode

But on that machine I could not just add Single at the end of kernel but had to use init=/bin/bash



Finally, the vmware appliance ran on virtualbox!!!

Linux - what to do if single user mode does not work

I just been through the problem, where I desperately needed root access to a system and could not boot into single user mode.

It uses grub, but the timeout=0, I was able to mount the harddisk and edit the menu.lst under /boot/grub/menu.lst to timeout=30.

Also I added a second entry and put the word "single" behind the kernel line:

kernel /boot/bzImage rw root=/dev/sda1 Single

but when I booted into the system it just booted into Runlevel 3 as usual.

What I had to do is to add init=/bin/bash to that line and then I was accessing the system again.

Update:

You should run:

sync
reboot

but reboot failed!!

there was a message  init: timeout opening/writing control channel /dev/initctl

I had to run reboot -f !!