James Nixon
August 12th, 2010 James T. Nixon III No comments

An experimental version of FreeNAS based on FreeBSD 8.1 is now available to checkout from sourceforge.net.

Two items to consider before checking out the source:

http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=5&t=5819&start=10#p37152
– Warner Losh’s blog post on this release

http://freenas.svn.sourceforge.net/viewvc/freenas/experimental/ix/README
– The README file


Understanding the new FreeNAS UI

The most experimental part of FreeNAS is most likely the new user-interface written using the Django Framework. I have lofty goals and idealistic dreams – care to join me?

I used the following to build the django-based UI

When starting a new project I prefer to brainstorm on a whiteboard. Thankfully, dry-erase markers are plentiful behind my desk at iXsystems. It is often easier to write Models when I have a rough sketch of the schema behind me to glance over. Once the Models are finished, the second step is creating Forms from those models using ModelForms. Then the View, which, you guessed it, provides a way to “view” the model. The template used for the view can be super simple and auto-generate the form’s HTML, or one can choose to define the HTML for each form field. I haven’t given much love to the template, yet. The last thing I usually do is define my url and test.

Let’s break it down into simple parts:

In models.py,

## Disk Choices populates a list of disks on the system where FreeNAS is installed.

class DiskChoices:
    def __init__(self):
        pipe = popen('/sbin/sysctl -n kern.disks')
        self._disklist = pipe.read().strip().split(' ')
        self.max_choices = len(self._disklist)

    def __iter__(self):
        return iter((i, i) for i in self._disklist)

## Disk made from the disk you choose, a name you give the disk, and a description.
class Disk(models.Model):
    disks = models.CharField(max_length=120, choices=DiskChoices(),verbose_name='Disks')
    name = models.CharField(max_length=25, verbose_name='Disk Name')
    description = models.CharField(max_length=120, verbose_name='Description', blank=True)

## When saved the disk will be named something like, 'ada0 (Disk Name)'
    def __unicode__(self):
        return self.disks + ' (' + self.name + ')'

In forms.py,

# DiskForm takes a normal django Model and renders it as a django form
class DiskForm(ModelForm):
    class Meta:
        model = Disk

In views.py,

# DiskView uses the django form and a template to display the form
def DiskView(request):
    if request.method == 'POST':
        form = DiskForm(request.POST)
        if form.is_valid():
            form.save()
    else:
        form = DiskForm()
    variables = RequestContext(request, {
        'form': form
    })
    return render_to_response('freenas/disks/disk.html', variables)

In urls.py,

# the urlpattern defines a URL to use with the View

urlpatterns = patterns('',
    (r'^freenas/disk/$', DiskView),
)

There are several more things to familiarize yourself with before it all really fits together, this is a simple example about the different pieces of the puzzle. I didn’t cover how I used FormWizard, but the links provided above should suffice, for now. The most fun is when Xin Li connects the UI to his magical middleware; which communicates with the FreeBSD box and the UI. As these portions of FreeNAS are still experimental, bugs are sure to be found. I’m sure a code-cleanup is in order as well…

If you’re interested in the freenas project visit #freenas on Freenode, freenas.org, or blog.freenas.org.

YO! Check it:

svn co https://freenas.svn.sourceforge.net/svnroot/freenas/experimental/ix/ freenas

  • Print
  • RSS
  • PDF
  • Facebook
  • Twitter
  • Identi.ca
  • Technorati
Categories: Django, FreeBSD, FreeNAS Tags:
James Nixon
July 29th, 2010 James T. Nixon III 2 comments

Welcome! OSCON 2010

BSD at OSCON 2010, Linux beware!

FreeBSD / PC-BSD @ OSCON 2010

Familiar faces

Hello Malaysia!

Rafe and Ritz from MSC Malaysia Open Source Conference

LinuxFund After-Party

Our friends from BSD/LinuxFund had an after-party at Barracuda complete with VIP for their sponsors iXsystems, Rackspace, and MindTouch.

Denise, Jakob, and Me

We hung out with Jakob from Drupal / LinuxFest NW and drank for free (as in beer), thanks iX! The DJ was spinning all night everyone had a great time!

iXsystems Everywhere!

Too Much Metal for BSD :D

We hung out with Seth Fulton of the OpenBSD Project and had some beerz and champagne.  Rumor has it there may be Blowfish sightings at LISA this year, too…

BryanBSD

This BSD fanatic always had Beastie close to his heart!

Clever advertising...

It’s what you don’t say that counts.

iXsystems Donation Server

BSD/LinuxFund raffled the iXsystems server and Paul Ebersman of ISC won it!   Congratulations!!

  • Print
  • RSS
  • PDF
  • Facebook
  • Twitter
  • Identi.ca
  • Technorati
Categories: OSCon, Tradeshows Tags:
James Nixon
February 24th, 2010 James T. Nixon III Comments off

Something that used to irritate me about using Firefox in KDE is that I cannot open files in the download manager by double-clicking them.  Turns out it’s really simple to do.  I should make it clear that I am using PC-BSD Hubble Edition 8.0 which is built on FreeBSD 8.0-RELEASE-p2 with KDE 4.3.5, and Firefox 3.5.7 (Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100106 Firefox/3.5.7) .  If you’re using Firefox 2, this won’t work.

