Archive for November, 2007

OpenSolaris Gets In-Kernel CIFS Server

November 11th 2007

Exporting a ZFS filesystem via NFS is easy, you just use the command

zfs set sharesmb=on POOLNAME/FSNAME

In order to share via CIFS (sometimes called SMB) to windows clients, you used to have to use Samba. This is not a problem for simple setups that dont use Active Directory, but can be a pain if you do as the ACL model in Windows is completely different to Unix (One of the few areas Windows is better in my opinion). Samba get around this by adding hooking up to OpenLDAP, adding a VFS layer (pdf) and reimplementing Kerboros/LDAP to match the Microsoft version, all of which are far from trivial to set up. I love Samba and think it is one of the best pieces of free software there is.

Sun have just released a CIFS implementation in the SunOS kernel, based on a stack that they got when they bought Procom. As well as serving up files via CIFS, they have modified the ACL system to be a sort of hybrid or old style Posix and Windows style ones. I think they have been planning this for a while as NFSv4 ACLs are similar to NTFS ones but still map on to Posix style eventually. So the end result is you will be able to write

zfs set sharecifs=on POOLNAME/FSNAME

and have the filesystem exported. The fact that it is in-kernel and integrated with ZFS is cool, but this on-disk storing of the ACL information is the best feature. Check out Mike Shapiro and Alan Wright’s blogs on the topic, the full spec and the project page for more details.

That is not to say Samba is useless, I was very excited by the examples here, particularly the patch to implement shadow copies using ZFS, but maybe people will move away from it in favour of a more tightly integrated in-kernel implementation. The CIFS client in Linux is now in-kernel (still written by the Samba guys though) as it is in SunOS and Darwin (Sun ported the Darwin version). Untill NFSv4, Samba was definitely the best way to share files between Unixes, due to some nifty Posix Extensions and the throughput from the efficient implementation (beating in-kernel NFS from Linux in my testing, it may still be the best way). Samba beats Windows servers for throughput and number of clients served, the SMBTorture suite they developed even got mentioned (search for Evil Empire) by a Microsoft guy as they now use it to test their implementation.

When I get it on my NAS, I’ll post benchmarks.

Posted by tom under Samba & ZFS & OpenSolaris | No Comments »

Bittorrent In Linux

November 9th 2007

Azureus is crap in Linux.

That is to say neither the Ubuntu package or the download from the webpage worked for me straight away.

Deluge on the other hand is working a treat though. It’s written for Gnome in C++ and Python so I may be able to get my head around the code too.

Now I can continue downloading more stuff than there is hours in the day to watch it.

Posted by tom under linux & Ubuntu | No Comments »

Top N Firefox Plugins

November 9th 2007

I suppose once you begin blogging it’s only a matter of time till you start posting lists of your favourite things, usually Firefox extensions. Here are my top N.

  1. Tab Mix Plus
  2. Disable .xpi install delay
  3. Mouse Gestures
  4. FireFTP
  5. Customisegoogle
  6. Adblock Plus
  7. Google Notebook
  8. Greasemonkey
  9. Gmail Manager
  10. del.icio.us complete
  11. Tab Catalogue
  12. Download them all
  13. PDF Download
  14. Add Bookmark Here

That should save me some time next time I reinstall my PC or end up using someone else’s.

Posted by tom under tips | 1 Comment »

Started My Pension

November 8th 2007

Pensions; Not exciting to most people, but you ignore them at your peril.

I started mine this week as my work offered to match my contributions up to 3%of my salary. I was holding off untill I was out of debt, but their contribution means its daft not to start now. Lets say you want £100 in your pot each month, you need to find £50 if your employer matches your contribution. If you put in £39 then the government put in £11 in tax relief (if you pay 22% income tax), ie your contribution is multiplied by 2.5 for free! I asked the chap who administers it for us and there is only a 50% uptake, this is crazy (I accept some people may not be in the UK when they retire)

For those of us who are ambitious, lumping into ISAs until we hit the top rate of tax then transfering to a pension is the optimal way to invest (once you are out of debt, possibly ignoring your mortgage)

