Showing posts with label systems. Show all posts
Showing posts with label systems. Show all posts

Wednesday, 26 October 2011

John McCarthy

I wanted to write down a few remembrances of JMC: He was colloquially known at SAIL as just "J M C", not John, not Professor McCarthy. He was at the lab daily and often at night -- his office was in the front of the building. When I first started "flirting" with the AI lab during high school, I was afraid he'd toss me to the curb if he would discover that I was just a high school student. But I believe he just didn't care. In fact, the lab machine would allow you to create an account just by logging in.

When I worked for the computer music project, I saw him often. My most salient memory is when he came into my office (I shared with Bill Gosper and Mike Farmwald) to ask about the radical left poster next to my desk. He wanted to know if I believed whatever was on the poster. I didn't, but I liked the sort of visual style. He said, "OK, I just wanted to know" and walked away. (For those who don't know, JMC took a decidedly right wing turn during the 1970s. Given the background of his parents, that's a remarkable trend).

I can't really separate the contributions of JMC and Les Earnest towards the ultra cool working environment of the AI Lab. To this day, I don't know whether it was the fact that I was fresh out of college or whether it was just a cool place that made the AI lab so special. One must acknowledge that JMC approved of the computer music people coming in over night to use the machine. Without this approval, would computer music have progressed so fast? John Chowning and company depended on this largesse.

McCarthy's contributions to computer science are well known and don't bear repeating. But I'd like to mention two of them in particular: The first is timesharing. As I understand it, the reason the PDP-1 could timeshare was that the drum (not disk, drum) had the ability to read and write simultaneously. So, when the current running user was swapped out, the entire memory was written to the disk while the next user was read in! Second, Markoff's obituary in the Times points out that McCarthy invented Garbage Collection of memory. What a concept!

JMC clearly had a potent vision of that was possible with computers: he sponsored research in AI but also sponsored the system research that would propagate from the lab. So, while we remember McCarthy and Lisp, we should also remember his creation of the Stanford AI Lab and all that came forth from that place.

Saturday, 15 October 2011

Dennis and language design

I hadn't intended on writing this entry until Rick Floyd posted about Dennis Ritchie's fine and sparing taste. This brought to mind the influences of language design on C and (by extension) C's influence on further languages.

C's history is well known: it is descended from 'B', which is completely unknown. However, we can look at BCPL. BCPL is a descendant of CPL, which was designed by none other than Christopher Stratchey (talk about an illustrious family, the Stratcheys are amazing). A look at CPL is illuminating: if you know BCPL, then you can see the providence right there. For an example, see his checkers program by Peter Norvig's.

However, CPL was less real than BCPL. BCPL was designed by Martin Richards at Cambridge in 1967. It had a number of interesting features: First, it was designed to be portable over different machine architectures. Second, it's fundamental data type was the machine word. For an assembly language programmer like myself, this was heaven: I could write algorithms and imagine the assembly. Furthermore, the structure construct included both words and bits --- thereby providing an immediate mapping to the machine architecture (device drivers and other machine dependent code). BCPL was the first language for the Alto (which is where I learned it).

So, back to C. What did Dennis to do Ken's version of BCPL? Well, the first thing you have to know about Ken is that he codes fast ... And I think he hates to type. Ever wonder why the Unix kernel has so many short names? Blame Ken. So, then Dennis had to create a spare notation to match. But I think the most noteworthy change was going from words to data types. C goes away from the machine dependent side by incorporating types of Algol 60 lore --- except not making the mistake of calling floats reals. Now, I would be remiss if I didn't mention how C imported bits of the PDP-11 assembler syntax: Ever wonder why autoincrement is ++? Don't. But perhaps the key innovation was the use of the address and de-address operators (& and *). Now you can talk about pointers.

C has undergone many changes since I first learned it at Berkeley reading the Sixth Edition Code. But since I already knew BCPL, it was an easy move. Let me add that I've always loved the for statement in C (even though as a language guy, I know you shouldn't really have more than one way to say something). When you see a for loop used to traverse a list, then you know that's clever.

It's interesting that people mention Java as a descendant of C. If anything, from my perspective, Java is the anti-C. It's way more verbose and eliminates pointers. There are of course many other changes but C is pretty far from Java in my book. And then there's C++, C# and Objective C. They all include the name 'C'...

I wanted to add a personal note about Dennis: He was very private. I certainly knew very little about him during my time in 1127. I do remember when I first got there and a bunch of us were going out to dinner. I stopped by to ask Dennis if he wanted to go. He politely declined. When I reported this to my companions, they said "Sure, Dennis always eats at home with his parents". That's the kind of guy Dennis was. Nice, quiet ... and clever.

