23 May, 05 > 29 May, 05
16 May, 05 > 22 May, 05
25 Apr, 05 > 1 May, 05
28 Mar, 05 > 3 Apr, 05
14 Mar, 05 > 20 Mar, 05
11 Oct, 04 > 17 Oct, 04
13 Sep, 04 > 19 Sep, 04
16 Aug, 04 > 22 Aug, 04
Entries by Topic
All topics  «
How To
Projects
Rants
Blog Tools
Edit your Blog
Build a Blog
RSS Feed
View Profile
William Schumacher
March 14, 2005
Integrating Linux into an Intranet using WINS name resolution
Topic: How To
I wanted to add WINS support to my linux machine so that it could resolve systems on the corporate intranet, which was managed by a WINS server.

It turns out that you can do this by installing 'winbind', enabling WINS support in /etc/samba/smb.conf:
  ; Don't BE a WINS server.
wins support = no
; Specify who the WINS server is
wins server = <IP address>

and finally editing /etc/nsswitch.conf and adding 'wins' to the line:
    hosts:  files dns wins

Then you should be able to ping and connect to WINS-managed hostnames.

Posted by wmschumach at 12:55 PM PST
Updated: April 20, 2005 1:52 PM PDT
October 8, 2004
Using x2x
Topic: How To

I've been using the nifty x2x proram to let me use a single keyboard and mouse with all the machines I have around. I have my main dual monitor Debian system in the middle of my desk, with a third monitor attached to a different Debian server to the left and sometimes a fourth system to the right.

With this setup, I can just use the same mouse and keyboard on all these machines (and potentially more) just by moving my mouse off the edge of one monitor to the adjacent one.

Basically, to use x2x to my other Debian machine (192.168.1.27) I just set up one machine to allow X11 access (on port 6000) to my main machine (192.168.1.28):

  192.168.1.27> xhost +192.168.1.28
and then on the main machine run the command:
  192.168.1.28> x2x -to 192.168.1.27 -west &
I also had to reenable listening to TCP. Since I'm using Gnome, this setting was in /etc/X11/gdm/gdm.conf and set the DisallowTCP setting to false. If I hadn't been using Gnome, I would have changed the line in /etc/X11/xinit/xserverrc from:
  exec /usr/bin/X11/X -dpi 100 -nolisten tcp
to:
  exec /usr/bin/X11/X -dpi 100

For machines running KDM, you also need to hunt down the -nolisten tcp option in /etc/kde3/kdm/Xservers.

When trying to enable this on a Redhat ES machine, I tried all the usual things, but had no end of problems getting the Redhat X11 server to listen. Finally I found Redhat's firewall configuration program lokkit buried in /usr/sbin and enabled port 6000, and I was finally good to go. If lokkit is anywhere in Redhat's system menus, I certainly couldn't find it. (Incedentally, I don't know why the dumbasses at Redhat can't ever put /sbin or /usr/sbin in root's PATH. You're not using root unless you NEED to use the utilities in /sbin or /usr/sbin anyway. And why the hell can't they give you a modern Vi?)

The lesson? Redhat sucks. Oh what a surprise.

Posted by wmschumach at 10:59 AM PDT
Updated: March 7, 2005 3:43 PM PST
September 10, 2004
Setting up dual monitors on Debian with a NVIDIA Quadro NVS with AGP8X
Topic: How To

I have a Dell Precision 360 with a NVIDIA Quadro NVS with AGP8X video card that I've set up with dual monitors.

I installed the latest Knoppix Linux (v3.6) using kernel 2.6.7 and did a apt-get update; apt-get dist-upgrade. After installing, I have XFree86 Version 4.3.0.1

I went to NVIDIA's website (nvidia.com) and downloaded the Graphics Driver->Quadro->Linux IA32 driver.

