Category: Mac OSX


#!/bin/bash

servers=( pop.bizmail.yahoo.com smtp.bizmail.yahoo.com forums.sybase.com )

for server in ${servers[@]}
do
  # declare that variable ip_addresses is an array.  not strictly needed but makes it a bit more readable IMHO
  declare -a ip_addresses

  # read has the capability of stuffing an array (ip_addresses) with the tokenized STDIN.  The three less than signs "< <<" tells BASH to redirect the stdout output of the following statement.
  read -a ip_addresses <<< $( host $server | awk ‘ $3 == "address" { print $4 }  ’ )
 
  for ip in ${ip_addresses[@]}
  do
    sudo route add -host ${ip} gw 192.168.0.1 dev bnep0
  done
done

We can see the output of the script:

pop.bizmail.yahoo.com is 68.142.224.70
pop.bizmail.yahoo.com is 209.191.119.134
pop.bizmail.yahoo.com is 68.142.198.20
smtp.bizmail.yahoo.com is 206.190.48.12
smtp.bizmail.yahoo.com is 68.142.200.11
forums.sybase.com is 192.138.151.106
Adrian Bridgwater

Adrian Bridgwater

Migration migraines: the top seven DBA data headaches

Posted by Adrian Bridgwater

Once or twice a year I get to work with an excellent DBA pal from Illinois called Jason Froebe who describes himself as a, “Perlmonger capable of speaking fluent munchkin.” His personal blog is called Ramblings of a Geek, but I keep telling him he should rename it “Froebe’s Frontal Lobe”.

read more at ZDnet…

The work that Adrian mentions is a last minute article for the International Sybase User’s Group that I wrote and he edited.  The benchmarking article that many people are waiting for is being held up by several groups giving their approval for the release of the material.

As always, it is a real pleasure to work with Adrian :)

Here’s the scenario:

You ssh to a remote server with your login and either sudo or su to another user to run some application that uses a X Windows front end.  There is a firewall between your desktop and the remote server that allows only ssh connections (port 22).  When you run into the error “Xlib: PuTTY X11 proxy: wrong authentication protocol attempted”.  What to do?

ssh jason@remote-server -X
jason $ echo $DISPLAY
localhost:10.0
jason $ su – oracle
oracle‘s Password:
oracle $ xterm
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
xterm Xt error: Can’
t open display: localhost:10.0

On recent OpenSSH Server releases, you can simply enable “ForwardX11Trusted yes” in the /etc/ssh/sshd_config file and restart the OpenSSH server.  If you’re not using a recent OpenSSH Server release or if you can’t for security or political reasons, what could you do? Give up? It’s simpler than you think.
You need to temporarily transfer the authorization to the other account. First, get the key from your account:

jason $ xauth list
aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Next, sudo/su to the other account and add the authorization key.

jason $ su – oracle
oracle $ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc334c66cfec3c5c3d5b0efc4ee9d3ad

Now, you should be able to start any X Windows application, assuming that your DISPLAY variable is set to go through the ssh tunnel:

oracle $ xterm

When Alasdair Allan, Thomas Boch, Mike Fitzpatrick, Luigi Paioro, John Taylor, International Virtual Observatory AllianceMark Taylor and Doug Tody of the International Virtual Observatory Alliance (IVOA) wrote up the draft specification to the Simple Application Messaging Protocol, Alasdair Allan deemed it possible and necessary to implement the draft specification.

SAMP is a messaging protocol that enables astronomy software tools to interoperate and communicate. IVOA members have recognised that building a monolithic tool that attempts to fulfil all the requirements of all users is impractical, and it is a better use of our limited resources to enable individual tools to work together better. One element of this is defining common file formats for the exchange of data between different applications. Another important component is a messaging system that enables the applications to share data and take advantage of each other’s functionality. SAMP is intended to build on the success of a prior messaging protocol, PLASTIC, which has been in use since 2006 in over a dozen astronomy applications and has proven popular with users and developers. SAMP is an IVOA-endorsed standard that builds on this success. It is also intended to form a framework for more general messaging requirements. – excerpt

Alasdair chose to work with Perl for his implementation of the draft specification. What I Alasdair Allanfind interesting, is that while it is designed for astronomy tools, it is generic enough for it to be implemented outside of that scope.  (pun intended)  I can easily see it being used as in a data federation type application.  The protocol is XML-RPC based and is easily understood.

Great work! :)

Oh, you want to know what he has called his Perl implementation?  It’ll cost ya!  Just joking..  it is called Perl::Samp and consists of:

  • SAMP::Transport::HTTP::Daemon
  • SAMP::Discovery
  • SAMP::Hub
  • SAMP::Hub::Util

Perl::Samp requires you to install the following modules from CPAN:

At the time of this blog post, it is not on CPAN but Alasdair is willing to put it there.  Let him know if you wish it to be on CPAN.

What I would love to see is native support for SQLite. http://www.sqlite.org

It is the most installed embedded database on the planet hands down.  Don’t believe me?  You know that Firefox web browser, Thunderbird newsreader, most Adobe products, Miro, etc all have it embedded?  – reference http://www.sqlite.org/mostdeployed.html

We use it extensively at work as:

  1. staging for mass data imports/exports/conversions
  2. local application ‘cache’ for large data sets
  3. projects that don’t require all the features of Sybase ASE (or Oracle for that matter)

One of the best features is that the database itself in platform independent… copy the db on to AIX from your Windows box … then on to your old Amiga … then on to your windows mobile device.  Getting the point?  :)

I really wish Sybase would make it so that the Sybase ASE databases were truly platform and character set/sort order independent… but that is in another dream ;-)

Not a blurb in the PowerDesigner/PowerBuilder manuals or anything