Friday, October 6, 2006

Another dragon slayed

Yet another blockade blasted down! I finally got printing to work. I long ago gave up trying to share the printers directly from my PC-BSD box with the Windows computers on the network, so I had moved both the laser printer and the Canon color printer over to my work box, which runs WinXP Pro, and shared them from there. But I just couldn't get connected to them from my PC-BSD box, although Samba seemed to be running like a charm.



Awhile ago, I was having problems with the cups server hanging as I was booting up, so I changed the line in my /etc/rc.conf to say:




cupsd_enable="NO"



instead of yes. But you really need to have cupsd running if you're going to do any printing from your Linux or BSD box, so I decided to try and get it running, by connecting it to the printers on my Windows box via Samba. But whenever I'd run the Printers item from KDE, I'd get some strange error about unable to connect to the cups via IPP or some such.



And then I noticed that even Samba had stopped working, and when I tried to get it started from the commandline, it too gave me the same error things like kdeprint were giving me - libgnutls.so.15 couldn't be found. Now I have no idea what this is or where it went to.



So I did a "portmanager net/samba3" to upgrade my Samba and then that started working again. And I found out that you do CUPS configuration via the web browser, by connecting to localhost:631. So I did that and added a printer via Samba, using the "URI" of smb://delldual/ML-1430 (for my Samsung 1430 laser printer on my Dell Dual CPU system). And, surprise surprise, it all worked! My Canon i560 photoprinter was a little more problematic, as there isn't a direct printer driver for it. But it looks like the BJ-8700 driver is a fair match, so I used that. And I could even printer in color from OpenOffice, by using a magical incantation, as found on the PC-BSD forums and in the OpenOffice SETUP GUIDE:




$ /Programs/OpenOffice.org2.0.3/program/spadmin



spadmin is the "Printer Administration" program for OO, and will probably be found somewhere else, as that location is where the OO PBI stores it. In there, you make printer be 'kprinter -stdin' (assuming you are using KDE - the setup guide says for Gnome users to use the "Gnome equivalent" - if you know what it is, please leave a comment). Now I get the KDE Printer setup dialog when I print, and I was even able to print in color. Woo Hoo!



Hush Baby

So someone asked on freebsd questions about how to make his login shell stop printing out the fortune. He even went so far as to rename the fortune program! I guess he must have been running a system-wide default .login or .rc file of some sort, but that's a little over the top, don't you think? The easiest way would have been to create his own .login and/or .rc file (.profile and/or .bashrc for bash) and just not call fortune in it. But Norberto pointed out another way, that I hadn't heard of - the .hushlogin file:




$ touch ~/.hushlogin



I had never heard of that, but what it does is to make all login displays not show up. Which is pretty cool, if you ask me. So even the motd won't spoil your pristine login window. Nice. Here's an article on O'Reily about the whole log in procedure, including .hushlogin:



Monitoring Unix Logins


Tuesday, October 3, 2006

bash is a 4 letter word

Ever wonder what those strange command names mean in Unix? 'brief is beautiful' is definitely the mantra for most Unix command names, and here's an explanation for most of them.



The Unix Acronym List: Unix Commands






Color my world

Pretty good little quicky chart showing the HTML color values.



Complete HTML True Color Chart






Emacs and Mr. Clipboard

I finally figured out how to get Emacs to use the X Clipboard. In the Customize | Editing | Killing page, at the bottom there is a toggle for "X Select Enable Clipboard". This defaults to nil, so toggle it to t in order to have text that you Copy go into the X clipboard as well. If you want to do this by hand:




(setq x-select-enable-clipboard t)


should go into your .emacs file. One small victory, as I move towards a happy full-time existence in BSD land. Now to fix a few of my other problems:



Things I miss from Windows:




  • Google Toolbar w/spellchecking

  • Comcast Rhapsody

  • My title bar shortcut menu PowerPro)

  • No multimedia working yet. No WMV/AVI. No YouTube/Google Video

  • Flash. While in general I hate flash, and I never could get it to work for my Firefox on Windows, some sites require it. I used to just use the "View Site in IE" or Opera shortcut on Windows. It is one reason I've been trying to get them to work using some kind of Windows tool.





Getting Jiggy with my dual monitors

Well, my dual monitor setup seems to be working finally. Not sure exactly what I did to make it work, though, as I flailed about pretty wildly for awhile. I upgraded my X.org server, as I think PC-BSD 1.2 is one release behind. I've also tweaked my xorg.conf file to set both displays to have the same resolution, thinking maybe the mismatch resolutions was making it hard on the software. I'm not sure what exactly, but it is working for me now. Here's my current xorg.conf:




Section "ServerLayout"
Identifier "Radeon Dual Monitor"
Screen 0 "Screen0" 0 0
Screen "Screen1" LeftOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/TTF"
FontPath "/usr/X11R6/lib/X11/fonts/TrueType"
FontPath "/usr/X11R6/lib/X11/fonts/URW"
# FontPath "/usr/X11R6/lib/X11/fonts/ae_fonts1"
# FontPath "/usr/X11R6/lib/X11/fonts/azeri"
FontPath "/usr/X11R6/lib/X11/fonts/bitstream-vera"
FontPath "/usr/X11R6/lib/X11/fonts/dejavu"
# FontPath "/usr/X11R6/lib/X11/fonts/encodings"
# FontPath "/usr/X11R6/lib/X11/fonts/fonts.cache-1"
FontPath "/usr/X11R6/lib/X11/fonts/freefonts"
# FontPath "/usr/X11R6/lib/X11/fonts/indic"
FontPath "/usr/X11R6/lib/X11/fonts/local"
# FontPath "/usr/X11R6/lib/X11/fonts/luxi"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/X11R6/lib/X11/fonts/omega"
FontPath "/usr/X11R6/lib/X11/fonts/URW"
# FontPath "/usr/X11R6/lib/X11/fonts/util"
EndSection


