Archive for the 'General' Category

Setting Up QuickBooks on Windows XP Professional for Multi-user Environment

Recently I was involved in a project moving a company’s files from a old 2003 windows exchange server to a mac mini server setup. The first setup was to move from Exchange’s email and calendaring to Google Apps. After that step was complete we moved the shared files drive over to thunderbolt RAID 5 storage attached to a mac mini server device. The transition was pretty smooth, however there was one problem which wasted a significant amount of time.

The accountant’s in the organization use QuickBooks 2010 for all accounting purposes. Moving to a hosted solution was not an option, and they needed multi-user access to the file (2-3 people could be working on the same quickbooks file at any given moment). Our old 2003 server had quickbooks database server installed which seemed to work fine. Unfortunately, if you are not an ‘enterprise’ quickbooks customer there is no linux version of the database server available. There was an old windows box lying around (fairly fast: dual core 2.8ghz, 3GB ram) that would be a perfect fit (or so I thought…) for a quickbooks server. Wiped the box, installed Windows XP with all updates, removed all crapware, installed quickbooks database software, but had significant trouble getting quickbooks database server to work correctly.

I ran the QuickBooks Network Diagnostic tool, but it did not report any errors. When opening the QuickBooks file from a client machine in multi-user machine the login prompt would come up fine, but after entering the correct login information it would time out with an error message stating a connection issue (H202) and suggesting using an ‘alternative’ method (there was a significant delay in between initiating login and getting a response). Note that QuickBooks at this stage would correctly report an incorrect password.

The network setup in the location where this was occurring had a local server running DNS. The QuickBooks server had a static IP set.

Here are some general notes on setting up QuickBooks:

  • Some mentioned that anti-virus software on the client machine causes slow operation. This didn’t seem to make in a difference in my case.
  • Tried turning firewall off on server + client machines: no difference (proper port settings were already in place)
  • Pulling data off of the shared QuickBooks folder on the XP machine wasn’t bad: 15MB/sec on a badly engineered 10/100 network (there are 5-port 10/100 switches in probably 5-10 locations around the office)
  • Opening the QuickBooks file in single-user mode from a client machine worked fine
  • Launching QuickBooks 2010 on the server and opening the file in multi-user mode, then opening the file from client machines worked fine as well
  • The significant delay between the login screen and the error messages pointed to some sort of look-up timeout, but given that file access to the machine was fine, this didn’t make a ton of sense. However, this seemed to be part of the issue.
  • It is important that the daemon process for QuickBooks Database Server is part of the administration group
  • On another note: some great information on backing up QuickBooks

What finally fixed the problem was adding the computer-name (aka server name or BIOS name) to the hosts file. Opening up quickbooks is still painfully slow, but at this point it works.

Migrating Rules From Microsoft Exchange to Google Apps

Recently I was part of transitioning the email system of a 20+ employee business off of a Microsoft Exchange 2003 server to Google Apps. Moving close to half a million emails to a new email service was a big decision. The transition tools that Google has in place are pretty good, albeit slow for that many emails, Google throttles email transfer to one each second after the first 500. However, the one piece that was missing was a good tool to transition outlook server rules. Many employees used those rules extensively and many had 50-100 rules. Outlook does not have any method in place for extracting those rules. There is no built in way to getting any sort of list or descriptions of the rules, if one wanted to transition the rules manually they would have to click on a rule, look at the pop-up window, and recreate the rules in Gmail using the filters functionality – repeating this two step process for each rule. Horrible.

This would waste many hours of valuable time so I started hunting for a better solution. There is an API in Outlook 2007 or higher that enabled access to rules. There isn’t much example code available, and to my surprise I couldn’t find any VB script to export a CSV of all the rules associated with an outlook account! I hacked together a really rough VB script which exports Outlook rules (only one rule type right now, thats all I needed for my use case) as a CSV and then wrote a small ruby script to generate a XML doc of the rules for import via Gmail’s import / export available through Gmail labs. It works fairly well assuming you have an updated version of Outlook 2007 or higher.

