Tuesday, 20 March 2012

Howto Restore from a Time Machine backup on a Drobo-FS

This is what I did. Not everything here may be important, but...

My Starting point:

  • A PowerBook G4.
  • A probably damaged file system (ie. I could not shrink a partition).
  • A recent Time Machine backup to a Time Machine enabled share on a Drobo-FS. This was 'updated' several times as I was cleaning out my file system. This also meant it is huge.
Note: my Drobo-FS share is accessible by 'Everyone'. My other shares require an account. This may be important as I am not sure if you will later be able to connect to this share by using a username and password. So, I would connect to your Drobo-FS and add 'Everyone' with Read/Write access.
  • I removed all partitions on my hard drive - I wanted a clean start.

What I wanted to do was install a tiny OSX partition, restore some of my old accounts, and install linux as well. My aim was to make Linux the main OS.


Howto Restore from a Time Machine backup on a Drobo-FS

  • Boot of install DVD. Mine was OSX Leopard 10.5
  • After first screen to select your language, turn on AirPort (icon in top right hand corner) and joined your home wireless network.
Note: I had trouble using the wired Ethernet port and enabling AirPort seemed to help - On previous attempts to migrate accounts, I found that Apple's installer could not  use my wired Ethernet port!?!
  • From the menu, select Utilities - we need to somehow find and mount your Drobo-FS share containing your Time Machine backup bundle.
  • Select Disk utility.
  • Select File - Open Disk Image. This will not actually work, but it will allow you to mount a Drobo-FS share. You should now see your Drobo-FS under SHARED in a Finder window.
  • Click on your Drobo-FS. Your shares should be listed.
  • Double-click on your Time Machine backup share. Your Drobo-FS backup share should now be mounted and accessibly for restoration.
  • Cancel back to Disk Utility.
  • Here, I created a Partition and gave it the identical name that it had before. In my case it was 'Macintiosh HD'. This may or may not be important.
Note: This is not what I want, but I hope to be able to shrink this later to add other partitions for Linux.
  • Exit Disk Utility.
  • Select Utilities - Restore... (not sure exactly what is is called)
  • From here you should be able to select your Time machine backup share and your hard drive for the restore to proceed.

Currently mine is up to 96%


Postscript

Dear Drobo,

You market these 'simple-to-use' devices and promote Time Machine compatibility - to a degree.

I should not have to go to some third party blog that suggests I run a terminal and type in a command that only geeks would know what it does or means. 

Should I?

This is your support page. - well, that is what I found. Is that the best you can do?

You now need to publish simple-to-use instructions on how to use Drobo's (especially networked ones) in situations where we, your customer's need instructions.

Why? Because your products don't 'just work'!!!

In the case your Drobo-FS product - the one I paid handsomely for on the basis of 'simple-to-use'... you need to publish at least these instructions:

  • Restore a machine from a Time Machine backup on a Drobo-FS share.
  • Migrate accounts at any time or after a fresh install of OS-X.
You need to test these instructions, try them of all supported OSs, you do do this already don't you? So document it so people can do it for themselves.

How can I recommend a Drobo-FS to someone when I had so much trouble restoring!?!

But, if I am the dummy here, please tell me where I went wrong. I have to do this a few more times!




Sunday, 25 September 2011

How many Linux installations are there?

How hard can it be?

I'd like to know how many linux desktops/laptops, servers, phones, tablets and even routers there are.

What if each linux distro included a package that was part of a default desktop or server installation and this package submitted machine data to an online database?

A database already exists that oddly goes by this URL: linuxcounter.net

So, we have a database, we just need automated data to populate it.

We might need some rules:

1. Opt-in
2. Don't use serial numbers

Following these rules, a linux installation could send in these values:

1. CPU type
2. RAM
3. HDD size
4. linux kernel
5. Desktop, Server, Phone, Tablet, Router (based on installation)
6. Install date (of package)
7. Distro identifier

8. Number of user accounts
9. Public or private IP address (not actual IP address, just type)

