Categories
Lifehacks System Administration

Synergy and Text Expansion Programs on Windows 7? Don’t run as admin.

Synergy is great. And text expansion/replacement tools are great (ie, PhraseExpress or AutoHotKey). And Windows 7…well I guess it’s alright as well.

Synergy lets me share my mouse and keyboard between my Windows desktop, my Macbook, and even a linux machine (if I still ran one at work). It even synchronizes the clipboard betweeen screens. Great stuff.

PhraseExpress is my current favorite text expansion tool. I use it to insert my signature into emails and other places where I might repeatedly type something. And it’s free for personal use. I’d use TextExpander on my Mac, but I’m cheap.

Now here’s the problem: if you run Synergy (either 1.3.8 stable or 1.4.8 beta at the time of this writing) and install it to autostart on login, your text expansion tool will problem not work.  So just run it manually after you login, and you’ll be okay. The autostart process for Synergy requires administrative rights, and seems to interfere with the hooks that the text expansion tools need to work.

After switching to a new workstation, I installed my necessary programs including the ones listed above, and noticed that PhraseExpress didn’t work. I thought it was a problem with that specific program. I tried uninstalling and reinstalling and updating, and even tried AutoHotKey for a bit (which is great, but it’s

Until I come up with something smarter, I’ll just start Synergy manually when I restart my computer. That’s not the end of the world, and at least PhraseExpress will work.

So beware. Two great programs, but don’t run them as admin.

Categories
Software System Administration

Upgrading to NConf 1.3.0 on Ubuntu 11.10 Oneiric Ocelot

Congrats to the NConf crew for reaching the 1.3.0 milestone! Two years in the making, but I’m excited to see the project continuing to move forward.

It’s been over a year since I originally installed and configured Nagios and NConf 1.2.6 on my Lucid Lynx server. In the meantime, I’ve upgraded the hardware and moved to Ubuntu 11.10 Oneiric Ocelot, mostly to keep up with the current releases. Not a whole lot has changed for what I use this server for, but keeping up with the Nagios releases in the repos has been convenient.

If you’re following along with this guide but starting fresh with Nagios and Nconf, you’ll probably want to take a look at my previous guide and the NConf installation documentation to get some background information. I’ll try to provide some notes for those of you doing a fresh install, but since I’m just upgrading, I can’t make any promises.

Backups!

Log into your server and make them backups!

sudo cp -rp /var/www/nconf /var/www/nconf.bak
mysqldump -u root -p nconf > ~/nconf_sql.bak

I also backed up my Nagios configs

sudo cp -rp /etc/nagios3 /etc/nagios3.bak

Download and Unpack

Wget or otherwise download the latest version on Nconf. Wget has that issue with following SourceForge links so you may need to rename the file.

Unpack the files and then copy them to where you installed NConf before, or do it all in one step:

sudo tar xzvf nconf-1.3.0-0.tgz -C /var/www

Then fix the permissions for the NConf folder, setting them back to your apache user:

sudo chown -R www-data:www-data /var/www/nconf

Upgrade

Browse to http://<yourserver>/nconf/UPDATE.php

Follow the prompts to proceed with the interactive update. NConf’s documentation on the update process has screenshots that I won’t repost here.

After the upgrade, you’ll need to remove some files and folders. Browse to your NConf folder and nuke them. I also had to remove the call_ajax.php file, which wasn’t in the original documentation.

cd /var/www/nconf
sudo rm -rf INSTALL/ UPDATE/ INSTALL.php UPDATE.php call_ajax.php

There’s been a few changes/additions to the NConf conf file, so open up config/nconf.php and add the following lines:

define('CHECK_UPDATE', 1);
define("DEBUG_GENERATE", 3); # [1=ERROR|2=WARN|3=INFO|4=DEBUG|5=TRACE]
define('CHECK_STATIC_SYNTAX', 1);

Also, set the ALLOW_DEPLOYMENT variable to 1 to enable deploying configs directly from NConf and comment out the other CONF_DEPLOY_ variables, as they aren’t used anymore.

define('ALLOW_DEPLOYMENT', 1);
#define('CONF_DEPLOY_URL', "https://webserver.mydomain.com/incoming_config.php");
#define('CONF_DEPLOY_USER', "deployUser");
#define('CONF_DEPLOY_PWD', "deployPass");

At this point, you should be able to log into NConf 1.3.0 and look around.

Migrating Deployment

With NConf 1.2.6, I used the ADD-ONS/deploy_local.sh script and a cron job to deploy configuration changes to Nagios. In 1.3.0, they’ve integrated this a little better into the core of the application, but it required some adjustment in my setup.

Start off by coping the deployment.ini sample configuration file to the config folder:

sudo cp /var/www/nconf/config.orig/deployment.ini /var/www/nconf/config/deployment.ini

Open up the config/deployment.ini file, uncomment the LOCAL deployment section except for the [copy nagios.cfg] section and change the target_file variables to reference the nagios3 folder where Ubuntu places the config files.

Also, add the reload command (sudo /etc/init.d/nagios3 reload) at the bottom of the [copy global config] section. When you’re done the file will look similar to the following:

;; LOCAL deployment ;;

[extract config]
type = local
source_file = "/var/www/nconf/output/NagiosConfig.tgz"
target_file = "/tmp/"
action = extract

[copy collector config]
type = local
source_file = "/tmp/Default_collector/"
;target_file = "/etc/nagios/Default_collector/"
target_file = "/etc/nagios3/Default_collector/"
action = copy

[copy global config]
type = local
source_file = "/tmp/global/"
;target_file = "/etc/nagios/global/"
target_file = "/etc/nagios3/global/"
action = copy
; *** add the line below
reload_command = "sudo /etc/init.d/nagios3 reload"
; *** keep this section and the rest of the file commented out
;[copy nagios.cfg]
;type = local
;source_file = "/tmp/static_cfg/nagios.cfg"
;target_file = "/etc/nagios/nagios.cfg"
;action = copy
;reload_command = "sudo /etc/rc.d/init.d/nagios reload"

This process replaces the deploy_local.sh script, but we’ll need to allow the web user to issue the Nagios reload. To do that, we need to modify the sudoers file:

sudo visudo

Then add the following lines:

# Allow www-data (apache) user to reload nagios
www-data ALL=NOPASSWD: /etc/init.d/nagios3 reload

Save and quit.

Finally, remove the entry in the root crontab entry that launched the old deploy script:

sudo crontab -e

And remove the line reading:

* * * * * /var/www/nconf/ADD-ONS/deploy_local.sh

Deployment Testing and Cleanup

Let’s make sure the new deployment procedure works. Back in the NConf GUI, click Generate Nagios config. You should hopefully see something like:

[INFO]  Starting generate_config script
[INFO]  Generating global config files
[INFO]  Generating config for Nagios-collector 'Default Nagios'
[INFO]  Ended generate_config script

If the config files generate successfully, you’ll see a button aptly labeled ‘Deploy’.

Click Deploy, and with any luck you’ll be presented with three OK messages in NConf  and your Nagios Event Log should show a SIGHUP message.

Relax, and enjoy some JQuerified NConf 1.3.0 goodness! Gold star!

I did notice that the original deployment method left a bunch of old config tgz bundles, so if you’re feeling like cleaning those up, just remove the whole lot:

sudo rm /var/www/nconf/output/NagiosConfig.tgz.*

Update (6/25/12): You’ll want to remove the extended_host_info.cfg and extended_service_info.cfg files from your target config directory (/etc/nagios3/Default_collector/), or you might get weird problems trying to deploy later on. I just found this out six months later.

Troubleshooting Notes

  • The biggest problems I had were just remembering to reference nagios3 rather than nagios for paths and commands.  Make sure you reference the correct locations. This caused me all sorts of weird grief with the sudoers file, and I didn’t catch it until later.
  • While NConf will run without the additional variables in config/nconf.php, it’ll log warnings until you add them.
  • I had to remove an extra file (call_ajax.php) before NConf would run. The file has been replaced with call_file.php which apparently fixes a security issue. At the time of this writing, removing this file wasn’t in the docs, but it complains until you nuke it.

Fresh Install of Nagios and NConf

From what I can tell, you can follow all the steps in my old guide for installing 1.3.0 up until you get to Configuring NConf to Deploy Nagios Configurations Automatically. At that point, follow the Migrating Deployment instructions from this guide.

Please leave a comment and let me know if you do a fresh install. I’d be curious to know how it works for you.

More Information

 (edit 6/25/12 to add additional file cleanup instructions)

 

Categories
Software System Administration

vBulletin 4.1.7 Mobile Style Giving You Grief?

I upgraded a forum to vBulletin 4.1.7 last night. Pretty straightforward stuff, only the mobile style that they half-introduced back in 4.1.2 or somewhere along the lines has been a little glitchy.  4.1.6  reintroduced the mobile style, but I blinked and 4.1.7 was released.

I ended up deleting the mobile style and reimporting it from scratch (see Installing the vBulletin Mobile Style from their manual) but the grid menu button didn’t seem to work. The grid menu is where they’ve put notifications, messages, what’s new, etc. in the mobile style. In particular, I had some users ask where the What’s New feature was in the mobile style, and that’s finally been added, so it was important to get the grid menu working.

Here’s what I found.

vBulletin Mobile Style Grid Menu Fix
Set the Default Mobile Style for Modern Browsers to your Mobile style

Under Settings -> Options -> Style & Language Settings, make sure to set the Default Mobile Style for Modern Browsers to your Mobile style. I went ahead and set as the default for Old Mobile Browsers as well, since I don’t know what the difference is.

And voila!

That is all.

Categories
Software

MyFax Support, You Suck

tl;dr MyFax Support sucks. Getting ‘Mydll_NT: Error in function: dAddPortMonitor, Error code: 126.’ installing the Print-to-Fax Assistant? Run msiexec /i myfaxassistantsetup.msi /q and install in silent mode.

Dear j2 Global Communications/Protus/MyFax:

Please remind your company to care about their software and the people that use it. In particular, you need to provide support for the installation of your products. Telling someone you won’t support your own product until it’s installed is ridiculous and asinine.

What Went Wrong: Installing Print-to-Fax Assistant

A few days I attempted to install the MyFax Print-to-Fax Assistant on a fresh-out-of-the-box Dell workstation running Windows 7  Professional 32-bit SP1. Nothing out of the ordinary installed on this system. It’s joined to a domain and I’m running the install as myself, a user with administrative rights on the local machine.

I accept the EULA and all the defaults to get the install on its merry way, and I receive the following error:

MyFax Print-To-Fax Assistant Installation Error
Mydll_NT: Error in function: dAddPortMonitor, Error code: 126.

After that, the install failed and the MSI rolled back.

I tried a reboot and a few other normal troubleshooting tactics, and it all ended with the same error. I’ve got the Print-to-Fax driver installed on a Win 7 64-bit and another Win 7 32-bit install, as well as an XP box, so I know the thing works. Even tried downloading the installer again and comparison the checksum. Everything checked out, but it wouldn’t install. It’s not a particularly helpful error message, and there’s no information on any sort of manual installation process.

To the Googles! Less than 150 results come back on a search for this particular error. Mostly from Black Ice Online Support, which leads me to suspect that they provided the lower level drivers that MyFax uses. Searching for this particular error specific to MyFax returns nothing.

How Not To Help: MyFax Support

MyFax Knowledgebase

Nothing there of any relevance. In fact, it looks like the latest I can find on any subject was last modified almost a year ago in June of 2010. (Update: by the time I got around to finishing this article, I now see one new knowledgebase post from July 2011.)

Online Chat Support

So, it’s time to contact support. First, I try the online chat. Here’s where it gets interesting.

I’m told that:

  • The Print-to-Fax driver is not compatible with Windows 7 (contrary to information on the MyFax site even showing 64-bit Win 7 compatibility)
  • The Print-to-Fax driver is one of the oldest plug-ins they have
  • That Blackberry, iPhone, and Android apps are out or in the making

None of which helps in the slightest to resolve my situation.

It’s also suggested that I turn off my firewall (which it is), and then I’m given a couple of Google hits on the error, neither of which reference MyFax in any way.

Finally, I’m told that it’s not a MyFax error, and it’s the computer that’s giving me this error. Oh really? So the fact that I get this error when installing the MyFax product means nothing? How about uninstalling it and then reinstalling (except I NEVER GOT IT TO INSTALL IN THE FIRST PLACE!!!!!)? Blerg. Kthxbye.

Phone Support

Let’s see if a phone call nets anything more helpful. What follows is a highly paraphrased conversation.

I’m told by the Tier 1 tech that it’s a driver issue, and that I need to install the driver so that the Print-to-Fax assistant will work. And to try Google. Can I speak to a supervisor? Sure, he says, and puts me on hold.

Me: “Hello Mr. Supervisor? I can’t install your program!”

Supervisor: “Well, Mr. Customer, the ‘dAddPortMonitor’ error is a very common error. You need to install the Mydll_NT.dll in order to get our program to work.”

(Common? ‘dAddPortMonitor’ returns less than 300 hits on a search engine. ‘Mydll_NT.dll’ returns about 600)
Me: “I can’t download Mydll_NT.dll, because it came with your software. I can’t install your software.”

Supervisor: “Oh, you can just go to Microsoft.com or Google and search for it and download it.”

Me: “Yeah, no, I can’t.”

Supervisor: “Well we cannot support the Print-to-Fax assistant until it’s installed at which point we can check settings remotely from our systems?”

Me: “So you’re telling me you sell a product that you don’t support? If I can’t get your product installed, I can’t use your product. What about those Blackberry, iPhone, and Android apps? You’re telling me if I can’t get them installed, that’s my own problem?”

Supervisor: “Basically, yes.”

Me: “Okay, we’re getting nowhere. If you have any play at all with anyone in management, customer support, marketing, or product development, tell them that SOMETHING IS MAJORLY WRONG HERE. *click*”

Finally, a Workaround

I really shouldn’t have to do this, and MyFax support has given me nothing to go on, but I keep troubleshooting the issue. Running msiexec.exe with verbose logging options enabled, I discover that the TARGETDIR variable is ignoring the default path and is dumping all the files in the root folder. Changing the path doesn’t help, creating the path ahead of time doesn’t help, nor does copying the extracted files to the path in the middle of the install. Same error.

For kicks, I try a silent install:

msiexec /i myfaxassistantsetup.msi /q

It works. Why? No idea. Do I really care at this point? Not really. I run a test fax through, and it works. Reboot, and it still works.

What’s Still Wrong

So I got the Print-to-Fax Assistant to install. Yay. However, I don’t think I’d be writing all this if the whole support experience wasn’t so terribly, utterly, horribly, bad.

On one hand, MyFax and the whole internet faxing universe is really just an attempt to hold onto an antiquated technology that really should have been replaced by something better years ago, but amazingly, faxing still exists and Osama Bin Laden doesn’t. But that’s beside the point.

Here’s the thing: I pay for your software. Other people pay for your software too.

Granted, it’s not a lot of money every month, but it’s not like I’m mooching off free software. You’ve got a support page with numerous ways to contact you. But to tell me you won’t support me until I get the program installed…that’s just wrong. That’s like Dell telling me they can’t help me troubleshoot a brand new system that won’t boot up until I can get it turned on.

The installation process is a critical part of the distribution of software. If your program can’t be installed, then people can’t use it, and then it’s worthless. Zero stars rating. Refund.

The least you could have done was taken a note of the issue, given me a ticket number, and then ignore me. At least then I would’ve thought (initially) that somebody cared.

What Can Be Done

Start by fixing your Print-to-Fax Assistant installer.

Windows 7 has been out for two years. Make your software compatible. Simple as that. I downloaded the 64-bit version the other day, and got the same error message on my own desktop, and fixed it by running it through a silent install as above. But that’s a poor workaround. I’ve now had this error on at least four separate machines, so it can’t be just a fluke.

Next, figure yourself out as a company.

With all your buyouts, I count at least five distinct faxing services you offer. I’m not going to bother to list them here, and frankly I don’t care about your other products, because I don’t use them. If you want, consolidate all these similar products into one and then focus on making that product better.

Finally, beef up your support.

Support is your first line when customers are having problems. If they can’t resolve simple issues because they’re uninformed of the solutions, then provide training. Make it better.

Maybe you don’t care

j2 Global Communications, it’s entirely possible that MyFax doesn’t matter to you. Somehow your stocks are still are still up and you’ve apparently got money in your pockets with reported growth over a number of years, but the product I care about seems to be dying a slow and painful death. Since buying Protus in December 2010, you cut 100 employees from the Ottowa office and presumably dumped that workload on other locations. On on the MyFax and related websites, I see the following:

  • 1 new knowledgebase article in the last year
  • The last post on the MyFax Blog is from 7 months ago (January 2011) and as far as I can tell, all the actual content contributors on the blog are no longer with Protus or j2
  • A black hole of tweets between Dec 2010 and June 2011
  • Twittermonials on the main page of MyFax.com shows the last favorited tweet to be 200+ days old
  • Last released dates for the iPhone and Blackberry apps are both over a year old, and both with less than 50% ratings. There’s no Android app at all, and no acknowledgement publicly that they’re even working on an app for this platform.
  • The MyFax What’s New page shows a Fall 2010 Update, and nothing newer.

I could be wrong. Maybe you do want to make MyFax better. Maybe you do want to provide customers with a good experience in the bizarre world that merges the zombie-that-will-not-die that is faxing with this internet world that has Google+ and TouchPad fire sales.

People liked MyFax. Unsurprisingly to me, people liked MyFax better than eFax. This should mean something to you when deciding where to devote your time and attention.

If you do care, then show it.

Sincerely,

Jason Navarrete

Categories
Software

Linux ‘rename’ utility on OS X

(edit 12/11/2012 to add homebrew alternative)

So you you want the powerful Perl-based rename utility that comes with many Linux and *BSD distributions, but sadly not on Apple’s mighty OS X? Well so did I. (Go away you fanboys of all types. I hear not your rants about which operating system is for the win)

Thinking about it for a moment, I realize there’s nothing really stopping me from just taking the script, and thankfully it’s free software and we can pretty much do whatever we need to with it.

The rename utility is tucked away under /usr/bin/ on my Ubuntu machine.  To get it to your OS X machine, it’s just a matter of copying /usr/bin/rename on a Linux box and dropping it in /usr/local/bin/ or somewhere else that’s in your PATH on your OS X box.  If you’re really feeling the need for the man page, you can grab it from /usr/share/man/man1/rename.1.gz.  I stuck the man page in /usr/local/share/man/man1/.

And that’s it! You can now go about using Perl regular expressions to rename multiple files and get lost in everything that is regexp.

Don’t have access to a Linux machine, you say? Oh fine. Here’s what I pulled from my Ubuntu 9.04 distro:

If you download the rename utility from here, you’ll probably need to run ‘chmod a+x’ to give execute permissions to the file after copying it to the appropriate place but otherwise things should be the same as above.

Examples

Wondering how it works?  Say you’d like to rename a bunch of .wav files and prepend the phrase ‘iheartrobots’ to the front of each filename (practical, I know).  Well you’d type the following:

rename -v 's/^/iheartrobots/' *.wav

The ‘-v’ parameter prints the names of the files that are being renamed.  Helpful and I use it most of the time.

Or how about replacing all instances of the word ‘cat’ with the word ‘dog’ in the filename of all .rtf files in a folder? Bam.

rename -v 's/cat/dog/i' *.wav

The ‘i’ at the end of the regular expression makes the search case-insensitive.

Finally, say you had a bunch of files that looked like this: Waltzing.With.Famous.People.S01E09.HDTV.XviD-SYS.[bztv].avi

And you wanted to get rid of everything between S01E09 and .avi, you could use the following:

rename -v 's/HDTV.*avi/avi/i' *.avi

The Homebrew Alternative

Now, thanks to Homebrew, you can skip all this nonsense and just do:

brew install rename

If you’re not using Homebrew, you should be.

More Information

If you’d like to get more information on the rename utility described here, the most obvious place is the man page (man rename) or online here.

Additionally, since it’s a Perl utility, more information on the Perl regular expression pattern-matching language can be found straight from the horse’s mouth.  Regular expressions are a madness unto themselves, but once you get the hang of it, most powerful stuff.