Google Apps Transition Notes

  • The server migration tool pulled in some calendar events that employees claimed they deleted long ago.
  • The Google Mail Uploader application for Mac is not consistent. It wouldn’t pickup mail on some computers. Doesn’t handle folder hierarchy (flattens everything). Use the server migration tool instead.
  • Mail.app folder doesn’t update folder’s unread count immediately. This might be an isolated issue with Lion.
  • I had a problem with one Mac machine (10.6) where the inbox would randomly appear blank. Clearing all Mail.app support / cache files and adding the mailbox with message + attachment cache disabled fixed the issue (after mail downloaded I enabled cache again).
  • Gmail doesn’t seem to handle lots of folders (labels) well. Mail.app seems to be a lot slower with multiple folders.
  • Hiding the automatic All Mail, Misc, Follow-up, etc folders was helpful for those who were not familiar with gmail.
  • Changing some of the local settings on Mail.app makes Gmail play a bit nicer.
  • Still can’t find a good solution to allowing a user that is an administrator of another user’s calendar to create an event with the organizer being marked as the calendar’s creator. Use case: administrative assistant managing an executive’s calendar.

MacRuby Deployment + Load Order

After reading the official MacRuby docs on deployment, I read over this guide. Although the deployment build seemed to be working fine on my local machine when I dropped it on my laptop with a standard Lion install it crashed, claiming that there was an defined constant – but that constant was a class. How could it be undefined if it ran fine locally?

Looking into it a bit more the class that was undefined was being used as a superclass for another ruby class. Taking a look at rb_main.rb revealed that there is no specific load order. Since the load order was undefined, the class requiring the other ruby class as a superclass was being loaded before the superclass was loaded. I ended up tweaking the rb_main.rb file to allow for a manual load order, followed by the standard automatic load.

# Loading the Cocoa framework. If you need to load more frameworks, you can
# do that here too.
framework 'Cocoa'

# Loading all the Ruby project files.

# manual load allows up to specify the load order for some of the classes
manualLoad = ["VTiTunesHeader"]
for file in manualLoad
require file
end

manualLoad < < File.basename(__FILE__, File.extname(__FILE__))

# Auto load the direct of the files in the dir
dir_path = NSBundle.mainBundle.resourcePath
Dir.glob(File.join(dir_path, '*.{rb,rbo}')).map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
if not manualLoad.include? path
require(path)
end
end

# Starting the Cocoa main loop.
NSApplicationMain(0, nil)

You can grab the gist here.

Cocoa Resources

Some Cocoa libraries / snippet repos that I found during my latest dev session.

Random Tidbits

  • Although old news to most, you can grab the the last n bytes of a file using tail -c. Very useful for cutting down on the size of large text log files.
  • I pulled the build versioning code out from a project I was working on. Take a look at this build numbering gist, provides source to pull version number from git or svn and write it in your Info.plist
  • The Ruby logging class is more robust than the Log4r class and the built in logger class.
  • attr_accessor :variable makes a instance variable Key Value Coding compliant. Just set @variable in your initializer.
  • Awesome side-by-side reference sheet for PHP, Ruby, Perl, and Python. Handy reference to python to ruby conversion.
  • Obj-c blocks in MacRuby
  • Although you can `macgem install json`, macruby comes with a json library built in that seems to have tweaks for deployment. Don’t install the json gem
  • The Open3 Ruby library does not return subprocess status correctly when using MacRuby
  • Online version of “MacRuby: The Definitive Guide”
  • PyObjc on Lion is dead. Although you might get an application to run, there are so many bugs it really isn’t usable for production
  • Although macrubyd exists, it doesn’t seem to work with full-fledged Cocoa + MacRuby apps. There isn’t any Xcode integration. Ruby-Debug also doesn’t seem to be compatible with MacRuby. Bottom line: no strong debugging tools for MacRuby… yet.
  • The “throw your dotfiles on github” trend has been an interested learning experience for me