A key could be generated using data 1 to 7 - things that are unlikely to change too often.


This data could be sent in monthly to either update a database entry, or to create a new one.

Old entries that don't get updated for 1 month get marked as stale.
Stale entries get deleted after 6 months.

A machine that undergoes a significant hardware or software change will automatically get a new entry and it's old entry will go stale and eventually be deleted.

At any time we will have a lower bound on active linux installations - I'd like that.

Thursday, 25 August 2011

Approximate Distance between Two Points

Is there an approximate way to calculate distance between two points?

Normally I would use
   
    D = sqrt( dx^2 + dy^2 ).

But I didn't want to use sqrt().

Note: I have assumed that dx and dy are always positive by using absolute values.

Consider a case where dx >= dy:

After normalizing by dividing dx and dy by dx,

    D' = D / dx = sqrt( 1 + (dy/dx)^2 )

Plotting this from 0 to 1 shows a flat-ish curve. It could be approximated by a straight line or, as I have done, by a quadratic.

    D' = Ax^2 + B

Plugging in two extreme points (0,1) and (1,sqrt(2))

When x=0, D'=1 therefore B=1

And when x=1, D'=sqrt(2) therefore A=sqrt(2) - 1 (about 0.4142)

So, for dx>=dy (and dx!=0)

    D = 0.4142 * dy^2 / dx + dx

And for dx<dy (and dy!=0),

    D = 0.4142 * dx^2 / dy + dy   (dx and dy are swapped)

Average error seems to be less than 1% - good enough for what I want and simple.

By using different 'tuning' points, better accuracy can be achieved

Another approach (using a linear approximation I suspect) can be found here.


Saturday, 18 June 2011

PowerTop - Howto Enable Device Power Management by pressing the P key

Have you ever ran powertop? If not, have a look at these links.



When you run powertop as root (eg. sudo powertop), it might recommend something like this: 
Enable Device Power Management by pressing the P key
 
 
So how do you do this when powertop is not running?
 
This forum made a suggestion that I have attempted to simplify.
find /sys/devices/pci* -path "*power/control" -exec bash -c "echo auto > '{}'" \;

Or you can use this slightly longer one that echo's values before and after it changes.
find /sys/devices/pci* -path "*power/control" -exec \
  bash -c "echo -n '{}' = && cat '{}' && echo auto > '{}' && echo -n '{}' = && cat '{}'" \;

Both have to be run as root or using sudo.
eg.
sudo find /sys/devices/pci* -path "*power/control" -exec bash -c "echo auto > '{}'" \; 
 
Here is my bash script that I run with an extra powertop recommendation that may 
not be applicable in your case.
 
#!/bin/bash

find /sys/devices/pci* -path "*power/control" -exec \
  bash -c "echo -n '{}' = && cat '{}' && echo auto > '{}' && echo -n '{}' = && cat '{}'" \;

F="/sys/module/snd_hda_intel/parameters/power_save"
echo -n $F = && cat $F
echo 1 > $F
echo -n $F = && cat $F
 

Tuesday, 31 May 2011

An idea: a DockBook

A DockBook looks like a laptop or netbook or a portable DVD player or a TV - who knows.

Update 7/9/2011: It has sort-of been done.

It is probably a dumb device: a screen, a keyboard, a battery, USB ports, SSD, ... whatever you like.

On its own, it may do nothing (but it could have some functionality, but this is not the main function).

Where you might expect a trackpad to go, it has a square-ish hole - call it a 'docket'. In this docket you place a sabot that is specific to your phone. This sabot allows your phone to be held neatly and firmly in your DockBook.

A separate sabot could be provided for a second phone battery - again, an open interface.

A DockBook is just a collection of peripherals that allow you to do more with your phone.

Your phone provides CPUs, GPUs, touchscreen, broadband interfaces, WiFi, GPS, accelerometers etc. And your DockBook provides, perhaps, a full-size keyboard, large screen, camera, speakers, mics, power and other interfaces not found on your phone.