PC-BSD: Firefox downloads in KDE

Open downloads in default KDE application

I put the following in /Programs/bin/openwith and made it executable with: chmod +x /Programs/bin/openwith

#!/bin/sh
kfmclient exec $1

Now save a file in Firefox and double-click it in the download manager, you will be asked what to open the file with.  Whatever you choose will be used to open all files in the download manager no matter what mime type.  If you have this set to Okular, for example, you’ll notice Okular will try to open all file types.

PC-BSD: Firefox Preferences

Firefox Preferences: Edit > Preferences

To change this, open the Firefox Preferences screen by clicking ‘Edit > Preferences’ from the menu.  Now click the Applications tab and click the Action Dropdown for content type: file.  In my screen shot you’ll see I have it set to ‘openwith’.

You can choose ‘other’, then click ‘File System’ and browse to where you saved the script, in my case, ‘/Programs/bin/’.

This should make the iXsystems front office very happy.

  • Print
  • RSS
  • PDF
  • Facebook
  • Twitter
  • Identi.ca
  • Technorati
Categories: PC-BSD Tags: , , ,
James Nixon
February 18th, 2010 James T. Nixon III Comments off

Wow, it’s been awhile… Good thing I have my twitter account posting weekly digests here!  I may change it to monthly digests. I don’t use twitter to post incremental updates about the texture, color, and smell of my poo.  Maybe I should.

I hear we’re a few days away from the next release of PC-BSD, Hubble Edition.  Hubble will be the release name for everything in the 8.x series instead of giving every dot release it’s own name, theme, and brand.  For those FreeBSD users out there wondering wtf PC-BSD was doing with dual localbases will be happy to hear that we ditched this method for a ports jail (or what we call the Ports Console).  New users can run into problems when installing ports on their base system, the Ports Console allows a user to install and run X apps (with sound too!) from the port jail. Yesterday, I used the port console to install the Mozilla Weave port, then copied the generated XPI to my home directory and installed it using the PBI version of FireFox.  In the future, I would love to see PBI’s of all FireFox plugins found in ports.

I am attending SCaLE this weekend, which despite popular belief, does not stand for Southern California alternative (to) Linux Expo.  I’ll be hanging out at the FreeBSD Booth with several friends and co-workers, so come by for a demo!  Also, freebsdgirl will be answering questions about sysinstall in regards to what it does better than the new PC-BSD installer.  Why? Because PC-BSD’s installer can be used for automated vanilla freebsd installs, too.  In fact, I don’t know why anyone would use sysinstall (the 90′s called, they want their installer back!) OUCH!  But in all seriousness, use our installer. Seriously.

Now time for some photo-fillerz!

Training hard

Don't mistake this as a "friendly" game of ping pong, they are out for BLOOD.

Production line

One of our production lines featuring JoJo hard at work!

Production Meeting

This is where the real problem solving occurs.

Abtract Trio

Custom BSD Artwork found in the iXsystems conference room. Left to right: FreeBSD Bobble, Beastie, and the PC-BSD Flame.

That’s all for now, I may post another blog after the tradeshow, or not! lol jk jk…

  • Print
  • RSS
  • PDF
  • Facebook
  • Twitter
  • Identi.ca
  • Technorati
Categories: SCaLE, Tradeshows Tags:
James Nixon
January 15th, 2010 James T. Nixon III Comments off

Well, looks like this is my first post of the year… Happy 2010!! I bricked my Android phone about 2 months ago. I know, pretty lame. But all the custom Android builds needed testing, so I thought I’d take a chance. My first attempt was successful, which lead me to believe that rooting the Android was trivial. After a few JF roms, I decided to give Cyanogen a try. The feature I was craving was Apps2SD. It seemed silly that I couldn’t install apps to my SD card. I ended up bricking the phone while flashing hboot to a newer version. After this I lost the recovery console and the bootloader. Thankfully, Randi (freebsdgirl) had an extra G1 around while I wait for my replacement to ship. Thanks Randi!!

The monthly Bay Area FreeBSD User Group was at Hacker Dojo in Mountain View last night. We talked about why a user should run ZFS (thanks Xin Li), installing vanilla FreeBSD with the PC-BSD installer, and why sysinstall should die (thanks again Randi! lol jkjk!!!). Overall, it was an entertaining and informative evening.

I am going to Camp KDE in San Diego tonight and staying til Monday afternoon. Kris Moore will be presenting “KDE4 on PC-BSD: Creating a User-Friendly Desktop”. The schedule is posted here: http://camp.kde.org/schedule.html. I’ll be rocking the Lenovo S10-2 with PC-BSD 8.0 Beta. In fact, I am getting it loaded with PBI’s right now.

If I can keep the battery charged, I plan on using my Android to post some live video blogs to http://qik.com/jnixon. You can also watch the live stream or archived videos on this blog.

  • Print
  • RSS
  • PDF
  • Facebook
  • Twitter
  • Identi.ca
  • Technorati
Categories: Camp KDE, Tradeshows Tags: , , , , ,