Open Formats

Here is another old article I found while digging around looking for something else. I thought I’d post it here.

Using sustainable formats on OSX, or… The Best of Both Worlds!

Remember the early days of networking… before TCP/IP became the standard protocol? Well, neither do I, but I’ve read about it. That’s years ago now, but back then, each computer manufacturer developed their own method of networking their machines together, and each method, or protocol, was incompatible with the other. Apple had AppleTalk, Novell had IPX/SPX, Xerox had XNS, and on and on it went. TCP/IP was born out of the desire to create a vendor independent network, which became known as ARPAnet, and later, the Internet.

This little history lesson is meant to illustrate the tremendous advantages there are to open standards. Would the Internet exist if it belonged to a single corporation? Not as it is today, no. These same ideas can be applied to several other forms of data on the computer; images, documents, music, etc… We now have the capability to keep almost all of our data in a format that is guaranteed to provide greater flexibility, so why isn’t Apple taking advantage of it?

For example, Mail, the venerable email client that comes with the Mac, provides suitable email functionality for most Mac users. Now that I’ve got several years of email stored on my Mac, I’d like to be able to keep those files in a format that is not subject to any corporation’s whims. I’d also like to be able to drop my mail folder on another platform and be able to open it up in a different client… interoperability. Another example is iPhoto, one of my favorites. Would it really be that difficult for Apple to design iPhoto so it stores its database in a reliable, documented format that is readable (and writable) outside the application?

This goes back to a central belief I have about data, and applications. While the application may belong to its author, the data it processes belongs to me, and it should be available to me in a well documented, open format. Open formats make sharing files easier, as they are capable of being supported on more platforms

How about giving Quicktime the ability to natively export to Ogg-Theora? Or allowing iTunes to use Ogg-Vorbis as its default media format? (DRM not considered here…) Pages? Keynote? How about some Open Document Format support? I really don’t think the move to open formats would be that big of a leap. Apple already includes several open source applications inside its server offering, and has built its core data framework around XML and SQLite, so why not open the rest of it up?

The other note worth mentioning is the high profile “switch to linux” news that has been making the rounds lately. With several long time Mac supporters moving to Linux citing problems with formats and a lack of openness from Apple, it seems to me that this is a problem that could be easily fixed. I’m not calling on Apple to open source OS X, I’m not even implying that, although open sourcing a few of the bundled apps might be a good thing in the long term

The world is becoming more aware, and times they are a changin. The world is knocking, dear Apple, its time to open up.

AutoYast

I wrote this last year and never posted it.  I’m glad I found it and can post it now.

One of the projects I’ve been working on in the past week has been a rapid deployment server for SLES 9.  I would have liked to deploy SLES 10, but we are constrained by our application requirements.  Novell has done a great job at making it easy to deploy SLES or SLED using their Autoinstall and Installation Server options available through YaST.  Using Autoinstall, YaST steps you through the options required to generate an xml file, this xml file is read by YaST during system install and automates the process.  To build a network installation source, the contents of the CDs or DVD need to be copied to the hard drive, preserving symbolic links.  YaSTs Installation Server makes this easy, and also makes “slipstreaming” (to borrow a Windows term) a service pack into the install source automatic.  I’ve built the network install source both ways, and I prefer using YaST to do it for me.

Even with all this being said, YaST (in SLES 9) is still missing some features that require me to edit the xml file directly.  The most important feature it’s missing, which they included in SLES 10, is the ability to create LVM volumes during partitioning.  Not to say that it’s not possible, it just requires editing the xml source file.  Using a little trail and error, I was able to partition the drive with a 200MB /boot (too big, I know), a 2GB swap, and then partition the rest of the drive as LVM, and then mount /, /var, /opt, /usr, /tmp, /home, and /work inside the lvm.  Works like a charm.  If you need a working autoinst.xml file, you can download mine here.

This setup is great, but it required me to boot off of the CD, and then enter a long install=nfs://bla bla bla/bla bla autoyast=nfs://blalbalba line at boot time.  To really make the system work, I needed network booting for full automation.  I found a great walk through in this pdf, which surprisingly enough, worked for me the first time.  I had to install tftp, syslinux, and dhcp-server rpms, then edit a couple of files, move a couple of things, really no big deal.

Now, I’m ready.  When we get 100+ servers in, which I’m told I’ll have 7 days to install, I’ll be able to say “what would you like me to do with the rest of the time?”

wsu — gksu for Windows

