Archives for: July 2012

Command line to show installed office 2004 version

16/07/12 | by admin [mail] | Categories: Mac OS X

This is not fool proof, but seems to work pretty well:

ls -1rt /Applications/Microsoft\ Office\ 2004/Updater\ Logs/ | tail -n1

It will give output like:
11.6.2 Update Log.txt

it just gives you the newest file/folder in the Updater Logs

Get application version from command line

16/07/12 | by admin [mail] | Categories: Mac OS X

This works with many applications. Most applications are .app bundles, and have an Info.plist with the version number. You can pull this out directly with PlistBuddy (if you know the key name).

With some apps, you need to know also where to look.

/usr/libexec/PlistBuddy -c "Print CFBundleVersion" /Applications/Microsoft\ Office\ 2008/Office/MicrosoftComponentPlugin.framework/Resources/Info.plist

Handy, if you want to do a bulk update, but want to know which packages to install first, or which computers need updating.

ASR multicast restore

16/07/12 | by admin [mail] | Categories: Mac OS X

Full article here

You do this from terminal. So you can do it from at least 10.4+ install media.

You will need an image (dmg) ready, and accessible from the computer running asr. First prepare the image with:

asr -imagescan image.dmg

For unicast, you can now chuck the image on a share and run:
asr -source afp://fileserver.example.com/image.dmg -target /Volumes/MacintoshHD -erase

The tricky bit:
You need to create a plist config file. It needs bugger all inside it, but is a necessary step.

Two keys are required—Data Rate and Multicast Address—but additional keys are supported to specify functionality. You can create it in property list editor, or just fire up pico and make sure you create all the necessary headers by hand.
It should look something like:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Data Rate</key>
        <integer>600000</integer>
        <key>Multicast Address</key>
        <string>224.77.2.121</string>
</dict>
</plist>

Now you have created the plist, you can start your asr multicast server

asr -source multicastimage.dmg -server configuration.plist

And from the client computers, you can join the multicast with:

asr -source asr://myserver.com -target /Volumes/MacintoshHD -erase