A DockBook could simply be a car-dock or an alarm clock. Perhaps a tablet too. The docket might have different forms for different Docks: a flat one for a netbook form or a vertical one for an alarm clock. The sabot might wrap around all of your phone or just its base.

Your phone is a powerful computer and phones will get more powerful. But for some tasks you need a keyboard, mouse, bigger screen, or a holder to keep it in a particular position.

A DockBook sabo provides a charging interface to your particular phone and Bluetooth provides communications to peripherals. Perhaps inductive charging?

While you are working you might get a call - just un-dock your phone and answer the call. Or you could answer it while docked and use a DockBook's microphone and speaker - hands free.

Imagine apps on your phone displaying specific buttons that can be touched making your docked phone a smart, reconfigurable touchpad - a menu system perhaps, or slider control. Perhaps a scrolling list of things to select?

Another DockBook could be a Digital SLR camera: your phone provides GPS, and internet connectivity and your camera dock provides lenses, flash and focus system.

What about a mouse dock? your phone becomes a touchpad for your PC or perhaps your phone's accelerometer can be used just like a mouse? While you are at your PC your phone is charging and enabling applications to work with your phone in a new way.

Imagine a docket that configures your car to your particular preference: temperature, seating position, mirrors and music.

It all needs to be open so companies and individuals can make a Dock for a market or niche use. It should work with any phone - not just an iPhone or an Android phone.

Some other docks: a games console like a wii or a PSP; a printer; braille terminal; a tablet; lego mindstorm robot; synthesizer; printing calculator; desk phone; chess board; ePaper book reader; projector dock; digital radio; car/plane/train seat dock;

Saturday, 9 April 2011

Howto use nfs to access files on a Drobo-FS - UPDATED

This should work for Linux clients and OS-X.

Notes

1. I am going to assume that, if you want to use nfs on your Drobo-FS then you know what you are doing and I can be brief.

2. drobo-fs is the dns name of your Drobo-FS or use it's IP address. In OS-X, I use drobo-fs.local

Steps

2. If Linux, make a mount point

sudo mkdir /mnt/drobo

3. If Linux, add this to your /etc/fstab file - UPDATED

drobo-fs.local:/mnt/DroboFS/Shares/Public  /mnt/drobo  nfs  rw,soft,proto=tcp  0  0

3.1 Install nfs-common package


If Linux

sudo apt-get install nfs-common



4. Mount the nfs directory on your client

If Linux

sudo mount /mnt/drobo

If OS-X

mount -w -t nfs drobo-fs.local:/mnt/DroboFS/Shares/Public /mnt/drobo

Thanks to http://obasandbox.wordpress.com/tag/drobofs/
or in Finder

Connect to server nfs://drobo-fs.local:/mnt/DroboFS/Shares/Public

Test

In Linux, browse to /mnt/drobo and you should see the files in your Public share.

In OS-X, open the drobo-fs.local share.


Tuesday, 8 March 2011

Howto Get Long Battery Life on a Nexus One

In case this is copied, go to the original site which should be http://philatwarrimoo.blogspot.com/2011/03/howto-get-long-battery-life-on-nexus.html

I would use my phone a lot (music, hotspot, not phone calls) and only get 15 - 18 hours from a fully charged battery.

I had read that some people got between 1 day and 1.5 days.

So, what is the upper limit? If you leave you phone in one spot and hardly touch it, how long will it run for?

The specs say 250/290 hours for 3G/2G.

To get this I assume you would need great signal levels, and virtually nothing running on the phone - in fact the phone would be the factory default.

But what could I get? I don't get great coverage at my place, especially inside where the signal is shielded by metal fly-screens, foil insulation, steel roof and two layers of brick - it is almost a Faraday cage.

I defaulted the phone. I didn't clear my SD card because I didn't want to.

I did make a few changes: I kept some applications that I do use often, and I disabled Picasa sync because I am in the middle of uploading lots of photos and that would distort the tests.


The big power consumers are believed by some to be the display, radio, GPS, WiFiBluetooth, and sync.


