20100711

New Server Notes

Like mentioned in my last post, I don't really look forward to what I'm about to subject myself to. But, it needs to be done. Kinda like regular prostate exams...

(No, I haven't gone through one of those yet. Not looking forward to it, either.)

Set Up Server: Ubuntu Server 10.04 LTS x64
Commands so far:

apt-get dist-upgrade
apt-get upgrade
apt-get install postgresql-8.4 postgresql-client postgresql-doc
apt-get install vnc4server fluxbox
apt-get install ia32-libs


Reconfigure .vnc/xstartup to start fluxbox instead of the default window manager.

How to configure sudo access (via the foobar group membership) to an alternative account (the foobar user) without giving pure root access:

%foobar ALL=(ALL) NOPASSWD: /bin/su - foobar


Other tasks to do:
  • Set up other user accounts and grant them access to the appropriate folders, powers.
  • Upload a basic smalltalk distro and get it running
  • Configure automatic-loading scripts in case of server reboot
  • (someday) configure nice shutdown scripts for taking server offline or rebooting
Handy scripts:
launch_smalltalk.sh
#!/bin/bash
cd current
nohup ./cobalt.sh &
echo $!

Make sure that the headless.sh script loads the correct video driver; also, fix if necessary from trying to link to libraries that don't exist, or have been moved to someplace else.
start_vnc.sh
#!/bin/bash
vncserver -alwaysshared -localhost -geometry 1024x768 :1


stop_vnc.sh
#!/bin/bash
vncserver -kill :1




Notes on Configuring PostgreSQL 8.4
as root:
su - postgres
psql
(do your funk here)
  • Create a new role, as postgresql views roles and users as the same thing.
  • Alter the role after you forget to give it permissions like LOGIN.
  • Optionally create a tablespace and make sure the new database uses it.
  • Create a database: CREATE DATABASE foo OWNER bar;
That should just about do it, I think...

Fun with PostgreSQL and Smalltalk

On any windows system, this would be trivial. NOT SO ON LINUX. Why did I use Linux? Because I love it, and it doesn't need a GIG OF F*CKING RAM to run a web server. That being said, I'm not sure I'd "happily" choose it again if the web server was one based on Seaside, but I'm going to do it again. But Seaside is the second half of the fun. The first half was getting PostgreSQL/ODBC and the given Smalltalk environment (OpenCobalt) to be friends.

You'll have to pardon my opinions. I am not a zealot, nor an evangelist. As such, I may well be burned at the stake as an absolute heretic. But I know my sh*t, I put in my hours, I bust my ass, and I have very little patience for those who cling to and fight fervently for lofty ideals while not achieving harmonious utility and productivity from their efforts. Such people are, AFAIC, a sinful waste of time.

Server: Ubuntu Server 10.04 LTS x64
WHAT I DID:

apt-get install odbc-postgresql
odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template


* Configured DSN using ODBCConfig tool in X (superuser to do this; apt-get it before trying to use it)

Handy Documentation:
FFI info - http://wiki.squeak.org/squeak/1414

"I find myself saving every few minutes; it reminds me of when I was a kid, playing those old Sierra adventure games. Every few steps or screens I'd hit SAVE. The motto was 'Save Early, Save Often' because you never knew when or how you were gonna die! So it is with Squeak..."




FFI Loading Snafu...
The Foreign Function Interface was totally missing, or partially broken, depending on which distro you use. To recover it, you have to do the following voodoo dance:

Get the sources:

MCHttpRepository
location: 'http://source.squeak.org/FFI'
user: ''
password: ''.


Load the sources, in THIS ORDER:
  1. FFI-Pools
  2. FFI-Kernel
  3. FFI-Win32 (or FFI-Unix, or FFI-MacOS, or all three)
  4. FFI-Tests
  5. FFI-Examples

"The more I use the end-products of Smalltalk coders, I suspect their work to be steaming piles of crap. Disorganized, disjointed, lacking in all notion of communal productivity and standardization - it's the ultimate narcisists' environment. Now, the language may have some fault in that, but the environment devised around language is where the true evil seems to lurk."


DEALING WITH ODBC LIBRARY FROM SQUEAKMAP
OpenCobalt does NOT understand the _ operator. Seems they've moved on to bigger and better keyboards. Find/replace all " _ " with " := " when trying to filein the ODBC changeset that is available from SqueakMap.

By the way, the ODBC lib I found in Sqeakmap was terribly outdated. Had zero support for non-Windows systems. Got updated copy from coworker - have NO IDEA where he got it. And that's kind of crap that just pisses me off.

Of course, once you have the right lib, it still won't Just Work (tm). To get ODBC library to work correctly, do:
    ODBCLibrary default initialze.