The rest of the article discusses sensible network considerations (multicast traffic is something which needs to be managed carefully), and GUI front ends (what's the point? ;) )

Logout user via terminal

16/07/12 | by admin [mail] | Categories: Mac OS X

Yes, sometimes you need to log people out (tidily), and sometimes you don't have access to their screen. This is a one liner that does it.

/bin/launchctl bsexec $(ps -xawwo pid,command | grep "/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder$" | awk '{print $1}') /usr/bin/osascript -e 'tell application "System Events" to log out';

Taking it apart, we are using bsexec option of launchctl to execute the osascript in the same "Mach bootstrap namespace hierarchy" as Finder. The whole middle bit (the bit in $(...)) is just doing a ps, grepping out the Finder process, and then awking the pid for the Finder process. What if there are multiple users with Finder processes? Then it breaks. But really, how often does that happen.

Please don't ask me what a "Mach bootstrap namespace hierarchy" is. The basic idea, is that if you just try to the osascript to log out, the osascript won't reach "System Events" (which belongs to Finder), and it doesn't work.

Now, the quick and dirty way to do this is to kill the loginwindow process. But that doesn't prompt users to save work, or close out apps properly or any of the other house keeping that actually Logging Out is meant to do.

Also, using AppleScript (via the terminal's open scripting architecture support) to quit Applications is handy:

osascript -e 'tell application "Microsoft Outlook" to quit';
osascript -e 'tell application "FireFox" to quit';

Cisco console to Mac?

16/07/12 | by admin [mail] | Categories: Mac OS X

So, Cisco being an old and venerable company, have a few quirks. One of these is the use of serial console cables. Basically, an RS-232 dealio. You remember RS-232? If you owned a computer in the 80s or early 90s, likely you had an RS-232 port and probably used it once or twice. They used to have lots of cool stuff, including Modems. Which was a good thing, since it meant that you didn't need to worry too much about what flavour computer you had. RS-232 is pretty simple, easy to implement in hardware and software and thus ubiquitous.

On the Amiga, I used the serial port for two things: MIDI (it's nearly the same thing as RS-232, except a slightly odd clock and some optical isolation, and a different pin out), and hooking up the dial up modem.

The serial port was also popular among hobbyists and in industrial automation. Many computers also used the serial to output debug info during POST. Sun boxes used (still use?) serial for initial set up and configuration.

So, a venerable history. The downside is that its large form factor and low speed mean that it has lost favour with computer manufacturers. It has become a challenge to find a laptop with a real Serial port.

But Cisco still use it as the connection of last resort on the bulk of their products. They've designed their system with the assumption that if you can get access to the serial port, then you are legit. This means that if you've stuffed up your conf, or need to unlock someone elses (perhaps you like 2nd hand gear), then you may well have to resort to that serial cable.

So, you can hook it up to a PC (or something else) with a 'real' serial port, or use one of the known working USB to RS-232 dongles.

From memory, the only 'Mac' products Apple ever supplied with genuine RS-232 ports were the Xserves. And yes, you can use the serial port on an Xserve to hook up a Cisco console cable. And why not? (Apart from the fact that the newest Xserve is years old). In all likelihood they are living together in a rack somewhere.

It also possible to use one of the known working USB to RS-232 dongles with a Mac.

And how to fire it up and get it working? Well, on an Xserve running 10.5:

Code:

/usr/libexec/serial/SerialTerminalSupport stop
screen /dev/cu.serial

Or if you have a Keyspan USB to RS-232 adaptor:

screen /dev/tty.KeySerial1 9600

Of course, there's more.

Routing email to another (internal) host via Postfix

16/07/12 | by admin [mail] | Categories: Networking, Mac OS X

This is the kind of thing that you'd assume that Postfix could do, after all Postfix is all about mail delivery. In essence, this is analogous to web proxying. The request comes in to the front end server, and it passes it onto a relevant back end server. The only question is how. Well, browse your /etc/postfix and there's a file called transport.

This is a brief except from the Transport file in /etc/postfix/ on Mac OS X 10.6

Code:

# TRANSPORT(5)                                                      TRANSPORT(5)
#
# NAME
#        transport - Postfix transport table format
#
# SYNOPSIS
#        postmap /etc/postfix/transport
#
#        postmap -q "string" /etc/postfix/transport
#
#        postmap -q - /etc/postfix/transport <inputfile
#
# DESCRIPTION
#        The  optional  transport(5) table specifies a mapping from
#        email addresses to message delivery transports  and  next-
#        hop  destinations.   Message  delivery  transports such as
#        local or smtp are defined in the master.cf file, and next-
#        hop  destinations are typically hosts or domain names. The
#        table is searched by the trivial-rewrite(8) daemon.
#
#        This  mapping  overrides  the  default   transport:nexthop
#        selection that is built into Postfix:

So, what do you do?

Use the /etc/postfix/transport
edit and add at bottom in format:

domain1.com smtp:exchange1.mydomain.local
domain2.com smtp:exchange2.mydomain.local

postmap /etc/postfix/transport

reload postfix

Bam!

The example is for routing mails for domain1.com to smtp service on exchange1.mydomain.local and correspondingly for domain2

FileMaker Pro Trial links

16/07/12 | by admin [mail] | Categories: Mac OS X

FileMaker Pro Trial

So, FileMaker Pro is a database management system and 'rapid application development environment' a la Microsoft Access.

Its big strength is the ability to rapidly develop database solutions. Its weakness is that as a database system it lacks most of the enterprise functionality that you'd want, like clustering and WAN performance and a web limit of 100 connections (that can't be right, surely). It also encourages rather sloppy development. Since, it is so easy to develop, it's all too easy for a simple project to turn into an unwieldy monster. Great if you are being paid to develop, not so great for anyone else in the stream…

But I digress.

FileMaker provides demo/trial versions of its software, and for the most part these demos can be turned into fully fledged versions of the actual software just by entering the license key.

So, the trial versions are handy if you have a license key but no working media. Not an uncommon situation.

It's very easy to get the current trial version, since Filemaker plasters links to it all over the place, but try to find a link for a previous version! Oy vey! What troubles.

But since I am so elite, it's not a problem to track down links.

So I present to you links for versions 6 to 11.

http://fmdl.filemaker.com/TBUB/fm/6/MacOSX/fm_60v1_osx_trial.sit

http://fmdl.filemaker.com/TBUB/fm/6/Win/fm_60v1_win_trial.zip

http://fmdl.filemaker.com/TBUB/fm/6/Mac/fm_60v1_mac_trial.sit.bin

http://fmdl.filemaker.com/TBUB/fm/7/MacOSX/fmp_7v3_trial_mac.sit

http://fmdl.filemaker.com/TBUB/fm/7/Win/fmp_7v3_trial_win.zip

http://fmdl.filemaker.com/TBUB/fm/8/MacOSX/fmp_8v1_trial_mac.dmg

http://fmdl.filemaker.com/TBUB/fm/8/Win/fmp_8v1_trial_win.exe

http://fmdl.filemaker.com/TBUB/fm/8five/fmp_8.5v1R1_trial_mac.dmg

http://fmdl.filemaker.com/TBUB/fm/8five/fmp_8.5v1R1_trial_win.exe

http://fmdl.filemaker.com/TBUB/nine/v3/fmp_9.0v3R3_trial_mac.dmg

http://fmdl.filemaker.com/TBUB/nine/v3/fmp_9.0v3R3_trial_win.exe

http://fmdl.filemaker.com/TBUB/ten/fmp_trial_all_10.0.1.93.dmg

http://fmdl.filemaker.com/TBUB/ten/fmp_10.0.1.89_trial_fm.dmg

http://fmdl.filemaker.com/TBUB/ten/fmp_10.0.1.89_trial_fm.exe

http://fmdl.filemaker.com/TBUB/eleven/fmp_trial_fm_11.0.3.312.exe

http://fmdl.filemaker.com/TBUB/eleven/fmp_trial_fm_11.0.4.401b.dmg

And this is a link for FileMaker Pro Advance 12.

http://fmdl.filemaker.com/maint/107-85rel/fmpa_12.0.1.183.dmg

Bonus:

FileMaker Server 9, 10 + 11

http://fmdl.filemaker.com/TBUB/nine/v3/fms_9.0v3_trial_win.exe

http://fmdl.filemaker.com/TBUB/nine/v3/fms_9.0v3_trial_mac.dmg

http://fmdl.filemaker.com/TBUB/ten/fms_10.0.2.206_trial.dmg

http://fmdl.filemaker.com/TBUB/ten/fms_10.0.2.206_trial.exe

http://fmdl.filemaker.com/TBUB/eleven/fms_trial_11.0.4.404.dmg

http://fmdl.filemaker.com/TBUB/eleven/fms_trial_11.0.3.309.exe

Bento:

http://fmdl.filemaker.com/TBUB/bento/bento_3.0.4.13491.dmg

http://fmdl.filemaker.com/TBUB/bento/bento_1.0v1_trial.dmg

http://fmdl.filemaker.com/TBUB/bento/bento_2_trial.dmg

http://fmdl.filemaker.com/TBUB/bento/bento_2.0.5.10422.dmg

http://fmdl.filemaker.com/TBUB/bento/bento_3.0.5.17444.dmg

http://fmdl.filemaker.com/TBUB/bento/Bento_4.1.1.28150.dmg

System Administration

July 2012
Mon Tue Wed Thu Fri Sat Sun
 << < Current> >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Categories

XML Feeds

What is RSS?

powered by b2evolution free blog software