Section "Module"
Load "extmod"
Load "glx"
Load "dri"
Load "dbe"
# Load "record"
# Load "xtrap"
Load "type1"
Load "freetype"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
#DisplaySize 280 210 # mm
Identifier "LCD-Mon"
VendorName "PTS"
ModelName "PZ456"
### Comment all HorizSync and VertSync values to use DDC:
# HorizSync 30.0 - 60.0
VertRefresh 61.0 - 75.0
Option "DPMS"
EndSection

Section "Monitor"
#DisplaySize 350 260 # mm
Identifier "CRT-Mon"
VendorName "SAM"
ModelName "SyncMaster"
### Comment all HorizSync and VertSync values to use DDC:
HorizSync 30.0 - 96.0
VertRefresh 50.0 - 160.0
Option "DPMS"
EndSection

Section "Device"
Identifier "ATI Port 1"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "R480 [Radeon X850Pro]"
BusID "PCI:1:0:0"

# MergedFB options
Option "MergedFB" "True"
Option "CRT2Position" "RightOf"
# Option "MetaModes" "2048x768-2048x768"
Option "RenderAccel" "True" # []
Option "DMAForXv" "True" # []

# Option "EnablePageFlip" "True"
# Option "AGPMode" "4"
# Option "AGPFastWrite" "True"
# Option "MergedXineramaCRT2IsScreen0" "True"
# Option "Xinerama" "True"
EndSection

Section "Device"
Identifier "ATI Port 2"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "R480 [Radeon X850Pro]"
BusID "PCI:1:0:1"
EndSection

Section "Screen"
Identifier "Screen0"
Device "ATI Port 2"
Monitor "CRT-Mon"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2048 768
# Modes "1280x1024" "1024x768" "800x600"
Modes "1024x768" "800x600"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "ATI Port 1"
Monitor "LCD-Mon"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2048 768
Modes "1024x768" "800x600"
EndSubSection
EndSection

# Make it so other users can use DRI
Section "DRI"
Mode 0666
EndSection


Trevor was kind enough to post his working xorg.conf, although it confuses me because it doesn't have two "Screen" sections. I wonder if it is because his displays are identical 19" Samsungs? Anyway, here's his working xorg.conf:




Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/webfonts/"
FontPath "/usr/X11R6/lib/X11/fonts/urwfonts-ttf/"
FontPath "/usr/X11R6/lib/X11/fonts/URW/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection

Section "Module"
Load "extmod"
Load "dri"
Load "dbe"
# Load "record"
# Load "xtrap"
Load "glx"
Load "type1"
Load "freetype"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psm0"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "SAM"
ModelName "SyncMaster"
Option "DPMS"
EndSection

Section "Device"
Identifier "Card0"
Driver "ati"
VendorName "ATI Technologies Inc"
BoardName "RV350 AS [Radeon 9550]"
BusID "PCI:1:0:0"

Option "AGPMode" "4"
# This MAKEM BIG LOCKUP
# Option "AGPFastWrite" "True" # []
Option "MergedDPI" "100 100" # []
Option "MergedFB" "True" # []
Option "CRT2Position" "RightOf" # []
Option "MetaModes" "1280x1024-1280x1024"
Option "RenderAccel" "True" # []
Option "DMAForXv" "True" # []
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x1024"
Virtual 2560 1024
EndSubSection
EndSection


It was the first I had heard of the MetaModes option, so I played with that a bit. You specify the resolutions for the two displays, so maybe that's how his works. I didn't know that and that's why mine is commented out. It should be:




Option "MetaModes" "1024x768-1024x768"


Although my next step will be to bump the resolution for my 19in monitor to be 1280x1024, so the line will look like:




Option "MetaModes" "1280x1024-1024x768"


I also duplicated the "RenderAccel" and "DMAForXv" options, although I'm not clear on what they do. But it has bee pretty solid so far, so I think I have a working baseline xorg.conf. But am I happy enough to just leave it well enough alone? Noooooooooooo...



Monday, October 2, 2006

Tainted by evil

As much as I hate the idea, sometimes you just have to run Windows apps. I've pretty much made a clean break but some things just require to ubiquitous Windows. I haven't had much luck with WINE, as there seems to be some kind of thread problem. I was hoping to use it to run Firefox + Flash, which is something that just doesn't work on FreeBSD. But neither Firefox nor Opera would work using WINE.



I also dual boot into WIndows to play computer games, although WINE claims to be able to run several of the games I play. But here's another entry in the "Run WIndows apps transparently on your FreeBSD machine", called "Win4BSD", an offshoot, I guess, of a Linux version called Win4Lin. I might have to check it out, even if it does seem to be commercial software.



win4bsd - Home