Thursday, 9 February 2012

Deleting all print queues on OS X using Command Line

So, here's a little script which deletes all the print queues on OS X. I run it through Apple Remote Desktop's "Send Unix Command" as root:


for printer in `lpstat -a | awk '{print $1}'`
do
echo Deleting $printer
lpadmin -x $printer
done

We're moving our print server to a UniFLOW system and so I need to get rid of all the print queues and add new ones (adding them through Workgroup Manager).

Thought I'd make a little pkg file which I can send to all machines through ARD Task Server. I did it through Iceberg. Here's a few screen shots of it with notes:

Adding a preflight script to run

This is the script which runs on preflight


Simple really, but works.

Installing UniFLOW client on Mac OS X 10.6 and deploying it

So, we're going to be using a UniFLOW system for our print management. Everythings working fine, just need to deploy it to all the Apple Macs under my control.

Simply set up the printers on one machine. Load up Workgroup Manager and add these printers to whatever managed computer lists you have (but make sure the managed computers have the drivers installed first!)

Next is to install the client. Luckily it comes as a mpkg file! Just have to set the preferences to pick up the right server and settings

From what I can find the settings are in a plist file:
~/Library/Preferences/com.NT-Ware.UniFLOWMacClient.plist

Although In this file there were only a few things:

TEST
aaa

Doh!

But I have also found:
~/Library/Preferences/ByHost/com.NT-Ware.UniFLOWMacClient.001b6399ade5.plist

Which contains:





LogFileName

LogonNoName

PopupForEveryJob

Reditect

ServerName
put.your.server.dnsname.here.com

(it didn't put all of the "<" and ">" things in!!

Result. Not sure what the "ByHost" folder is all about. I might look into it if just getting this plist file and putting in workgroup manager doesn't work.

So, I saved this file in the ByHost folder as ~/Library/Preferences/com.NT-Ware.UniFLOWMacClient.plist and added it to the Workgroup Manager - Managed Groups - Preferences - Details tab and set it to "Always".



Now when I load up the UniFLOW - MacClient app it comes up with the right server!

But for some reason it hasn't popped up when printing. Might be to do with the user. I'll try my login.......
.... yep worked a charm.

Just emailing the guy in charge to see if he can set up my test user the same as myself (I think the main thing to do is change the threshold for when the user gets notified).

Yep, turns out the test user account didn't have any budget or anything. Now he's sorted the account out, everything works fine!

Friday, 27 January 2012

Apple Remote Desktop Task Server trouble

Just after rebooting the xserver I noticed an error in the logs made by ARDAgent:

Jan 27 14:20:19 Xserve ARDAgent[460]: Bind error on TCP port 3283.  Error number: 48 Address already in use

Looking at remote desktop on my machine I noticed it was having trouble communicating with the task server. I tried restarting the ARD service to no avail.

I looked through some more logs as it appeared that something else had taken that port. The only logical things would have been iChat and another VNC service running. I checked IChat out and it wasn't running. I did find another log entry just after reboot, but before the ARD error which was registered to OSXVNC. Sure enough this was running. I shut down the service and made sure it wasn't starting up any more at startup.

As soon as this was done the task server was back up!

Xserver OS X 10.4.11 no ping

We've been having this problem where the server doesn't return a ping for some time. The work around is to simply unplug the network cable and plug it back in. I have noticed on two occasions (I didn't check the other occasions) that in the system log:


Jan 27 14:38:44 Xserve servermgrd: servermgr_dns: no name available via DNS for 172.25.1.81
Jan 27 14:38:44 Xserve servermgrd: servermgr_dns: no reverse DNS entry for server, various services may not function properly
Jan 27 14:38:44 Xserve servermgrd: servermgr_dns: gethostname() doesn't match the configured name - use changeip to repair

It might be worth running this "changeip"

Tuesday, 24 January 2012

OS X 10.6.6 Printer Queues won't open

After trialing the UniFlow MacClient popup (not currently working though) I noticed that when a print job was sent to a queue the little printer icon would not appear on the dock. I did notice it on local logins but my login is from Active Directory.

After a little investigation it was noticed that the printers in my ~/Library/Printers I was getting a large list of duplicate printer names:



This was a permissions issue. I made a symlink to a local folder:
ln -s /Users/Shared/localPrinterFolder ~/Library/

I logged out and back in and printers were opening like a dream.

Monday, 23 January 2012

JQuery sliders to control image sizes on a webpage

I'm currently making a web gallery and want users to be able to resize the gallery to their needs. I did a quick search on Google and found this:

http://webdesignledger.com/tutorials/create-a-resizable-image-grid-with-jquery which has this as a demo:

Looks quite good, although I noticed it also increases the gaps between the images which I would prefer to control. But might be worth tweaking!

I've had another look and also found this which looks remarkably similar:

http://agilepartners.com/blog/2005/12/07/iphoto-image-resizing-using-javascript/

It gives a nice little tutorial on what you have to do.

Monday, 16 January 2012

HP ZR24w blank black screen

Just seen a nice HP ZR24w screen which is just showing black. The on light is always on and won't switch off unless it is unplugged. As soon as you plug it back in again the light comes straight back on.

A strange thing happens when you turn it off. For an instant, it displays whatever it is suppose to display, in this case the computers desktop.

After a little searching on the internet I found this forum which describes all the mentioned symptoms. The only solutions anyone has is to send it back.

Fair enough.

An Update......

Rang Jigsaw from whom we bought it, they said ring HP. Rung HP and they sorted it out next day! I was very impressed! (they just replaced the monitor)