Sunday, 20 March 2011

Godzilla vs. the smog monster

If I haven't blogged since December then you know it must have been a dark and depressing winter. However, spring is in the air... So, how is web serving from home? Well, I wish to report that openbsd is a great system. It is still up (actually 147 days and counting). As for those shitehead script kiddies, no, they haven't given up. I watch as they hit the machine with constant root password attacks. What they don't know (as ignorant script kiddies) is that root ssh logins are completely disabled. They might as well bang their head on a wall. They've also attacked every user name in the book. But if you only do it once, you're not likely to succeed. Also under attack is the samba server --- but once again, I was (unusually) detailed and prohibited connections from anywhere outside the local network (that's 192.168.1.*). Same goes for nfs. Losers.

I have to say, I was tempted to install a "honeypot" on a new guest account. But better sense prevailed.

I also monitor the access to web pages --- this tells me what people are looking at. Once again, I find that my test equipment pages are popular. So, I took a few hours to update them a little. I also discovered various errors by monitoring the logs. So, I fix them now and then. I got tired of seeing errors when the spiders came along so I put in a robots.txt and also a favicon.ico (the latter is that little icon that shows when you load a page). Since the official webmaster is Fishy, the little icon is of Fishy (of course).

openbsd has proven to be an excellent choice. Robust, secure and it's a fast system even though it's on an obsolete sun system. What I really need now are gigabit switches. Soon...

Wednesday, 8 December 2010

Web serving from home (Part 2)

As related in the previous post, I installed a clean version of OpenBSD on a Sun Netra T1. With all the daemons running, I decided to put it on the web --- if I could. After all, this means I have to open port 80 (http) and since we had switched to FiOS I didn't know if I could do this.

So, I logged into the router and set the security to nothing. I then realized I could put the new machine (shieldaig, named after a small coastal town in Scotland) in the DMZ. This is a more secure idea than exposing all of our machines to the wild wooly world. But, to do this meant I had to have a static address for shieldaig. That was easy enough to do ... but then I didn't have a local name! Why not? Because... in order to register the machine with the local DNS server at the router, I have to use the DHCP server. But, for once I remembered how I'd solved this problem: aliases. shieldaid has two addresses: one static, one dynamic. The static one doesn't have a name, so that's OK. Back to the router: I put the new static address in the DMZ field. I now checked that port 80 was open. It was!

So, what's the name of this machine? That's the question. Since I'd paid for kahrs.us what I needed was a DNS mapping from this name to it's IP address. I found a free DNS server --- but now the problem was how to make the DNS address point to the IP address. It took me several days of off and on tinkering to realize that the DNS server had to be all on the free DNS server. Once I did that, then the free DNS server was happy and accepted my IP address.

Now, I have to mention that FiOS has Dynamic IP unless you want to pay big bucks. It's just another layer of DHCP above our router after all... So, this means our address could change. But it appears that Verizon has set a huge timeout for the Dynamic DNS, so thus far I haven't had to reset our DNS address. Cool.

One last thing: I was trying to figure out why going to www.kahrs.us didn't work from outside. Well, turns out it gets mapped to shieldaig.kahrs.us and unless that's in the DNS entry as well, it won't work. Simple fix again.

At this point, shieldaig was now on the web. And lo and behold, immediately it was under attack. The samba server was hit constantly but since the addresses weren't local, it just failed. Then there's the constant script kiddy attacks on the sshd daemon. If it weren't so funny, I would love to trap them. I watch the logs that show constant login attempts to root (which is disabled via ssh) and then also watch as they march up the alphabet trying name after name.

I also see what's going on with web access. The machine has been found by both google and yahoo (yahoo was first). I'm wondering when random web accesses will start... thus far it's only been people who we know.

The last conundrum is why accessing www.kahrs.us fails locally but succeeds outside. I've just put this as a DNS question and decided that it doesn't really matter.

My final step was moving the machine down to the basement to live next to the router. Thus far, OpenBSD has been rock solid. And the shitehead script kiddies are deeply unsatisfied. Excellent!

Saturday, 4 December 2010

Web serving from home (Part 1)

In an earlier post, I mentioned that I was going to lose my long time web home at caip.rutgers.edu --- Since I was long gone from caip, I suppose it was about time. So, what was I going to do for a replacement? I decided maybe now was the time to take it into my own hands...

