I traveled to Phoenix this week to give a BACnet and Lighting Applications presentation to the NEMA JSC on DALI. I flew there aboard a Song Airlines 757. During the powerup sequence for the plane, all the passengers were greeted with the image of Tux and the Linux boot sequence as the in-flight entertainment system in each headrest initialized. The touch panel color LCD screens provided games, movies, music, flight information, and satellite television. During the 3 hour flight, I watched Fox News, Mythbusters on Discovery, TLC, and Sunday night football. I also listened to some Ramones and The Smiths. I played trivia with other passengers – I came in 3rd place out of 3 players. I normally dread longer flights, but having satellite TV and Linux serving up entertainment really made the trip go by quickly.
Archive for the ‘Linux’ Category
Linux in-flight entertainment
Thursday, October 19th, 2006Samba, CIFS, and Ubuntu Linux Server
Thursday, July 20th, 2006
I run a couple of servers at my house. One of them is my fileserver, and it uses Samba to do simple Windows filesharing. My 20 GB digital photos partition was full, so I got a 120 GB harddrive and setup an Ubuntu Server 6.06 based fileserver. I transferred the files using rsync, and installed samba on the new server. I set the UID=nobody and the GID=users on all the files. I set the group id inheritance bit on the Linux directories, and removed the world/other rights.
#!/bin/bash
# files are read/write for group and owner
find $1 -type f -exec chmod 660 {} \;
# directories are read/write/cd-able/inherited GID
find $1 -type d -exec chmod 02770 {} \;
# make these files owner=nobody, group=users
chown -R nobody:users $1
I setup Samba to mimic the Linux file system, and forced some settings when new files and directories are created. Here is my smb.conf entry:
[data]
comment = Common Data Directory
path = /home/skarg/data
force user = nobody
force group = users
read only = No
create mask = 0660
force create mode = 0660
directory mask = 02770
force directory mode = 02770
inherit permissions = Yes
guest ok = Yes
Normally, you can add a CIFS mount in /etc/fstab, and specify the UID and GID that the linux filesystem will use. But the cifs filesystem mount wasn’t using the UID that I specified, and that’s when I discovered that Samba now has unix extensions, which cause the problem that I was seeing. Unix extensions can be turned off in samba by adding the following line to /etc/samba/smb.conf:
[global]
unix extensions = no
I also turned off the extensions on the workstation:
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
I was trying to get one of the other Ubuntu Server based linux servers to mount the Windows share, but kept getting an error message:
CIFS VFS: cifs_mount failed w/return code = -22
Google found the mailing list where someone had that problem, and the solution was to add the mount.cifs command, since the kernel didn't know the domain name to IP lookup. I tried to use the advanced package tool to find it:
apt-cache search mount.cifs
Nothing. I tried several other solutions, but they didn't work. I Googled again, and found another post about mount.cifs, which made me think, and I searched the server for mount.cifs using the locate command. mount.cifs wasn't there! Finally I went to the Ubuntu packages site, and did a search in the contents of each package. mount.cifs is part of the smbfs package. I initially didn't want to install the smbfs package since smbfs is depracated in favor of cifs.
sudo apt-get install smbfs
Now the server has the CIFS filesystem mounted. However, it is not perfect yet. Stay tuned!
ssh, VNC, and IMAP secure tunneling
Thursday, June 8th, 2006I run an IMAP server in the garage so that I can have my e-mail and folders in a central location. I have a domain name that I point to zoneedit.com and use ddclient to update the IP address. From Windows, I access the IMAP using an ssh tunnel with the fine PuTTY ssh client. From Linux, I just use the command line. I setup a local ssh IMAP tunnel to the potter machine which sets up the tunnel via the localhost:
$ sudo ssh -L143:potter:143 karg.us
I can then read email using Mozilla Thunderbird by configuring IMAP to use localhost on the standard port (143).

ssh tunneling is also handy for troubleshooting. To do remote troubleshooting, a remote desktop control tool is need, and I use Tight VNC. To launch a Tight VNC session to help my wife restart the printer queue, I run:
$ ssh -L5901:wilbur:5900 karg.us
$ xtightvncviewer -encodings "tight copyrect" localhost:1
Simple, right?