March 11, 2010

When ZFS runs out of space

I'm one of the hopefully not so few people anymore who proudly run ZFS on their servers. I even discovered the value of regular snapshots I'm doing with freebsd-snapshot. A good thing to save you from some of your accidental rm commands and evil destructive updates.

But there are also some issues to the whole snapshot story. Once you run out of space on a pool things can get a bit more complicated with all that snapshots around. There are two defining points to understand in such a situation:

  • Data in a pool can only be freed if it's not referenced any more by any snapshot, clone or data set
  • Snapshots are read-only
Thus, cleaning up space by removing files only helps if they are not referenced by a snapshot. But that's likely not the case if you are making multiple snapshots per day. And removing parts of a snapshot is not possible, you can only destroy the snapshot as a whole. So this comes down to painfully searching snapshots and files you don't need anymore and delete them manually. Alternatively you could convert snapshots into clones, which are again writable, and delete single files from them. But I don't think this is a very clean way, and it would surely break you snapshot cycle, leaving you with a bunch of clones you would have to cleanup later.

So, isn't there any better solution? Well, I currently don't see any with ZFS, maybe you know one ... But I can imagine something that would help a lot in such situations. Writable snapshots, as BTRFS has it on its feature list. And on top of that, how cool would it be to have some snapshot-aware file utilities. I can already imagine the line on my command prompt: rm --snapshot all ~/firefox*.core *flip* and there is the free space again ...

March 7, 2010

While installing security/nmap

Recently, when I did a portinstall nmap, the build process surprised me with some pleasing ASCII art:

            .       .                                                                           
            \`-"'"-'/                                                                           
             } 6 6 {                                                                            
            ==. Y ,==                                                                           
              /^^^\  .                                                                          
             /     \  )  Ncat: A modern interpretation of classic Netcat                        
            (  )-(  )/                                                                          
            -""---""---   /                                                                     
           /   Ncat    \_/                                                                      
          (     ____                                                                            
           \_.=|____E                                                                           
Configuration complete.                                                                         
   (  )   /\   _                 (                                                              
    \ |  (  \ ( \.(               )                      _____                                  
  \  \ \  `  `   ) \             (  ___                 / _   \                                 
 (_`    \+   . x  ( .\            \/   \____-----------/ (o)   \_                               
- .-               \+  ;          (  O                           \____                          
(__                +- .( -'.- <.   \_____________  `              \  /                          
(_____            ._._: <_ - <- _- _  VVVVVVV VV V\                \/                           
  .    /./.+-  . .- /  +--  - .    (--_AAAAAAA__A_/                |                            
  (__ ' /x  / x _/ (                \______________//_              \_______                    
 , x / ( '  . / .  /                                  \___'          \     /                    
    /  /  _/ /    +                                       |           \   /                     
   '  (__/                                               /              \/                      
                                                       /                  \                     
             NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY                           
It surely makes all that compiling more fun.

March 3, 2010

Rails versus Seaside

To start this blog, I'll simply make some propaganda for Smalltalk and Seaside by referencing an older but still very good article from the On Smalltalk blog. Are you still writing HTML? Oh, you are using embedded ruby code inside your HTML. So you are still doing it the old way then ...

The abstraction and consistency of your code that you get with Seaside and Smalltalk are still the very best I've seen so far. Simply turn your HTML code into Smalltalk, keeping it in the same environment as the remaining parts of your application and profit from all the other strengths Smalltalk offers you.

To be fair, nobody is perfect. Ever looked at how Seaside handles CSS?

style
  ^ '
  #navigation {
    padding: 5px;
  }

  #body {
    margin: 5px;
    padding: 5px;
  }'
Well, surely that's some kind of abstraction, transforming CSS code into a Smalltalk string literal. At least you can now use string composition and maybe regex replacing ... ;-)