Some bits of advice (not rocket science, everyone should know this):

  • Get out of debt! Pay off loans and cards, don’t get new ones. Money Saving Expert will help.
  • Let compound interest work for you, and start early. If your money grows at 8%, it will double every 9 years (5 doublings, in 45 years). At 10%, it will double about every 7 (6 doublings in 42 years). See double calculator. So 2% more growth per year leaves you with twice as much money at the end! I know this does not account for inflation, but we could just change it to 8% real (ie with inflation subtracted) growth. See Fidelity’s Calculator for a more realistic picture of your retirement pot.
  • Buy funds, not individual stocks. All the news you have is old, forget trying to beat the traders who punt by the nanosecond - you cannot win (its not clear they really do, read A Random Walk Down Wall Street )
  • Don’t be too risk averse, look at Malkiel’s sleeping scale (percentages are expected returns):
    • Bank accounts: Semi-comatose, 2 to 3 percent. No risk. Does not keep up with inflation.
    • Money markets and cash deposits: Long afternoon naps, 3 to 5 percent. No risk. Will keep up with inflation.
    • Corporate bonds: An occasional dream, 8 to 8.5 percent. Small risk if held to maturity. Inflation safe.
    • Blue chip stock: Some tossing and turning, 9 percent. Moderate to great risk, depending on holding time.
    • Aggressive growth stocks: Nightmares but long term rest, 9 to 12 percent. Substantial risk, but good inflation hedge.
    • Real estate: Vivid dreams, Same as common stocks.
    • Gold and other Commodities: Insomnia, Cannot predict return
  • Stay in for the long haul: The UK stock market has grown at 11% per annum on average over the last 100 years, beating inflation and bonds, even with the great depression, black Wednesday and the dot-com bubble thrown in. Over 20 years, stocks beat cash 98% of the time. See Motley Fool for a nice graph and more advice on investing. Look at these (US) ranges in average returns for common stocks over the last 50 years.
    • One Year 52.6 to -26.5 %
    • Five Years 23.9 to -2.4 %
    • Ten Years 17.6 to 1.2 %
    • Fifteen Years 16.8 to 4.3 %
    • Twenty Years 14.6 to 6.5 %
    • Twenty Five Years 11.2 to 7.9 %

    See how the volatility dies down over time.

I want to retire early and lead a nice life, starting now is all I need to do.

Posted by tom under investing & Economics | 1 Comment »

Bluff as an adjective

November 6th 2007

Someone in work called me bluff today, I did not know it was an adjective. Here is the definition, do you think it is apt?

good-naturedly direct, blunt, or frank; heartily outspoken:
eg: a big, bluff, generous man.

Posted by tom under Language | No Comments »

The Ode Less Travelled

November 5th 2007

I was in Borders the other day, killing time before the Yorkshire and Humber Python User Group’s first meeting, and I picked up Stephen Fry’s “The Ode Less Travelled”. If you don’t know it, it is a guide to poetry with exercises to encourage you to write your own (don’t worry, none of mine will end up here). The main reason I picked it up was that I have read all of his other books and there was a “buy one get one half price” offer and I had already selected John Le Carre’s newest and that was part of the deal.

I knew I would like it when I got to this line in the introduction:

“Only an embarrassed adolescent or deranged coward thinks jargon and reserved languages are pretentious and that detail and structure are boring”

It is not pretension to use a special vocabulary to distinguish concepts and allow you to talk more precisely about things. Listen to fisherman, farmers, sports fans of any flavour or any interest group really and they have their own special language. That said there are plenty of pretentious folk about too.

Here’s to detail and structure.

Posted by tom under books | No Comments »

Why I love ZFS

November 4th 2007

No silent data corruption because of a checksum on each block, copy on write means no fsck EVER (it does not even have one), no RAID5 write hole, add disks to the pool on the fly, put volumes there as well as filesystems and export them via iSCSI or NFS, quotas, compression and it is easy to use. Check it out here, or watch this video

It is so easy to use, here is my command line session when adding 4 disks to my array. Took me perhaps 5 minutes and its worth noting that there was no pause between issuing each command as its all pretty much instant. I had to import the pool at the beginning as I had just installed OpenSolaris developer edition to see if it was any better than Nexenta (it was not). The spacing of the output is a little off, but hopefully its still understandable.

# zfs list
no datasets available
# zpool import Toms
cannot import ‘Toms’: pool may be in use from other system
use ‘-f’ to import anyway
# zpool import -f Toms
# zfs list