Sometime earlier I had acquired a Sun Netra T1 as a possible web machine. I had an X1 in mind, but the T1 was certainly cheap enough. It's packaged in a nice 1U box and has a very simple interface to the outside world. Two ethernet ports, a serial port and that's about it. My machine didn't have a disk but included one sled. Good thing. I happened to have a stockpile of 40 GB disks, so I installed it in the machine. Good, what next? Software, that's what. I decided to go for OpenBSD because (a) it's a BSD derivative and I know BSD from my grad skool days (b) The price is right (c) it's said to be very secure. But how do I get it onto my disk? Fortunately for me, I had torn apart a PC and had a CD-ROM available. So, I plugged it into the second IDE slot and powered the machine up. Oh yes, and connected the serial port to my lab PC.

The machine came to life easily enough but proceeded to put my in the Sun Lights Out Monitor (LOM). The LOM is yet another supervisor layer for the machine --- reminds me of the PDP-11/45 used on the PDP-10/L ... So, the problem was as soon as I told it to boot from the cdrom (in the console) then it would complain about the Fast MMU error. I'd seen this before --- a long time before but couldn't remember what it was. Google to the rescue. I found a post that claimed that this error was due to a missing password in the LOM. You've got to be kidding. But what had I to lose? I created a password and tried again. Still failed. Ah! Maybe I should logout and log back in? You guessed it. It worked. So, there I was booting from the CD-ROM and writing to the disk. I couldn't believe it.

I installed OpenBSD and it all worked. But then I changed my mind about the disk allocation. Maybe I should put most of the space for web pages? It was almost trivial to go back and re-install. After that, I had to work on the ethernet interfaces. I wanted to have two ports: one for the router and one for the local machines but decided it really didn't make much difference. So one port it was. OpenBSD comes ready to serve pages: it already has Apache on it. So, I really didn't need to install any packages. In addition, I decided to move the services served by my own machine to this server (such as BOOTP, RARP and friends). I easily moved them over.

Finally, I was looking at a reasonably nice machine. I was impressed at how fast it served pages. It seemed fairly secure. I enabled samba for the local house machines but turned it off for everyone else (this will turn out to be important). Finally, I decided it was time to remove the CD-ROM and put the lid back on. The next and final step would be to place it on the net ...

Thursday, 18 March 2010

On the web

Or, subtitled, how I fought the Verizon modem and won.

For DSL service, Verizon supplies a model 7500 Versalink modem. This modem is also a router and I have it set up to be our DHCP server as well. It certainly works well and I am fairly content with it. But recently, I was threatened with the loss of my web page. This was enough for me to swing into action and put an ancient Sparcy (Ultra 2) into action. It's interesting to note that the current version of Solaris is incompatible with ancient hardware like this. So, my next choice was something secure, so I went for OpenBSD. I had various adventures with the dead CD-ROM reader, the incompatible external CD-ROM reader, etc. I finally was able to netboot it only to discover that OpenBSD didn't like the onboard SCSI drives. Say what? Well, that meant NetBSD. And you know what? It worked right out of the box. I had to get the package manager up and running so I could get apache. And apache also worked straight up. So, onto the web... And the router.

