Tag Archives: solution

An easier way to run dscacheutil -flushcache on your Mac (OS X Snow Leopard) to clear your dns cache

Don’t know about you but I am fed up with intermittent “Unable to connect..” messages when I’m browsing the web on my Mac. Its a real pain – my mac is the only device in my house (out of many devices) that seems to have problems connecting to the web.

I’m fed up with having to open a terminal and enter “dscacheutil -flushcache” to get browsing the web going again.

To begin with I got around this by creating a shell script called revive.sh which ran dscacheutil but i got bored having to open a terminal, navigate to the location of my shell script and enter ./revive.sh.

There had to be another way… and there is. I created an Automator App which runs dscacheutil. Now when I get one of those pesky “Unable to connect…” messages I double-click on my app (or an alias for the app) and I’m browsing the web again.

You can download the app here: flushdns.app


When CUPS stops printing ~ lp: Too many active jobs

I got a nasty surprise this morning. I run a batch routine that generates a couple of thousand or so letters from E-Business Suite every night and then prints them – via CUPS –  to a series of networked printers. This has worked since the year dot. It has never let me down…. until that is, this morning when it let me down big style.

The first 500 letters were queued and then subsequently printed. The other 2500 were rejected by CUPS. (I should mention at this point that the letters are printed individually thus each letter generates a print job meaning 3000 or so print jobs should’ve been created and subsequently printed off).

After the first 500 letters went of to CUPS I started to see a message in my application log:

lp: Too many active jobs

I have never seen this message before. Well weird considering the number of print jobs that have gone through the system.

To cut a long story short the solution to my print problem was to change a parameter in cupsd.conf

By default CUPS will queue a maximum of 500 print jobs before rejecting further print requests. To quote directly from the CUPS manual :

The MaxJobs directive controls the maximum number of jobs that are kept in memory. Once the number of jobs reaches the limit, the oldest completed job is automatically purged from the system to make room for the new one. If all of the known jobs are still pending or active then the new job will be rejected.

Setting the maximum to 0 disables this functionality. The default setting is 500.

So I added MaxJobs 0 to my cupsd.conf file, restarted CUPS, did a fairly large scale test (about 1000 jobs sent) and all is well. I’ll update this post at some point as I’ve heard setting MaxJobs 0 can have unpleasant side effects in terms of Memory and CPU consumption.