I have found that the main ones are the display and the radio (2G/3G).


In Australia the carriers all have GSM as well as either UMTS or HSDPA. My carrier only seems to have GSM and UMTS.


I decided to test what radio setting uses less energy. My options are GSM Auto (PRL), WCDMA Preferred, WCDMA Only and WiFi (for when I am at home). I don't want GSM only so I am not going to test that. I won't test Automatic either because I have no idea what it actually does.


  • GSM Auto (PRL) I believe prefers GSM rather than WCDMA, but it will switch to WCDMA if the signal is strong enough.
  • WCDMA Preferred is the opposite.
  • WCDMA Only is what it is.


When WiFi is on, I believe the 2G/3G radio switches off, so only the WiFi radio is on.


GPS will be left on (as per the default), as will sync, the default live wallpaper, widgets etc.

As I said earlier, Picasa sync will be off.


The Applications installed are:

4trak (since uninstalled)
adobe flash (since uninstalled)
anycutastrogoogle earth (since uninstalled)
espeakfunction express (since uninstalled)
gmailgoggleshotspot widgetlistenmapsmarketplugin launcher (i added this last night - since uninstalled)
realcalcringdroid (since uninstalled)
spareparts (since uninstalled)
terminal emulator (since uninstalled)wifi analyser (since uninstalled)

And this is what generally runs:

settingsgoogle servicesmapsgmail (regularly on and off)android keyboardandroid live wallpaper

The following Widgets are part of the default setup:

google searchpower controlyoutubeweather and newsmarket

I checked once and found the 107 MB used and 244 MB free.

I generally did not reboot between tests - perhaps I should have.

I ran the tests for different periods and only long enough to get a feeling for how long it would run for. 


The phone was always in the same place and was only moved to check how it was going. Usually I checked a few times for just a few seconds.

Test Results

WiFi On: 4.25 hours, 82% remaining. I'd expect it to go for 24 hours.

From the graph you can see that something changed for about 30 minutes that consumed a lot of energy (about 10%). This has resulted in the poor expected battery life.

The graph also shows the screen being turned on a few time and once for about 15 minutes - I don't recall doing this!


When the screen turns off or the phone sleeps, WiFi still runs for up to 15 minutes.


WiFi wakes up when the radio signal drops or changes.

I should re-do this test.


GSM Only (PRL): 9.2 hours, 90% remaining. I'd expect it to go for 92 hours.

Battery drain was fairly constant and seemed to increase when coverage was poorer (at the beginning and end of the test period).


The screen was also on for 20 minutes at the start of the test - I am sure that this did not happen.




WCDMA Only: 3.2 hours, 91% remaining. I'd expect it to go for 36 hours.

Again something happened for about 40 minutes causing a drain of about 5% of the battery.




WCDMA Preferred: 2.25 hours, 92% remaining. I'd expect it to go for 28 hours.


The phone seems to wake up when there is poor or changing signal.



The observation to make is that there is a big difference in the expected battery life depending on which radio setting you choose. For me, GSM Only (PRL) would provide the longest battery life at home, and probably where the 3G signal is poor.

WiFi was the poorest, but at home it will generally be on the dock and charging.

For those that have good 3G coverage, the WCDMA Only option will probably serve you well.


Custom Test

I then decided to turn off the widgets, use a black live wallpaper that I made a while ago, select GSM Auto (PRL) and turn WiFi on.

WiFi On, GSM Auto (PRL), most widgets off, black live wallpaper: 4.3 hours, 92% remaining. I'd expect it to go for 54 hours.

Only the Power Control widget was running.

Wifi seems to stay on for about 15 minutes then sleeps. It wakes up when you turn the screen on.

The WiFi Sleep Policy is Never when plugged in so this means that it will sleep if it is not plugged in.



WiFi Power Hungry Bug

Some have reported that WiFi on anything but the default sleep policy setting causes Android OS to run at high levels. Normally it sits at 2%-ish, but when the fault occurs it runs at 40%, 50% and even higher - usually higher than the display.

