Category Archives: Ubuntu

Macintosh & Ubuntu: Apple File & Time Machine Server

I’ve streamlined a script that will install netatalk (an open implmentation of the apple network file server protocol), avahi-daemon (Bonjour/ZeroConf service) and configure it all to set up home directories and a Time Machine shared folder at /home/TimeMachine (which can easily be changed, read below).

The link to the install script is at my Ubuntu Script sub-site (look for Apple File Server).

This has been tested in both 10.04 (LTS) and also 10.10 and works with my MacBook Pro very nicely.

By default you’ll have to “Connect As” a UNIX user on the system, but you should be able to figure out how to handle guest support with a few good Google searches.

Once everything is set up, the biggest (and most likely, the only) file to change for this service is /etc/netatalk/AppleVolumes.default

The install script will append a line to the bottom for the TimeMachine home directory, feel free to make this anywhere in your file system by changing the path area…or even rename it by changing the second parameter. There’s pretty good documentation on the netatalk website.

I’ve tested this on 2 real machines and about 4-5 virtual machines, so as long as you’re running Ubuntu 10 or better, it *should* work pretty much right after the script finishes.

To have Time Machine work for your clients, a small hack must be made (well, honestly a hidden setting must be changed).

Open the Terminal Application (which is in your Utilities directory) and copy paste the following (and press enter to run the setting change program) all on one line just in case it’s wrapped in your web browser:

defaults write TMShowUnsupportedNetworkVolumes 1

An instructional RTF wit the above setting is is the default Time Machine folder just in case you don’t read this far or if you don’t want to refer to this post again.

Python Programming: Converting my old avi files to h.264

Here’s a little script that calls HandBrake‘s CLI interface to convert a whole directory full of media in a recursive manner.

No Instructions. No warranty. No guarantees. Your mileage may vary. Yadda Yadda Yadda.
Tested on Ubuntu and MacOS 10.6

Download it here or just read it (better to download it, since my blog removes the whitespace and hence the flow of the script):

# This script requires the HandBrake CLI program
# Download it at

# You’ll need to change this to fit where everything is on your system
sFromDirectory = “/home/jeff/Videos/”
sToDirectory = “/home/jeff/Desktop/converted_video_output/”
sFullPathToHandbrakeCLI = “/usr/bin/HandBrakeCLI”

# Don’t mess with anything below this…..
import os.path
import shutil

def ConvertFile(sPath, sFile):
global sToDirectory
global sFromDirectory
global sFullPathToHandbrakeCLI
sExtension = os.path.splitext( sFile )
sNewFileName = sFile.replace(sExtension[len(sExtension) – 1], “.m4v”)
sNewDirectory = sPath.replace(sFromDirectory, sToDirectory)
if sPath != “”:
sOldFullPath =  sPath + “/” + sFile
sOldFullPath =  sPath + sFile

if sPath != “”:
sNewFullPath =  sNewDirectory + “/” + sNewFileName
sNewFullPath =  sNewDirectory + sNewFileName

# Don’t re-encode if it’s already a m4v
if not os.path.exists(sNewFullPath):
if sExtension == “.m4v”:
# Copy it instead of re-encoding it…
shutil.copyfile(sOldFullPath, sNewFullPath)
sHandbrakeCommand = sFullPathToHandbrakeCLI + ‘ -i “‘ + sOldFullPath + ‘” -o “‘ + sNewFullPath + ‘” -v -m -E aac,ac3 -e x264 -q 0.65 -x ref=3:mixed-refs:bframes=6:b-pyramid=1:weightb=1:analyse=all:8x8dct=1:subme=7:me=umh:merange=24:filter=-2,-2:trellis=1:no-fast-pskip=1:no-dct-decimate=1:direct=auto’

def callback( arg, sDirectory, aFilenames ):
global sToDirectory
global sFromDirectory
print “Checking files in ” + sDirectory
sSubPath = sDirectory.replace(sFromDirectory, “”)
for sFile in aFilenames:
if sSubPath == “”:
sOldFullPath =  sDirectory + sFile
sOldFullPath =  sDirectory + “/” + sFile

if os.path.isdir(sOldFullPath):
sNewDirectory = sOldFullPath.replace(sFromDirectory, sToDirectory)
print “”
if not os.path.exists(sNewDirectory):
print “Making new directory: ” + sNewDirectory
print “”