wsu is a simple little utility that let’s you run another application with elevated privileges on Windows, much like sudo on Linux, and its GUI wrapper gksu. My good friend, Matt Paulauskas is letting me distribute it here on OS\Zen, and he is releasing it as open source under a BSD license. The terms of the license are pretty simple, as he explains it “Basically it’s a ‘give me credit, but don’t use my name to endorse your version without my permission’ kinda thing”.

You can download the utility here: WSU

Yes, we are well aware of the built in runas utility, but we just think this is easier.

Matt’s also got a beta with some interesting features. wsu now accepts -p argument for changing cpu priority.

ex. wsu regedit -p 4

1 Below Normal
2 Normal
3 Above Normal
4 High
5 Realtime

You can download the beta here: wsu2 Beta

Screenshots: Because you know you love them.

winsu_run.PNG
winsu_prompt.PNG
winsuRC2_prompt_failed-logon.PNG

If you are interested, wsu is written in Visual Basic. The executable is very small, here’s the source code:

Imports System.Security
Imports System.IO
Imports System.Diagnostics
Public Class frmWinSu
    Function ConvertToSecureString(ByVal str As String)
        'converts string to secure string
        Dim password As New SecureString
        For Each c As Char In str.ToCharArray
            password.AppendChar(c)
        Next
        'Returns new secure string
        Return password
    End Function
    Public args() As String
    Public adminAcct As String

    Private Sub frmWinSu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'if no arg is passed, exit winsu
        args = Environment.GetCommandLineArgs
        If args Is Nothing Or args.Length <> 2 Then End
        Try
            'Gets admin acct from configuration file
            Dim file As New FileStream("C:\winsu.conf", FileMode.Open, FileAccess.Read)
            Dim fileReader As New StreamReader(file)
            adminAcct = fileReader.ReadLine
            'If the file is blank, do nothing
            If adminAcct = "" Then End
            'Closes filestream and streamreader
            fileReader.Close()
            file.Close()
            lblAcct.Text = "Enter the password for " & adminAcct & " to perform administrative tasks"
        Catch
            End
        End Try
    End Sub

    Sub StartProc()
        Try
            'instantiates new process from the path read from config file
            'Process is started as user adminAcct with password from txtPasswd
            Dim proc As New Process
            proc.StartInfo.FileName = args(1)
            proc.StartInfo.UseShellExecute = False
            proc.StartInfo.UserName = adminAcct
            proc.StartInfo.Password = ConvertToSecureString(txtPasswd.Text)
            proc.Start()
        Catch ex As Exception
            ' displays message if an error occurs
            MsgBox(ex.Message)
            'if error is from incorrect logon info, then start over
            If Err.Number = 5 Then txtPasswd.Text = "" : Exit Sub
        End Try
        End
    End Sub

    Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
        'Executes StartProc() routine
        StartProc()
    End Sub

    Private Sub txtPasswd_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPasswd.KeyPress
        'Executes StartProc() routine if enter key (chr(13)) is pressed
        If e.KeyChar = Chr(13) Then
            'e.Handled stops the proram from making the really annoying _
            'error alert noise when you press the enter key on a single _
            'line textbox
            e.Handled = True
            StartProc()
        End If
    End Sub

    Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
        End
    End Sub
End Class

We hope you like it, if there are any questions or suggestions, drop them here in the comments.

NOTE:  We just discovered that WinSU is already taken as a name, so Matt asked to have it changed to wsu.

The Master Craftsman

The Master Craftsman works methodically, not slowly, not hurriedly. He has mastered the basics, and knows the essence of his craft. He has moved to a point where he can define his own methods, and doesn’t need to explain them to anyone, unless someone is wise enough to ask. The Master Craftsman enjoys the hardest, most complicated problems, and enjoys unravelling them piece by piece. He enjoys the challenge to his skill, and proves his worth again and again as he overcomes each obstacle.

The Master Craftsman has an intimate relationship with his tools. He knows not only what they do, but much more importantly, how they do it. His choice of tools for a certain task is based on years of experience, research, and hands on use. He can debate intelligently on the merits and problems with his tools, as compared with other tools that he has tried and discarded over time. His choice of tools explains something about him.

The Master Craftsman enjoys his work, and is comfortable with his place in the world. He is an expert, and he knows it.

I’ve had an abstract idea for this post for a couple of months now. The Master Craftsman is the embodiment of my professional goals. I’m not one to speak of gurus or wizards, since I come from very down to Earth country in Montana, but a craftsman, or a woodworker is an image that I can grab on to. I’m not a Master yet, but I’m working towards it. My tools are not jigsaws and planers, but vi and zsh, but the basic principles still apply. I think the idea of a craftsman is less about impressing others and more about perfecting his skill.