MySQL in VMWare Fusion

Whatever your development platform of choice, if you work with large amounts of data, you should be running a database management system. In the modern day, high quality DBMSs are available for whatever platform you’re probably using, and some are even available for free. For an important project on which my team is currently working, we have implemented MySQL, in part because it runs on all the same platforms that Mathematica does. Mathematica can interface with it easily, and it comes with decent administration tools. This means that we can program on Windows or Mac and run on either one, transparently.

All of our Macs also have Windows partitions, and we have Mathematica licenses for both. While it is possible to install MySQL under both operating systems, to do so would almost inevitably lead to inconsistencies between the datasets on the two sides. In development, this can complicate debugging, and it’s completely unacceptable in production.

A nice solution is to run the MySQL server under OSX, and to set up the Windows virtual machine as a client to it. This is not hard to do with a virtualization tool like VMWare Fusion, though it is not expressly documented.

To allow the windows account to see the mySQL server on the Mac side, you need to do three things

1. Create permissions on the MySQL server under OSX. For example, create a new account for root, limiting connectivity to hosts matching whatever the windows partition identifies itself as in its network control panel (with wildcards, this often comes to something like win-qae% or win-OFT%).

2. Create a server connection from the client (windows) side. When establishing the connection from windows, you can refer to the Mac by IP address or by its local network name, as appears at the top of the Sharing control panel (Mac-Pro.local in the example below).

sharing control panel

finding the computer's name (also, optionally turning on SSH to allow remote administration)

If you use DHCP, it may be necessary to use a wildcarded version of the laptop’s IP address (e.g. 192.168.%), though this obviously reduces security.

3. In Workbench under Windows, create a connection to a remote MySQL server. This can be pure TCP/IP (which requires you open port 3306 or any other you have set for your MySQL server) or TCP/IP over SSH (which only requires port 22 and encrypts the communication).

This is set up in the Connection Manager (left column, last entry on the WB home screen). Alternatively you can use the New Connection Wizard (click the “New Connection” link in that column).

If you want to be able to administer the database from Windows, including making database backups, you’ll need a couple more steps.

4. Go to the Mac Sharing control panel and enable Remote Login, which turns on SSH.

5. In Workbench under Windows, create a remote “command connection.” This is set up in the Server Instance Manager, which can be reached via the last link in the right column on the workbench home screen. Alternatively you can also use the New Server Instance Wizard.

When you open the server instance manager for an existing server instance, you will see a block of settings titled “Remote Adminstration” or “Remote Management” (select your instance in the left-hand list first). There are the 3 possible type settings (none, win-based, ssh-based) and you need ssh-based for this technique. The SSH hostname is your computer’s name:SSH port number (Mac-Pro.local:22 for example). SSH username is your account name on in OSX.

identify the host for the command connection


set the database connection values


set up remote administration

For the sake of your sanity, do not use the same username for your computer account and your database account. When MySQL asks for the password for user ‘fred’, you need to know which one it’s asking about.

If you have done all these things correctly, it will be possible to query the OSX database from within the Windows partition on the same machine, and to administer the database from either operating system.

Apple Lisa team jacket

Once upon a time, the Computer History Museum was located in Boston, near the tech powerhouses DEC and Wang. It has since moved to the Silicon Valley. Anyway, in 1994 the Museum sold off a few items as a fundraiser, and I picked up an Apple Lisa team jacket.

In 2006, I checked with John Couch, who had been the head of the Lisa project at Apple Computer. He recalled that these jackets had been given to members of the Lisa engineering team as a “thank you” when the design of the Lisa was complete.

Engineering did produce the red jacket as a “thank you” for the completion of the Lisa project. It has words on the back that are now found in the EBC at Apple computer. Not sure about the blue jacket, may have just been a few.

Couch recalled that there were both red and blue versions of the jacket, for the engineering and marketing teams. There is nothing of interest printed on the front of the jacket. Can anybody tell me if the words on the back,


worker
philosopher
stargazer
hero
artist
thinker
craftsman
designer
renaissance man
knowledge worker