In order to install this driver, I needed the linux kernel sources, which I just got by doing: apt-get install kernel-source-2.6.7 kernel-headers-2.6.7-1. I wanted to keep the same kernel configuration Knoppix shipped with, at least for now, so I copied /boot/config-2.6.7 to /usr/src/linux and did the standard make oldconfig; make; make modules; make modules_install, reinstalled lilo, and rebooted.

Once back up, I ran the NVIDIA installer and started X. This gave me the NVIDIA splash screen on one of my monitors.

To get X on both monitors, I then had to edit my /etc/X11/XF86Config-4 file. To do this, I read NVIDIA's README at ftp://download.nvidia.com/XFree86/Linux-x86/1.0-6111/README.txt, especially Appendix I "CONFIGURING TWINVIEW". Sections I changed from Knoppix's defaults are below:

Section "Device"
  Option "sw_cursor"
  Identifier "Card0"
  Driver "nvidia"
  VendorName "nvidia"
  BusID "PCI:1:0:0"
  Option "TwinView" "1"
  Option "MetaModes" "1280x960,1280x960"
  Option "SecondMonitorHorizSync" "30-85"
  Option "SecondMonitorVertRefresh" "50-160"
  Option "TwinViewOrientation" "RightOf"
  Option "NvAGP" "1"
  Option "ConnectedMonitor" "CRT, CRT"
EndSection
The most important parts of this section are the "TwinView" and "MetaModes" sections. Make sure the modes you set in "MetaModes" match those in your "Screen" Section.

Posted by wmschumach at 1:52 PM PDT
August 17, 2004
Playing windows-based games on Linux
Topic: How To
I have found that the following Windows games work fine under Debian Linux using standard WINE:
  1. Space Empires IV
  2. Starcraft
  3. Streets of SimCity

Posted by wmschumach at 4:38 PM PDT
Updated: August 17, 2004 4:40 PM PDT
Installing Debian
Topic: How To

How I Install Debian Linux on a PC

I assume the computer which I will install linux on will be on a network that has internet access. This installation will boot the computer off a set of three floppies, which will then use the network to download and install the rest of the operating system. If your only connection to the internet is a windows pc with a modem, you'll need to find a proxy or ip forwarding program for windows.