if not os.path.exists(sToDirectory):
arglist = []

Updated (September 3rd): Fixed a directory recursion issue.

Top Down Marketing and how Ubuntu should retarget their niche to succeed

I’ve been thinking about this during my my fever induced delirium and now that I’m feeling a bit better (still coughing though) I think I’m going to rant my observations and suggestions to the Ubuntu community. Now understand that I’m, for the most part, pulling any possible figures and statistics from the air and is mostly purely opinion and personal observation, but hopefully someone else can learn from and follow my line of thought, as I can already tell this is going to be a long post. In addition, this is pretty much stream of conscious, so the rhyme and reason may stray a bit. If you comment, please keep this in mind.

Microsoft’s Explosive Growth in the 90’s (and a little bit of the 80’s)

In the 90’s the two juggernauts of general computing took two different approaches of claiming the market. Apple was looking to put a Mac in every home, while Microsoft was seeking to put DOS and Windows on every office desk. Instead of making their own computers, Microsoft created the operating system that any PC manufacturer could license and sell their computers. At first this was DOS, but then when Apple learned of the GUI from Xerox Parc and created the first (amazingly innovative for the time) Mac, they started work in the Windows shell which ran on top of DOS.

It was because of the business class software of Word Perfect and Lotus that DOS shined early in the 90’s. Mac catered towards the graphic artists due to some of their amazing design software such as Mac Paint and Adobe’s Photoshop 1.0 (which until later versions, the Windows version was an afterthought, and not nearly as efficient). When employees wanted to purchase a computer for their home, they were already used to using Windows/DOS computers at work and naturally decided to purchase what they were used to (there were a few that were convinced to “Think Different” from their office computers).

Once a market is established, businesses are very slow to change their ways and tend to use solutions until they fail completely unless directed eloquently by a good technology officer (who would see that a solution would fail in a few years and start planning for a solution that would replace it and plan for a transition to a new solution).

Example: Visual Basic and Microsoft Access

I can’t tell you how many MBA programmed/hacked Visual Basic or Microsoft Access solutions I’ve had to replace/work on (tearing out my wits and hair while doing so because they were all patches, with no proper thought process of how to program properly), but these two powerful tools were also an strong proponent of Window’s success in the mid 90’s. Programming a dialog-based business front-end was easy, and although multiple people accessing a Microsoft Access database sometimes was tricky, it did work most of the time. Sure Mac had File Maker Pro and a few other solutions, but Microsoft was a trusted named in the corporate world and they practically gave copies of this development software (Access at least) with every copy of Microsoft Office and with the free Runtime, only one developer had to purchase while many other employees could use the custom business software.

The late 90’s – The Server Market EXPLODES

Two words that are some of the most powerful words in the corporate world: Active Directory. Active directory is a tweaked combination of the open standards LDAP (Lightweight Directory Access Protocol) and Kerberos (basically a network password encryption scheme) as well as a few other little proprietary ticks. What this did was one of the most important things for any corporate environment: Roaming Desktops and most importantly, single-sign authentication.

From this base Microsoft created their mail server Microsoft Exchange, which was not only a Mail server, but a collaborative Calendar and Contact manager for an entire company. Sure there were other solutions such as Lotus Notes and Lotus Domino (which came too late with too little features), but none of them were top-down homogeneous with Microsoft’s operating systems. Between this and Windows 2000 (based on the quite stable for the time NT kernel), Microsoft’s grip on the corporate market became tighter.

Before Active Directory: the UNIX solution to multiple users

In the early 90’s I noticed many SCO or VAX based terminal solutions for corporations as well, before Microsoft’s Active directory, using telnet to connect to a UNIX server was really the only practical way to have a single-sign-on solution with a ‘roaming’ home directory.

Unfortunately these solutions were amazingly expensive as they were very powerful (even now, as operating system ‘power’ is quite level the legend of UNIX being powerful still whispers amongst techies). However, the command line was unintuitive for non-trained users and training employees is very expensive (plus the fact that most UNIX programmers tended to make their custom solutions work instead of being easy to use, due to time constraints)

Microsoft Today

Microsoft as a software company has only two popular home products: Windows 7 Home and Office Home and Student edition (everything else is a separate division and not their bread-winner). Everything else is targeted towards businesses, whether small or corporate business. Sure Windows 7 has a very nice set of Gaming tools in DirectX, but this was a bolt-on solution to Windows, not a core feature (as of Vista, it’s now integrated in the desktop with Aero).