are still on the wall of the Executive Briefing Center at Apple? It doesn’t seem like Steve Jobs’s style.

This is the only example of the jacket that I have ever seen.

Bringing an Apple Lisa online

The Apple Lisa operating system does not include a network stack, so there is no way to bring one online in the normal sense (it might be possible under Lisa Xenix, but I don’t have a copy to work with, and the lack of a graphical user interface means it probably wouldn’t be much fun anyway). However, all versions of the Lisa come with a serial port, the Lisa 7/7 operating system includes telecommunications software, and Mac OSX can act as a server, intermediating between the Lisa and the web.

The Lisa will be interacting with the Mac at the “darwin” level, and only software available to the Mac OSX Terminal will work. Therefore, start by installing on the Mac the software you will want available from the Lisa. A few things, including text editors like vi are available by default. I used Fink to set up an irc client and Mutt, which is a mail client.

  1. If you haven’t already done so, sign up with Apple as a developer. It’s free
  2. Download the XCode programming tools.
  3. Download and install Fink, per their instructions.
  4. Install the Fink packages you want; you’ll see irc-ii in the photos below.
  5. In recent versions of the Mac OS, you can set variables and aliases for the Terminal in a file at ~/.profile.

Get a USB-to-serial converter and a null modem. The converter will probably have a 9-pin serial connector, and the Lisa has 25 pins, so you’ll probably need a 9pin to 25 pin adapter too. Connect the USB adapter to the Mac, attach the null modem to the end of that, then stick on the 9-to-25 pin adapter, and finally attach the remaining end to one of the serial ports on your Lisa. Then boot the Lisa.

Go to the Lisas’s preferences, select Device Connections, and tell it there is a remote computer attached to the serial port (make sure you identify the same serial port to which you had attached the null modem).

You may need to reboot the Lisa for it to recognize the serial connection properly.

Then launch LisaTerm, and go to the Setup menu, and the Computer Compatibility item. Set speed to 9600 baud, terminal to VT100, and communication to “On”.

Now we are going to create a slave terminal on the Mac, using a variation on the instructions at http://hints.macworld.com/article.php?story=20070625112404671

  1. Find the device name of your usb-to-serial adapter.

    $ cd /dev
    $ ls tty.*

    Look for the response with a name that mentions USB. On my system, it’s tty.usbserial
  2. Use screen to connect and run getty

    $ screen /dev/tty.usbserial
    Ctrl-A, Shift-: and then exec ::: /usr/libexec/getty std.9600
  3. Switch back to the Lisa keyboard; anything you type into Lisa Terminal now should be sent to the Mac Terminal, with the output displayed on both, allowing you to read e-mail, chat online, surf the web, and do anything else you can do in a Mac OSX Terminal.

When you are finished, you can quit the screen program by typing control-A, then control-\.

The Lisa’s vt100 emulation is pretty lousy, and will produce scrambled output if software tries to place text at specific locations on the screen. Matching the terminal dimensions and forcing the Mac terminal to vt100 mode doesn’t seem to help. It’s good enough for bragging rights, though. Any putz with a credit card can bring an iPad online. The Lisa is something more special.

Resurrecting an Apple Lisa

I own three Apple Lisas, collected in the early 1990s from the closets of people and organizations that no longer wanted them. The collection includes a Lisa 2, a Lisa 2/5 and a Lisa 2/10 (slash Mac XL, the hardware was identical). At one time all three worked, but the Lisa 2 broke down about 15 years ago and I haven’t used any of them since. David Pogue recently published a piece commenting on the tenth anniversary of his technology column in The New York Times, saying that we should “forget about forever, nothing lasts a year.” Allowing for a certain amount of hyperbole, this may be true in a commercial sense — technology and standards are quickly replaced. However, we have nothing to celebrate in this constant obsolescence.

I refer not only to the waste associated with constant upgrading, but to the lack of character associated with new gadgets. People think they define themselves by their purchases, but anybody with a credit card can get an iPhone. The only objects that really express our characters are the ones we make ourselves, or have made for us. And while not quite so distinctive as something you’ve made yourself, objects abandoned or unappreciated by others, but kept vital through your efforts, say a lot more than any new portable computer/laptop/notebook/netbook/handheld/tablet/whatever.