Table of Contents

  1. check what hardware you have
  2. Create the boot floppies
    1. a Get the Debian Linux floppy disk images from Debian.org
    2. b get rawwrite
    3. c Use RawWrite to burn each of the 3 .bin files to a diskette.
  3. /etc/modules
  4. insmod
  5. ifconfig
  6. ps aux
  7. /etc/smb.conf
  8. man

  1. Check what hardware you have.
    The three most important pieces of hardware you need to check for Linux compatibility are (in order): network card(s), modem, and video card. Video card is optional. Get the manufacturer/model names of these cards and check with google to make sure people have used them successfully with Linux. If you can, find out what driver they used or how they configured it.

    1b. Determine what TCP/IP network settings your new system must have. you will need an IP Address, subnet mask, gateway, domain name and dns server ip addresses. On a windows 9x machine, you can retrieve most of this information from either network settings or by running 'winipcfg'. on a NT/2000 box, run ipconfig instead of winipcfg.

    For example, for the AT-2000 Allied Telesis ISA Ethernet card, I need the 'ne' module (NE cards), and configure it with the i/o address (same as in windows) in the /etc/modules file with the line:

    	ne io=0x300M
    or on the command line:
    	insmod ne io=0x300
    which installs the ne module into the operating system with the option (io=0x300)

    For the TE100-PCIWA/N 10/100 PCI Fast Ethernet cards, I needed the rtl8139 module and don't need any options, so in /etc/modules, I just put:

    	rtl8139
    or from the command line:
    	insmod rtl8139

    I will talk about the /etc/modules file and the insmod program later in this document.

  2. Create the boot floppies

    1. a: Get the Debian Linux floppy disk images from Debian.org

      Either go to the download directory at:

        ftp://ftp.us.debian.org/debian/dists/potato/main/disks-i386/2.2.26-2001-06-14/images-1.44/compact/
      Or (if the link doesn't work) follow these general steps to get to the download directory:
        Go to www.debian.org. 
        On the left bar, go to 'Download with FTP' under 'Distribution'
        Choose '(FTP)' next to 'United States', or some other server if too slow.
        Go to 'dists' (for distributions).
        Go to 'stable' (for the standard stable release of Debian).
        Go to 'main'.
        Go to 'disks-i386' (disks for PC-compatible systems).
        Go to 'current'
        Go to 'images-1.44' (for standard sized floppies).
        Go to 'compact' (for fewest floppies)
      
      Then download the three floppy images:
      driver-1.bin
      rescue.bin
      root.bin
      

    2. b: Get a copy of RawWrite, a (Free) program for imaging and writing raw bytes to floppies. RawWrite is needed because the entire capacity of the floppy is used and the first rescue floppy needs to be bootable. There will be no FAT filesystem on them.

      Go to:

        http://uranus.it.swin.edu.au/~jn/linux/rawwrite.htm
      or go to google and search for RawWrite.
      Get the windows binary (executable).

    3. c: Use RawWrite to burn each of the 3 .bin files to a diskette.
      Run the RawWrite application. It is a standard windows application and should be fairly self-explanitory. You just use the 'Write' option and tell Rawwrite what image to use and what floppy drive to write it to. (You can also use the 'Read' option of RawWrite to make exact copies of floppy disks and burn them back when you need the disk again. I use it for program installation floppies.)

      The version of RawWrite I have seems to have a bug where every other time you try to write the image, it reports a failure immediately, but trying again works fine. There is also a DOS program rawrite.exe that does not have this bug. Look on Google for it if you're interested.

      Label each diskette with the name of the file you created it with.

  3. : Install the boot system from the floppies.

    3a: Insert the 'rescue' floppy into the target PC and turn it on. You should get a screen like the following:

    Welcome to Debian GNU/Linux 2.X!
    This is the Debian Rescue disk. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah On most systems, you can go ahead and press <ENTER> to begin installation. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah WARNING: You should competely back up all of your hard disks ... blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah This disk uses Linux 2.2.19-compact blah blah blah blah blah blah blah blah blah Press <F1> for help, or <ENTER> to boot. boot:

    Press the Enter key.

    A bunch of text will scroll down the screen until it gets to a line that says: VFS: Insert root floppy disk to be loaded into the RAM disk and press ENTER

    Now remove the rescue disk, insert the root disk, and press Enter.
    The next line will then say:
    RAMDISK: Compressed image found at block 0
    and the computer will read from the floppy again.
    some more text will scroll down the screen and then a ASCII window will pop up titled 'Release Notes' with a button selected. press Enter.

    A window with a menu will then appear titled 'Debian GNU/Linux Installation Main Menu' and will look something like:
    +------------------------------| Title |-------------------------------+
    |                                                                      |
    | Your keyboard has not yet been configured. Please select             |
    | "Next" from the menu to configure the keyboard.                      |
    |                                                                      |
    | +------------------------------------------------------------------+ |
    | | Next      : Configure the Keyboard                               | |
    | | Alternate : Preload essential modules from a floppy              | |
    | | Alternate1: Partition a Hard Disk                                | |
    | |                                                                  | |
    | | Configure the Keyboard                                           | |
    | | Preload modules from a floppy                                    | |
    | | Partition a Hard Disk                                            | |
    | | Initialize and Activate a Swap Partition                         | |
    | | Activate a Previously-Installed Swap Partition                   | |
    | | Do Without a Swap Partition                                      | |
    | | Initialize a Linux Partition                                     | |
    | | Mount a Previously-Initialized Partition                         | |
    | | Unmount a Partition                                              | |
    | +------------------------------------------------------------------+ |
    |                                                                      |
    +----------------------------------------------------------------------+
    This window will guide you through the installation of the 'base system'.
    First choose 'Configure the Keyboard', which is probably already selected.
    Choose the default 'U.S. English (QWERTY)' unless you need something different.

    Then choose 'Partition a Hard Disk', which is probably already selected.
    The 'Select Disk Drive' window will appear. all of your harddisks will be listed here. the master drive on the primary IDE channel will be listed as /dev/hda, the slave drive on the primary IDE channel will be /dev/hdb, the secondary master will be /dev/hdc, and the secondary slave will be /dev/hdd. Unless you are setting up a dual boot system or have multiple hard disks in your computer, you will have a single value in the list, and you will want to just hit Enter.

    A warning about disk size will appear. just hit enter.

    you will now be in a disk partitioning program. the screen will look like this:

    
    			cfdisk x.xxx
    
    		Disk Drive: /dev/hdx
    		Size:  xxx bytes
    	Heads: xx Sectors per Track: xx Cylinders: xxxx
    
    
    Name	Flags	Part Type	FS Type		[Label]		Size(MB)
    ------------------------------------------------------------------------
    		Pri/Log		Free Space			639.96
    
    
    
    
    [  Help  ] [   New  ] [ Print  ] [  Quit  ] [ Units  ]
    [ Write  ]
    		Print help screen
    
    Selected in the table is the current partition, which is your entire drive right now. at the bottom, the Help button is selected. Use the right and left arrow keys to move to the New button and hit enter, to create a new partition.
    choose the Primary button.
    the program will ask for the size of the partition. Take the current listed size, and subtract 2 times the amount of memory your system has installed. for example, in the above the system has 639.96 mb of harddisk space, and 16 mb of memory. so 639.96 - 32 = 607.96 mb.
    Choose the Beginning button.
    Choose the Bootable button, to make the partition bootable.
    you will now have two entries in the table above. The first will have the FS Type of Linux, and in this case will have Size of 607.95. The second will have Free Space for FS Type and in this case will have Size of 32.00. use the up and down arrow keys to select the second partition. use the right and left keys again to select New again and hit enter.
    Choose the primary button again.
    Hit enter when prompted for size, to accept the default.
    Use the arrow keys to select 'Type' and hit enter.
    Enter 82 (for Linux Swap) for the filesystem type and hit enter.
    You will now have two partitions in the list, the first will have the Boot Flags, and will have Linux for FS Type. the second will have no flags and will have Linux swap for FS Type.
    Choose the Write button.
    Type 'yes' to confirm your configuration, and hit enter.
    Choose the Quit button.

    You will be returned to the main menu.

    Choose Initialize and Activate a Swap Partition, which is proably already selected. The swap partition you just created will be listed, hit enter to accept.

    You will be prompted to perform a disk scan of the partition. choose 'yes' to skip the scan and hit enter.
    Choose 'yes' to confirm initialization.

    Back at the main menu - choose Initialize a Linux Partition.
    the first partition you created will be listed. hit enter to accept.
    you may be prompted about version compatibility. choose the default 'yes'.
    you will be asked about a disk scan for this partition. choose 'yes' to skip the scan and hit enter.
    choose yes to confirm the format of the partition.
    The drive will now be formatted.
    you will be asked if you want to mount the 'root' filesystem now. choose yes.

    At this point you will deviate a little from the installer's suggestions.
    Back at the main menu, choose 'Install Operating system kernel and modules' instead of the default.
    Choose the first floppy drive. Put the rescue floppy in the drive when prompted and hit enter.
    When prompted, insert the driver disk and hit enter.

    Back at the main menu, accept the default 'Configure Device Driver Modules'.
    choose 'yes' to skip the next step.
    You will then be given the module list menu:

    +--------------------------| Select Category |---------------------------+
    |                                                                        |
    | blah blah blah blah blah blah blah blah blah blah blah blah blah       |
    | blah blah blah blah blah blah blah blah blah blah blah blah blah       |
    |                                                                        |
    | Please select the category of modules.                                 |
    |                                                                        | 
    |   Exit   Finished with these modules. Return to previous menu.         |
    |                                                                        |
    |   block  Disks and disk-like devices.                                  |
    |   cdrom  Device drivers for CD-ROM drives.                             |
    |   fs     Drivers taht allow many different filesystems to be accessed  |
    |   misc   Drivers that don't fit in the other categories.               |
    |   net    Drivers for network interface cards and network protocols.    |
    |   scsi   Drivers for SCSI controller cards and classes of SCSI device  |
    |                                                                        |
    |                                                                        |
    |                  [OK]               [CANCEL]                           |
    |                                                                        |
    +------------------------------------------------------------------------+

    select the 'net' category.
    go down the next list until you find the network driver you need for your network card, which you found in step 1. select it and hit enter.
    choose to install the module.
    The following window will appear:

    +--------------------| Enter Command-Line Arguments |--------------------+
    |                                                                        |
    | Please enter any command-line arguments for the rtl8139 module. Many   |
    | modules can autoprobe and do not require additional parameters.        |
    |                                                                        |
    | _____________________________________________________________________  |
    |                  [OK]               [CANCEL]                           |
    |                                                                        |
    +------------------------------------------------------------------------+

    if you had any module parameters required for your card, enter them here. for the network card examples I gave in step 1, for the 'ne' card, I would enter io=0x300 here. for the rtl8139 card, I would leave this blank. Hit enter to accept.

    A screen should then appear:

    Installing module xxxxxxxx.  If the device isn't there, or isn't configured correctly,
    this could cause your system to pause for up to a minute.
    
    
    Installation succeeded.
    
    Please press ENTER when you are ready to continue.
    

    Hit enter.
    if you did not get the Installation succeeded text, you need to verify your network hardware, and perhaps search google again for more information about it, and try again.
    Exit the net-modules list (unless you need to try again, or have another network card).
    You will be returned to the main module list window.
    Exit the modules list.
    You will be returned to the main installation window.
    Choose the default 'Configure the Network'.
    You will be asked to give your computer a name. do so and hit enter.
    you will be asked if you want to perform automatic network configuration. Unless you know you are connected to a network that will assign your settings for you, choose no.
    Enter your IP address and hit enter.
    Enter your subset mask and hit enter.
    enter your gateway IP and hit enter.
    enter your domain name and hit enter.
    enter your dns server IP and hit enter.

    If the network setup was successful, you will now be back at the main installation screen.
    choose the default 'install the base system'.
    choose 'network : retrieve from network'.
    hit enter to confirm starting the http download.
    you will be given the 'select installation server' window. select the button and hit enter to accept the default server url.
    You will see the download progress window.
    +--------------------------| Download Screen |---------------------------+
    |                                                                        |
    | Put Download Screen Here.                                              |
    | blah blah blah blah blah blah blah blah blah blah blah blah blah       |
    |                                                                        |
    |                                                                        |
    |                                                                        |
    |                               [CANCEL]                                 |
    |                                                                        |
    +------------------------------------------------------------------------+

    After downloading completes, the base system will be extracted.

    Back at the Main Menu, choose 'Configure the Base System', which is probably already selected.
    Select your timezone. In the 'Directories' list, choose 'US', then in the Timezones list choose the appropriate timezone.
    Choose 'Yes' to set your hardware clock to GMT.

    Back at the Main Menu, choose 'Make Linux Bootable Directly From Hard Disk', which is probably already selected.
    Use the default in the next screen, "/dev/hdx : Install Lilo in the MBR (use this if unsure).". (If linux does not boot later and you have to repeat the install, try the other option, but the first should work)

    Back at the Main Menu, choose 'Make a Boot Floppy.', which is probably already selected.
    If for some reason your installation will not boot straight from the harddrive, this gives you a way to continue without having to re-install.

    When prompted, insert a new disk to use as a boot floppy, and hit enter. The boot floppy format screen will display:

    Formatting the floppy...
    Measuring drive N's raw capacity
    In order to avoid this time consuming measurement in the future,
    add the following line to /etc/driveprm:
    driveN: deviation=xxxx
    CAUTION: The line is drive and controller specific, so it should be
    removed before inserting a new drive N or floppy controller.
    
    Formatting cylinder XX, head X
    

    After it is complete, you will be returned Main Menu.

    Remove the floppy from the drive and choose 'Reboot the System', which is probably selected.
    A warning screen will appear. Choose 'Yes' to reboot.

    If all went well, when the computer reboots, linux will start.


Posted by wmschumach at 4:31 PM PDT
August 16, 2004
Why Java Sucks
Topic: Rants
I've been really using Java now at work, and it's good enough, but I just have to vent about some of the things that annoy me.

So in no particular order:

1. Pain in the butt to do anything number-related.

For a bunch of reasons, Java has two ways to represent all the basic numerical values, both of which must be used if you are doing anything slightly complicated. For example, you can either use the double built-in type, or you can use the Double object. The double object lets you do normal arithmetic the way you'd expect:

double a = 1.0;
double b = 1.0;
double c = a + b;
But you can't do that with Double because it's an object and Java doesn't allow operator overloading even for obvious cases for Sun-provided objects like Double. You have to do clumsy things like:
Double a = new Double(1.0);
Double b = new Double(1.0); 
Double c = new Double(a.doubleValue() + b.doubleValue());
So just use double, right? Except you can't use double in any of the built-in collections like Array, List, or Map. The java collections all require real Objects, so you're stuck wrapping your double in a Double to store it in an Array, then unwrapping it to do any real work (like, say, addition) on it, then wrapping it all up in a Double again when you need to put it back:
List inputs = new LinkedList();
List outputs = new LinkedList();

inputs.add(new Double(1.5));

Iterator li=inputs.iterator();
while(li.hasNext())
{
  double result = 2.0 * ((Double)li.next()).doubleValue();
  outputs.add(new Double(result));
}
Brilliant. This example also leads nicely into:

2. Collection elements are aways returned as Objects that must be cast back into something useful.

Java collections are powerful. You can store anything in them. Java handles this in a simple way by having all the collections work by taking Objects as the collection elements, and then forcing every other class to inherit from the base Object class. This lets you do stuff like:

  List l = new LinkedList();
  l.add(new Double(3));
  l.add(new String("Hello"));
  l.add(new LinkedList());
  l.add(new Boat("Titanic"));
...because all of these objects are Objects. But what if you know what kind of list you want? Say you want an object method to take a list of Persons?
  public class Airplane {
    board(List passengers) {
      Iterator li=passengers.iterator();
      while(li.hasNext()) {
        seat((Person)li.next());
      }
    }
  }
  ...
  List passengers = new List();
  passengers.add(new Person("Fred"));
  passengers.add(new Person("Bob"));
  passengers.add(new Person("Jill"));
  passengers.add(new Bomb("Nuclear")); //no problem!
  Airplane.board(passengers);
The Airplane class can only see a list of objects that it trusts are Persons, but someone could always insert something else into the list. If you want any kind of typechecking on the List, you have to create yet another class that extends List. In C++, for example, this kind of thing would be a one-liner using templates (which I'm not that fond of, but it beats the heck out of having yet-another-java-class).

3. 65535-Byte limit to amount of code in a member function.

Granted, you probably should never ever need methods this long, but this is still a retarded limitation to even have:

Exception in thread "main" java.lang.ClassFormatError: */*/*/* (Code of a method longer than 65535 bytes)
Oh, and this is a run-time limitation. The compiler won't catch you on this one, even though if anyone knows the number of bytes in a method, the compiler should. [For the record, I was trying something intentionally dumb for testing purposes (initializing an array with ~100,000 records) when I ran into this.]

Posted by wmschumach at 1:01 AM PDT
Updated: August 17, 2004 4:45 PM PDT

Newer | Latest | Older