It seemed simple enough: just enable port 80 (HTTP) and we'll be ready to go. Not so fast! First, there's the issue of host addresses: I wanted the machine (now named "cullen" after the town in Scotland named for skink, a certain stew) to have a static IP address. Well, if I did that then the router had trouble (I went for a different subnet and it didn't like that). I eventually figured out that I could have it both ways! In the deep recesses of my mind was the notion of aliases and this is what I did: One static, one dynamic.

Back to the router. I tried to open up port 80 by creating a new profile called "cullen" (shock). Didn't work. All the external tools said it was closed. After sleeping on it, I decided that maybe this additional port forwarding didn't work... Maybe I should add it to the "default" profile. And lo and behold. The port was open.

One of the interesting tidbits from this is that in spite of registering with dyndns.org, if I try and put the symbolic host address into the brower, I'll get the modem/router home page. But if I am external, I definitely get the right page. At this point I don't care. Originally, I was also going to enable SSH but I am tired of script kiddies, so for the time being it's closed. I might open it when I go away...

The machine also had two ethernet ports --- I might use one for a direct connection to the router and the other for internal net traffic. It should handle that. Famous last words.

Thursday, 3 December 2009

Why I hate cables

Does anyone else besides me despise them? I started to hate them when I was building hardware. It was so easy to damage them, to get the pins backward and generally fail. Now, that I'm trying to get these machines to work, they are in my way again. For example, to talk to my very nice Sun T3 disk array, I need to have a special cable to connects to an RJ-11. Say what? A telephone jack for a serial cable? Thanks Sun. What about my SPARCy? Now I need a 25 pin to 9 pin converter. And of course, there's the matter of getting the gender correct. Sheesh.

One can never, ever have too many cables and connectors around. Also, FWIW, it holds for RF as well as digital. Is it SMA or 3.5 mm? Is it N or 7 mm? It never ends.

Thursday, 19 November 2009

Once more, into the breech

I have been informed that my web page, now more than a decade old, will cease to exist soon. The machine that hosts it (www.caip.rutgers.edu) is "being retired". What's really going on is a typical academic stunt of changing names and seizing control. It's evil, but it's what happens in academia regularly. Life goes on.

So, I am preparing to move my web page to a new web site: but where? After considering all my options, it appears that the best option is to host it meself. Allow me to explain: First, why should I pay someone to host my fiiles? Second, if I ask Verizon for a static IP then I have to be a business (and be prepared to pay for the privilege). So, it would appear the cheapest thing to do is use dynamic DNS and host at home.

OK, so what next? Well, it wouldn't hurt to have an industrial strength router, but that's a story in itself --- next blog. So, besides the router, what else? Who's hosting the web page? No way is it my machine. But that's why I have a vax. Really! So, if I can have openbsd on the vax (which I can, to hell with VMS), then I will host from there. If anyone complains about the speed, then I'll tell them they don't have a sense of history.

So, then how to port openbsd on the vax? Wellllll, the "best" way (according to the web page) is to have it netboot. So, I could port over all the daemons to do that, but then since I need to bring up my Sun machine anyway to talk to my T3 fileserver, then why not have the Sun serve? And, what's more, it appears that Sun does this stuff regularly under the name "jumpstart".

Next step? Putting Solaris 10 on the Sun. I thought about netbsd, but if I want it to the talk to the T3, why not have it stay in the family. And I'm just getting started...

Saturday, 25 April 2009

Woeful linux

Before I lose it again, let me praise the apt installation package. In comparison to "yum", this software seems to work effortlessly; upgrading to the latest and greatest Ubuntu distribution ("jaunty jackalope") was just a pleasure. Almost.

That's right, almost. You see, I decided to use my spiff Linotype scanner. And you see, that requires the sg kernel module. No problem you cry! Why it's just "modprobe sg". Not so fast. There isn't a sg.ko in /lib/modules anymore! Say what? Did it go away? After downloading the kernel sources (yes, I did that), I regret to say that guess what? You guessed it. The sources are there. As it so happens, I have the kernel headers. So, I stripped out the sg code and compiled it. Minor complaint but I get a .ko; and what happens when I modprobe it? You guessed it, didn't you? It didn't load.

A posting on the Ubuntu bugs list is of course ignored. Need I say more? It's linux, isn't it?

Monday, 24 November 2008

Linux --- not ready for civilians

I'm an old hand Unix user --- I've been using it since 6th edition. So I am "amused" by the claims of the Linux hands that "even a caveman" can install Linux. Not.


My linux experience started out with Redhat. Initially, since my motherboard was so new, there wasn't a driver for the NVIDIA chip. I did get this to work by hacking this and that and trusting (but not verifying) the kernel modules. This worked well for a long time, at least until I decided to upgrade. Mistake. It couldn't do the upgrade well and I ended up stranded in the middle.


Finally, after the sabbatical, I returned to my homebuilt machine. I installed a new DVD writer and backed up the files. Then I tried to install Ubuntu (after all, it's good enough for Google [gubuntu]). Botch. It got hung trying to access the floppy! Thanks to google, I was able to locate the thread that discussed how to get around that --- fiddling with the grub options. Now, who are they kidding? Who is going to get this right except someone who's willing to hack it up? Then it's time for the Xorg.conf section of hell. Each time I got it wrong, there was no recourse but to reboot.


Now, there's a new distribution. OK, one thing I really like about Ubuntu is the aptitude upgrade manager. Just fantastic. So, I go ahead. Looked good until it asked me about installing the NVIDIA kernel modules --- I thought, well, why not? Well, we're back in Xorg.conf hell again, that's why not. Fortunately, I was able to get it work by looking at my past configuration (I was able to do the install of Ubuntu without blowing my files away by installing the new system on my formerly shared file system).


So, now it's running well. And it's fun to use. But tell me --- is Linux really ready for novices to install it? I don't think so.