Archive for the 'linux' Category

Note to Self: batch image processing

Thanks Jeff for the link.

http://jcornuz.wordpress.com/2007/11/21/phatch-batch-power-without-bash-hassle/

Note to self: Mac -> Ubuntu migration

This site has some good info:

http://mac2ubuntu.com/

Remote Access to Servers: Sun vs. Dell

I’m evaluating some Sun and Dell servers for work. They are pretty closely matched in terms of price, speed and features. One thing that is a quite a bit different is the remote access feature. Both systems have little dedicated tiny computers with their own ethernet cards. They let you connect to the machine over the network, via a web browser (or ssh) and power up and power down the server. They also have remote KVM (keyboard, mouse and video) access via their web interfaces.

I like the Sun implementation better.

  1. The Dell implementation is an ActiveX Control, which means I have to use IE in my Windows VM. That’s a pain.
  2. Dell doesn’t have menu items for sending F-keys, like F2 (used to enter the BIOS); and because of keyboard mapping or whatever, the F2 key was intercepted by something (either Mac OS X, or Parallels or Windows, it’s hard to tell) before it could get to the the virtual console. So no BIOS settings for me.
  3. Dell has a horrible roll-down menu that is either in your way or invisible.
  4. The Sun version is Java (of course) and it works on anything that has Java 1.5, including my Mac with FireFox.

Still, both implementations are better than the super-expensive and super-crappy Raritan hardware KVM over IP we had been using.

Note to self: Ubuntu performance tweaks

This is a good link:

http://blog.lxpages.com/2007/04/24/ubuntu-performance-guides/

Weird problems with SSH tunnelling of X11

I’ve wasted about two hours just now trying to get X11 to tunnel over my ssh connection. My machine is a Mac running X11, and the remote machine is over in our DMZ at work, running CentOS. I had to install some X11 packages on the Linux machine, and then I assumed everything would be golden. But no.

I also made sure ForwardX11 was enabled on the Mac ssh config and the Linux ssh config. But when I “ssh -X linuxmachine” it acts as if everything is fine, creating the Xauthority file and setting a DISPLAY environment variable. But I run “xclock” and it says:

Error: Can't open display: linuxmachinename.com:10.0

I can’t find any deeper way to diagnose what is going on. Hoping that it was some kind of Mac vs. CentOS xauth incompatibility, I tried another Linux server, my own server (that runs this site.) It works fine; and it’s CentOS also. Then I tried my home server, an Ubuntu workstation, and it works fine.

So I went to another server on our LAN. Also CentOS. No connecty. Another one in our DMZ. No sirree. It’s like the Mac just won’t accept connections from Linux machines in the same building. WTF?

So I’m stumped. Is there some X11 utility that will complain more verbosely about why it can’t connect?

Update: Mystery solved. Sort of. I needed to change the sshd_config on the remote machine to have:

X11UseLocalhost yes

Then I had to restart the sshd and reconnect. For some reason, the ssh tunnel listener was refusing all connections otherwise, even though it was (apparently) bound to all IP addresses on the machine! (And, to answer your next question, no, I did not have iptables running on the remote machine.)

How to get PHP 5 working with MySQL 5 on CentOS 4.x

You’d think this would be pretty much automatic, but it hasn’t been my experience.

There are two problems: CentOS 4.x distribution still has MySQL 4.1.x as the default MySQL installation. I really like to use MySQL 5 now, it’s pretty stable. The other problem is that the PHP packages that claim to have MySQL enabled, actually don’t. Or that’s the way it seems to me, after several hours pounding my head against “yum.”

Step 1: install MySQL 5

This is pretty easy:

% yum --enablerepo=centosplus install mysql-server mysql-devel
% /usr/bin/mysql_install_db
% /etc/init.d/mysqld start
% mysqladmin password your_secret_password
% mysql -h localhost -p
Enter password:
mysql>

Step 2: Compile PHP

Assuming you have the standard apache httpd package installed on the machine, we have to build PHP 5 with mysql enabled. This is the only way I have been able to get PHP 5 to work. It’s annoying, because you’d think that PHP + Apache + MySQL 5 would be the second most popular config on these machines.

First get PHP from http://www.php.net/downloads.php

You’ll also need to make sure that httpd-devel is installed so you can have apxs.

% yum install httpd-devel
% yum install libxml2 libxml2-devel flex           (you might already have these)
% tar vxzf php-5.2.0.tar.gz
% cd php-5.2.0
% ./configure --with-apxs2=/usr/sbin/apxs --with-mysql
% make
% make install

That’s it. This should also take care of updating your httpd.conf to load the PHP module. Now restart apache.

Apple might have a case vs. Cisco?

This is hilarious stuff.

[via Infectious Greed]

OS X Theme for Ubuntu

Julie sent me this link: http://www.taimila.com/ubuntuosx.php

Remember to try it out on Ubuntu machine at home. Though I’m not sure what the point is… I use mostly Macs instead of Ubuntu on desktop not because I think the UI is any prettier, but because there are apps on Mac that don’t exist on Linux. In particular, iTunes and Quicktime, but also other weird ones like Quicksilver.

Note to self: investigate GFS (global file system)

At work, we don’t have a very good solution for a big, central, reliable file system. NFS on Linux just plain doesn’t work: it craps out randomly. Right now we are using samba, which craps out less randomly, but is still not as reliable as NFS was on Solaris 10 years ago.

Self, you need to look into GFS in more detail, and Linux clustering in general to see if it will help.

Here are some links to get started:

http://www.redhat.com/software/rha/gfs/

http://en.wikipedia.org/wiki/Global_File_System

http://sources.redhat.com/cluster/gfs/

How to find out what version your red hat-flavored distro is

“uname -a” tells you what kernel you have. But sometimes one needs to know what distribution you are running: Fedora Core X, CentOS X.X, etc.

On Red Hat systems, simply:

% cat /etc/redhat-release
CentOS release 4.4 (Final)
%