How to Make A Product in Succeed Today’s Market

Microsoft is King of the corporate world: deal with it. There’s no need to whine about it, no need to disagree. If you go into any major corporation, they use Active Directory and Microsoft servers, they may or may not use Exchange (most likely they will), but they’ll be using AD. Group Policies and Update Servers make keeping 1000+ computers a 10 man job instead of a 50-100 man job which saves TONS of cash.

To succeed you’re going to have to integrate seamlessly in this environment, or you’re going against the grain of corporate information technology and you’ll be denied request for your gadget or software that a user feels they need to work (or play).

Example: The Apple iPhone 3g (and the Mac)

The iPhone has a huge percentage of the market for many reasons, but (in my opinion) the reason for this was due to the iOS version 3’s ability to sync and connect with Microsoft Exchange servers for Calendars and Email. This is a very important for corporations and until that time the iPhone was just another ‘toy’ not to be considered for its managers and executives. Once these features were in place the phone had a whole new market (and one with deep pockets) and I know personally in our office that was the reason that we adopted them for our technicians–the calendar syncing alone. Until those features were added it had amazing response and sales, but well less than when the corporations and businesses that depended on Exchange for their scheduling.

With Snow Leopard last year, the Macintosh now has the ability to connect to Exchange servers with iCal and Mail. Although the users can’t sign in (easily) to an Active Directory, they can still participate in the corporate employee communication and scheduling, so there’s a good possibility that Macs may start showing up in the office (and may partially explain the recent boost in Mac sales). If Apple’s next OS were to support joining an AD domain right out of the box easily, then I foresee a huge explosion of Mac sales too as Antivirus software licenses are almost as expensive than the price difference of a low end Mac and a PC (although as soon as the Mac becomes more popular, I expect more attacks against the platform).

What this means for Linux (and my favorite Distro Ubuntu)

For the Linux Desktops: I’m not going to get into any GUI debates, as Ubuntu’s GUI is still evolving. Linux desktops have GOT to be able to register and connect to an AD domain to succeed in the corporate world. It’s wildly important to connect to Exchange for Contact, Calendar and Mail as well. Applications are hit and miss, as many corporations are moving towards Web/Intranet-Based applications for their internal development. This is mainly because the developers can write once, and it instantly be effective for all the users.

For Linux Servers: Creating a free and easy to use LDAP/Kerberos server is essential (and having the Desktop Distros easily find and have the ability to connect to that server is essential. Creating a Mail/Contact/Calendar server is essential as well, whether it is Exchange compatible is detestably important but there should be some way to at least import from an existing Exchange server for transitional purposes. Even for home users this is important, as now multiple home users may have the same login across all home computers (and this is very common here in the US) with all their files and settings.


Win32/64 Drivers Rant On! (Ubuntu Saves The Day)

Ok. I have *2* old scanners that I was needed to scan some old photos a Canon Canoscan n676u and a Lexmark 2500 series all in one that was included in the computer room when I married Kim.

Neither one of these showed up as a scanner in Windows 7 because Microsoft decides to change the driver model every other release of Windows. It’s really a shame that I had to hook up my Canoscan to my Ubuntu server (which runs the Gnome desktop), and lo and behold the scanner not only shows up, but works PERFECTLY using the Simple Scan program built in.

What’s a shame is that I also ran VMWare Player with my Windows XP virtual machine and I was able to install the Canoscan drivers with that perfectly as well just in case I wanted to scan with my Photoshop 6….but bah.

Free Software saves the week! Hooray for Ubuntu!

Ubuntu 10.04 LTS has arrived!

What is Ubuntu?

Ubuntu is an operating system built by a worldwide team of expert developers. It contains all the applications you need: a web browser, office suite, media apps, instant messaging and much more.

Ubuntu is an open-source alternative to Windows and Office.

I’ve been running this OS on half of the servers at work (this website is hosted on an Ubuntu server), and half of my computers at home for some time now. If you’re looking for a free, safe, secure and stable way to traverse the web, I suggest trying this operating system by at least running off the LiveCD.

If you like what you see, please feel free to do some research on how to install Ubuntu Desktop on your computer. It’s not for the faint of heart technologically, but it is much easier than installing Windows XP on modern computers.

Download your copy here