Some get relief using the WiFi sleep policy: 'Never', and others find this to be the cause. By this I suspect they mean that if the setting is changed from the default (to 'Never', for example) something bad happens when you switch back to the default setting. This is my experience.

In one of my tests I used the WiFi sleep policy: 'When screen turns off' and Android OS sky-rocketed. I recommend you keep the default (Never when plugged in) until this is fixed.


Summary

1. When WiFi turns on, it stays on for 15 minutes.
2. For me, GSM Auto (PRL) is better than WCDMA Preferred or WCDMA Only.
3, The graph seems to show the screen on when it isn't.
4. The phone seems to wake up on signal strength change, or this could be base station changes.
5. If WiFi is asleep and the radio looses signal, WiFi will wake up.
6. The default Nexus One setup with all the widgets and live wallpaper seems gentle on the battery.

Update


I have used my phone with minimal apps installed, my special black wallpaper and very few gadgets. I have been getting at least 12 hours of use before the battery reaches 50%, so this is about 1 day.


I'll try to keep some records from now on to quantify this.


Thursday, 3 March 2011

Android Easter Egg

In case this is copied, go to the original site which should be http://philatwarrimoo.blogspot.com/2011/03/android-easter-egg.html

Goto Settings - About Phone
Scroll down to Android version
Tap quickly several times on 'Android version' and some art will appear.
'Zombie Art by Jack Larson'

Wednesday, 2 March 2011

Hey Google! I want a Google Ark!

In case this is copied, go to the original site which should be http://philatwarrimoo.blogspot.com/2011/03/hey-google-i-want-google-ark.html
An appliance running Android or Chrome OS that I buy and plug-in to my network that makes a copy of any data I want to duplicate from the cloud:

email, contact, docs, pictures, movies, bookmarks, blogs, waves... you get the idea.

It might have 2 solid-state hard drives so I can mirror them and, at some later point in time, I can replace one with a bigger one and then the other to grow my local cache.

It could also operate as a web/DNS cache for all computers, phones and Chrome OS googleBooks - why get it from the web if I got it yesterday or last year?

It could come in various sizes for homes, hoarders, small and large businesses.

It supports apps too so that anyone can develop for it, especially other cloud backup apps. Perhaps a Cannon camera photo management app, or a Digital Ink notepad app. What about a Wordpress backup app or a local bazaar repository. Maybe a Windows system backup app or a Time Machine folder.

It would be very low power and quickly go to sleep when not in use.

It might have a place for hardware apps (via USB perhaps) so that I could plug-in a LTE Femto cell, web printer, or a weather station.

If you lost my email, you could recover it.

If I dropped my laptop I could restore it from the Ark.

Monday, 28 February 2011

Howto Sting Android Nexus One Droid Gingerbread

In case this is copied, go to the original site which should be http://philatwarrimoo.blogspot.com/2011/02/howto-sting-android-nexus-one-droid.html

Recently a blog of mine was copied and added to another site. I assume it was by a robot so I want to see if this gets copied as well.

I have added the important bait words such as:

1. Howto
2. Android
3. Nexus One
4. Droid
5. Gingerbread

But this time I have added a link on the top to this blog to see how many people get here from there.

An image to begin with...



So far, the tally is obviously zero since I am just writing it and it has not been saved or published - really I am just filling the space to make it look big enough for the bot to grab - assuming that it has some size range that it is interested in.

Another unrelated image:



An a link to the site - they might appreciate it.

http://www.premium-joomlathemes.com/jd-droid-drupal-template-drupal-hotel-theme-for-lodging-accommodation-with-t3-framework.html

Now for some real nonsense:

This nonsense comes from a pseudo text generator called Lorem Ipsum.

You can find more details here: http://www.lipsum.com/

Please note: I have copied text from another site and provided a link to it with thanks. Some could learn from this example - not that it is a very good example.

A sample nonsense would help:

The standard Lorem Ipsum passage, used since the 1500s

"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC

"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"