I sometimes print with a 1983-vintage “letter quality” printer. I doesn’t have a sheet feeder, so I’m forced to keep letters short. And last night, I decided to try to bring the Lisas back to life. In an initial survey, it looks like one of the three power supplies still works (1.8 amp, luckily; the 1.2 amp models were never great even at their best). The dual parallel port card works. One of the internal hard drives works (10Mb), as does the external profile drive (5Mb). The third drive fails with “error 82.” Unfortunately, I have no application software on the working internal drive, just the Lisa “office system” operating system, and the external profile is blank. So I either need to bring the third hard drive back to life, or create Lisa floppies for reinstalling the “7/7” application suite and hope I have a working floppy drive, or use an x/profile drive replacer. I have not yet been able to get a keyboard to work with the one working machine, so I either have bad keyboards or something wrong inside the box where keyboard input is processed.

Apple Lisa

Apple Lisa 2/10, November 2010

If I can install LisaTerm, get a keyboard working, and secure the appropriate cables, I will bring the Lisa online as a terminal. Pogue may say nothing lasts a year, but it will soon be 28 years for this machine and I think I can make it work.

Mental defectives, part ii

I did on a previous occasion write about the seemingly powerful relationship between the number of radios in the U.K, and the number of registered mental defectives in that country. In Google books, I recently found a 1958 book titled Principles of Statistical Techniques, which contains examples based on that remarkable dataset, the number of mental defectives in England and Wales.

The passage in question uses the “mental defectives” data from 1935 through 1946 to illustrate the ability to mislead through the use of graphs and charts. The graphs below are courtesy of Mathematica but closely replicate those in the original text.

In[]:= mentalDefectives = {{1935, 86086}, {1936, 88060}, {1938,
92299}, {1939, 99144}, {1940, 101364}, {1941, 100876}, {1942,
98125}, {1943, 98434}, {1944, 99608}, {1945, 102225}, {1946,
102390}};

In[]:= ListPlot[mentalDefectives, PlotRange -> {86000, 102500},
AxesOrigin -> {1934, 86000},
AxesLabel -> {"Year", "Number of\nmental defectives"},
AspectRatio -> 2, PlotMarkers -> {Automatic, Small}]

tall skinny graph

In[]:= ListPlot[mentalDefectives, PlotRange -> {0, 120000},
AxesOrigin -> {1935, 0},
AxesLabel -> {"Year", "Number of\nmental defectives"},
PlotMarkers -> {Automatic, Small}]

wider graph

As explained in the original text, “The impression obtained from the first graph is that there was a staggering rise in the number of mental defectives in little more than a decade, whereas the second graph gives the impression of a much slower and more gradual increase. These rather different impressions are obtained, of course, by tampering with the horizontal and vertical scales used. . . . it is essential to recognize the importance of supplying graphs, as well as tables, with full and clear labelling and if possible, the source of the information.”

Frankly, their efforts seem pretty basic. We could further steepen the first graph through population adjustment, adjustment for number of doctors, and other techniques.

In googling for more on this remarkable dataset, I found letters to the editor of The British Medical Journal in which one R.A. Gibbons of London, S.W., argues that forced sterilization of mental defectives is not sufficient to protect “the race,” and that it is necessary to sterilize also those people who “from pronounced family history” are certain to “produce idiots.” Dr. Gibbons apparent delivered a paper on this topic to the Obstetrical Section of the Royal Society of Medicine and had in published in the Journal on March 18, 1922. In this letter, he refers to “over 12,000 registered mental defectives for whom [British citizens] are taxed.”

The reference to taxation feels terribly modern (“certainly their plight tugs at the heartstrings, but you just can’t care for everybody and it wouldn’t be fiscally prudent to allow them to run amok.”)

Germany is most famous for eugenics programs, but similar sterilizations of mental defectives were taking place in the United States in the early and mid 20th century. I’ll leave that for another post.