NAME USED AVAIL REFER MOUNTPOINT
Toms 1.33T 9.84G 40.4K none
Toms/500G 723G 9.84G 723G /share/500G
Toms/Notes 25.9G 9.84G 25.9G /share/Notes
Toms/files 25.6G 9.84G 25.6G /share/files
Toms/share 532G 9.84G 46.4K /share
Toms/share/SetupFiles 72.2G 9.84G 72.2G /share/SetupFiles
Toms/share/TalkingBooks 139G 9.84G 139G /share/TalkingBooks
Toms/share/Tunes 57.5G 9.84G 57.5G /share/Tunes
Toms/share/Videos 263G 9.84G 263G /share/Videos
Toms/share/apps 159M 9.84G 159M /share/apps
Toms/share/downloads 26.9K 9.84G 26.9K /share/downloads
Toms/xbox 50.7G 9.84G 50.7G /share/xbox
# zpool status
pool: Toms
state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using ‘zpool upgrade’. Once this is done, the
pool will no longer be accessible on older software versions.
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
Toms ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c2t3d0 ONLINE 0 0 0
c2t0d0 ONLINE 0 0 0
c2t2d0 ONLINE 0 0 0
c2t1d0 ONLINE 0 0 0

errors: No known data errors

# zpool add Toms raidz c2t4d0 c2t5d0 c2t6d0 c2t7d0
invalid vdev specification
use ‘-f’ to override the following errors:
/dev/dsk/c2t4d0s0 is part of exported or potentially active ZFS pool
mypool. Please see zpool(1M).
# zpool add -f Toms raidz c2t4d0 c2t5d0 c2t6d0 c2t7d0
# zpool status

pool: Toms
state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using ‘zpool upgrade’. Once this is done, the
pool will no longer be accessible on older software versions.
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
Toms ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c2t3d0 ONLINE 0 0 0
c2t0d0 ONLINE 0 0 0
c2t2d0 ONLINE 0 0 0
c2t1d0 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c2t4d0 ONLINE 0 0 0
c2t5d0 ONLINE 0 0 0
c2t6d0 ONLINE 0 0 0
c2t7d0 ONLINE 0 0 0

errors: No known data errors
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
Toms 1.33T 888G 40.4K none
Toms/500G 723G 888G 723G /share/500G
Toms/Notes 25.9G 888G 25.9G /share/Notes
Toms/files 25.6G 888G 25.6G /share/files
Toms/share 532G 888G 46.4K /share
Toms/share/SetupFiles 72.2G 888G 72.2G /share/SetupFiles
Toms/share/TalkingBooks 139G 888G 139G /share/TalkingBooks
Toms/share/Tunes 57.5G 888G 57.5G /share/Tunes
Toms/share/Videos 263G 888G 263G /share/Videos
Toms/share/apps 159M 888G 159M /share/apps
Toms/share/downloads 26.9K 888G 26.9K /share/downloads
Toms/xbox 50.7G 888G 50.7G /share/xbox
# zpool upgrade Toms
This system is currently running ZFS pool version 8.

Successfully upgraded ‘Toms’ from version 7 to version 8

Posted by tom under Nexenta & ZFS & OpenSolaris | No Comments »

How to get a solaris kernel and GNU userland

November 3rd 2007

I love the SunOS kernel. ZFS, Dtrace, Zones all make it desirable. But OpenSolaris is a code repository, not a distribution and you have to go elsewhere if you want a free distro. Nexenta looked the most promising, but then went quiet for a while (at least on their webpage) after shifting their focus to a smaller package set they called Nexenta Core Platform. I was very pleased to see an offer of collaboration from the Debian project leader in their forums and now Nexenta.com has released a new NAS package (not free though) and at the same time Suns “Project Nevada” seems to be bearing fruit after hiring Ian Murdock (the chap who started Debian)

OpenSolaris Developer/Community editions pale in comparision to Ubuntu for range of packages and usability, perhaps Nevada can sort it out. I am hopeful that Nexenta get it together and be the GNU/Solaris distro I really want (see here for some screencasts by Martin Man showing how cool it already is).

Posted by tom under Nexenta & ZFS & Ubuntu & OpenSolaris | No Comments »

Mind Bending Stuff

November 1st 2007

I am just getting my head around this (pdf) comment on the problem at the last ICFP Programming Contest , anyone who likes puzzles, compilers and reverse engineering should take a look, I am amazed by how rich this problem was. The ICFP do not specify what counts as “functional”, but OCaml and Haskell usually do very well in the contest. This year a C++ team won it and a perl team came second, after lots of teams abandoned their functional languages. The authors make the point that data structure design/choice is very important (which we all should know I suppose), they recommend Data.sequence in Haskel and I think it is similar to a Rope (sort of tree based string representation that makes concatenation a snip, wikipedia is weak on it but Ruby Quiz mentioned it a few weeks ago)

Posted by tom under ComSci & FP & OCaml & haskell | No Comments »

« Prev