TextMate 2 Alpha Before Christmas

Just saw this on the macromates twitter today:

@kylefox It does however work better in 2.0 provided soft-wrap is on, there will be a public alpha before Christmas.

I’ve been a long time TextMate user anxiously awaiting a new version (Allan did such a great job with V1, I’m curious to see what he will come up with for V2).

Couple new TextMate related links / things I’ve found recently:

Lion, SMTP Postfix Relay, and Dreamhost

When developing web-apps locally it is useful to have a fully functional smtp server to test automated emails associated with your application. Many times the network you are developing on will not allow you to simply start up postfix and and run your own local smtp server. However, this doesn’t imply that you can’t use postfix – modifying postfix to relay all outgoing mail to an external / offsite smtp server that you have control of will enable you to develop & test the parts of your application that require a local outgoing smtp server without an issue.

Many times port 25 (the default smtp port) will be blocked somewhere along the line in your network connection. You can figure out if your network configuration or ISP is blocking port 25 by running telnet smtp.server.com 25.

Edit /etc/postfix/main.cf

relayhost = [mail.domain.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes

Create/edit /etc/postfix/sasl_passwd

[mail.domain.com]:587 username@domain.com:password

Run this command in your shell once the above two files are created/modified:

sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
sudo launchctl stop org.postfix.master
sudo launchctl start org.postfix.master

# test postfix, cmd+d after typing message content to send message
mail -s "Testing, Testing" you@domain.com

References:

Economic Analysis & The App Store

I read two articles – the app bubble and bad news about iphone economics – which surprised me a bit.

Their analysis, which doesn’t account for gain in human capital and the value of lock-in (or alternatively the cost of switching), seems to posit that the App Store is bad for everyone. I could be completely misevaluating the arguments presented, but I believe that if you dig into the arguments presented significant benefits are not being accounted for.

Apple is Paid to Advertise

Apps aren’t very profitable for Apple either. According to Apple Insider, “Apple has long maintained that the App Store isn’t meant to be a profit generator, as much as a means of attracting customers to the iPhone and iPod touch.” The App Store’s gross profits amount to just 1 percent of Apple’s total gross profits.

If something is a ‘means of attracting customers’ then it is a valuable asset, a marketing tool. Even if Apple were losing money running the App Store they would still continue to operate the store because it is incredible marketing tool. The fact is that Apple is being paid to advertise the iOS platform. There is alot of time and money being pumped into advertising individual iOS applications and the more those applications are being designed and developed vendor lock-in takes place which is extremely valuable (vendor lock-in is what makes Microsoft so valuable, valuable enough that Intel just bet 7.68 billion on a more-or-less Microsoft specific technology). Many smaller companies have to choose between the iOS platform and the Android phone (it really isn’t a platform… yet) and most – in my opinion – are choosing the iPhone. Every application that is released on the App Store increases the marketing value of the App Store.

iOS Apps Keep Customers Happy

The decision to adopt a technology sometimes depends on whether or not your current hardware will support it. This is why Square Space developed an iOS app – it keeps customers happy and helps future customers more easily make the choice to using Square Space. Additionally, developing an App Store application to tie in with your product prevents a second-mover from jumping into the uncaptured market and pulling customers into a separate service which integrates with your free / paid iOS application (ex: some sort of Square Space competitor).

Experience is Valuable

Developers don’t develop open source applications such as Seashore, Sequel Pro, and Adium for profit. Open source applications are developed for the experience and for the gratification that comes with knowing you are the master of something (this video has some thought provoking ideas about the reason people spend time on tasks which do not result in a direct monetary gain). Developers are more valuable when they can bring an idea from conception to release and when they can prove their ability to quickly master new technologies. Having an iOS application published on the App Store gives concrete evidence to an employer that an employee has those skills – it is a screening device. Yes, an individual developer may not make a profit on an app they developed, but if it allows them to earn 20% over the next 5 years then there is most definitely a net gain.