Steve's random ramblings and technical notes

Tuesday, June 21, 2005

Team Haxors Geocaching Page

Team Haxors Geocaching Page
I've got Geocaching-on-the-Brain today (going on vacation the day after tomorrow) and ran across this site with some Geocaching links that I hadn't seen before. There's a short history of the sport and a photo of the plaque at the original cache site. (I'll be nice and just link to the photo URL instead of linking the actual image.)

Thursday, June 09, 2005

Adding an entry to Windows Path

The PATH statement in Windows (and DOS) controls the directories and the order in which they are searched for any executable (binary) command or file that is called from the command-line or from another program.

To add an directory to the beginning of your PATH environment variable (thereby insuring that your file is the one to be used if multiple versions are in the path):

  1. Click
  2. Right-click on "My Computer" to select Properties.
  3. Click the "Advanced" tab.
  4. Click the "Environment Variable" button.
  5. Scroll down the "System variables" list to the "Path" variable.
  6. Double click on "Path"
  7. Press the "Home" key
  8. Type (including the trailing semicolon) c:\bin;
  9. Click "OK"
  10. Click "OK" to close the System Properties window.

Verify the change:

  1. Click
  2. Click Run... for a Run window.
  3. Type "cmd" in the Open: field.
  4. Click "OK"
  5. Type "set"
  6. Locate the line starting with "PATH=" and verify that your directory is there
  7. Type a command (executable) that is found in your directory

Originally found (and modified from) here

SSH - Automagic Login HowTo

After much trial-and-error accompanied by numerous searches on Google, I was finally able to automate an SSH login to my Linux serverusing a public-key.
You might be thinking, "Why would I need to do this, can't you just type a password?" Well sure, that's what I've been doing for years. My need for automation on this box is for daily backup of documents from one machine to another using Unison.
Of course, there is documentation in Unison that mentions the ability to do an automatic login but it doesn't give a lot of details (and in fact, other sites just mention that it's difficult and leave it at that).
Now I, never being one to shirk a challenge, decided to give it a go and write down all the nitty-gritty details so others would be able to get their login working much more quickly. I'll assume you're familiar with downloading, moving and renaming files in both Windows and Linux. These steps were done on machines running Windows XP and TinySofa Enterprise Server. So hold on to your hat, here goes... (and remember YMMV)

  1. Download the required software to each machine:
    • OpenSSH for Windows (the linux box already has it)
    • Unison
    • The Windows and Linux binaries must be the same version (2.12.15 at the time of writing)
  2. Install OpenSSH on your Windows machine (you don't need to start the SSH server for this procedure)
    • I already had a newer version of cygwin1.dll in my path, so I copied the following files to that directory (c:\bin) to avoid an error regarding multiple cygwin1.dll versions.
      • cygcrypto-0.9.7.dll
      • cygiconv-2.dll
      • cygminires.dll
      • cygz.dll
      • ssh.exe
  3. Copy the downloaded Unison executable to C:\Winnt (or some other directory in your path) with a filename of unison.exe
    • copy unison-2.12.15-win-text.exe c:\bin\unison.exe
  4. On the Linux box, we'll make Unison executable and copy it to a directory in it's path.
    • bunzip2 unison-2.12.15-linux-text.bz2
    • chmod +x unison-2.12.15-linux-text
    • cp unison-2.12.15-linux-text /usr/local/bin/unison
    • To verify that it's the first copy in your path, type "unison -version" and make sure the version reported is what you just installed.
  5. Create your SSH key with no passphrase
    • ssh-keygen -b 1024 -t rsa -f "key-filename"
    • leave the passphrase empty
    • cat "key-filename".pub >> .ssh/authorized_keys
    • this appends the new key to your authorized_keys file or creates it if needed
  6. Copy the private and public keys back to your Windows machine (I like WinSCP3 for things like this).
  7. Look through the Unison documentation for the location of your default.prf file and add the following line at the end of the file:
    • sshargs = -l your_username -i c:\path\to\your\key\"key_filename"
If you want to use Putty, WinSCP or some other SSH application with this method, just scan through their documentation for something like "automatic login" or "public key" and follow their directions using the keys generated in step 5 above. For each machine you log in to, just do step 5.2 to add your public key on that machine.

Note, I tried generating the ssh-key with Putty keygen on the Windows machine, but it apparently didn't format the public key correctly for the authorized_keys file. However, after removing carriage-returns and adding "ssh-rsa" to the beginning and my username to the end of the appropriate line, I was able to use the key generated by Putty. Each key should be just one line in the authorized_keys file and its format looks like
ssh-rsa some-long-and-seemingly-random-sequence-of-characters=
with spaces before and after the actual key.

Update: 7/21/2005 - I found a related troubleshooting page here.

    Thursday, June 02, 2005

    It'll Never Work!

    Quotes from many sources about new ideas, such as...
    "Computers in the future may...perhaps only weigh 1.5 tons."
    - Popular Mechanics, 1949

    "There is no reason for any individual to have a computer in their home."
    - Kenneth Olsen, president and founder of Digital Equipment Corp., 1977

    "If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.
    - Peter Ustinov

    Wednesday, June 01, 2005

    40 Reasons to Support Gun Control???

    40 Reasons to Support Gun Control
    (Apparently derived from the essay by Michael Z. Williamson.)
    (a.k.a. Proof positive that Liberals are not just stupid, but insane.)

    1. Banning guns works, which is why New York, DC, and Chicago cops need guns.
    2. Washington DC's low murder rate of 80.6 per 100,000 is due to strict gun control, and Arlington, VA's high murder rate of 1.6 per 100,000 is due to the lack of gun control.
    3. Statistics showing high murder rates justify gun control but statistics showing increasing murder rates after gun control are "just statistics."
    4. The Brady Bill and the Assault Weapons Ban, both of which went into effect in 1994, are responsible for the decrease in violent crime rates, which have been declining since 1991.
    5. We must get rid of guns because a deranged lunatic may go on a shooting spree at any time and anyone who would own a gun out of fear of such a lunatic is paranoid.
    6. The more helpless you are the safer you are from criminals.
    7. An intruder will be incapacitated by tear gas or oven spray, but if shot with a .357 Magnum will get angry and kill you.
    8. A woman raped and strangled is morally superior to a woman with a smoking gun and a dead rapist at her feet.
    9. When confronted by violent criminals, you should "put up no defense — give them what they want, or run" (Handgun Control Inc. Chairman Pete Shields, Guns Don't Die - People Do, 1981, p. 125).
    10. The New England Journal of Medicine is filled with expert advice about guns; just like Guns and Ammo has some excellent treatises on heart surgery.
    11. One should consult an automotive engineer for safer seatbelts, a civil engineer for a better bridge, a surgeon for spinal paralysis, a computer programmer for Y2K problems, and Sarah Brady [or Sheena Duncan, Adele Kirsten, Peter Storey, etc.] for firearms expertise.
    12. The 2nd Amendment, ratified in 1791, refers to the National Guard, which was created by an act of Congress in 1903.
    13. The National Guard, funded by the federal government, occupying property leased to the federal government, using weapons owned by the federal government, punishing trespassers under federal law, is a state militia.
    14. These phrases," right of the people peaceably to assemble," "right of the people to be secure in their homes," "enumeration's herein of certain rights shall not be construed to disparage others retained by the people," and "The powers not delegated herein are reserved to the states respectively, and to the people," all refer to individuals, but "the right of the people to keep and bear arms" refers to the state.
    15. We don't need guns against an oppressive government, because the Constitution has internal safeguards, but we should ban and seize all guns, thereby violating the 2nd, 4th, and 5th amendments to that Constitution.
    16. Rifles and handguns aren't necessary to national defense, which is why the army has millions of them.
    17. Private citizens shouldn't have handguns, because they serve no military purpose, and private citizens shouldn't have "assault rifles," because they are military weapons.
    18. The ready availability of guns today, with waiting periods, background checks, fingerprinting, government forms, et cetera, is responsible for recent school shootings,compared to the lack of school shootings in the 40's, 50's and 60's, which resulted from the availability of guns at hardware stores, surplus stores, gas stations, variety stores, mail order, et cetera.
    19. The NRA's attempt to run a "don't touch" campaign about kids handling guns is propaganda, and the anti-gun lobby's attempt to run a "don't touch" campaign is responsible social activity.
    20. Guns are so complex that special training is necessary to use them properly, and so simple to use that they make murder easy.
    21. A handgun, with up to 4 controls, is far too complex for the typical adult to learn to use, as opposed to an automobile that only has 20.
    22. Women are just as intelligent and capable as men but a woman with a gun is "an accident waiting to happen" and gun makers' advertisements aimed at women are "preying on their fears."
    23. Ordinary people in the presence of guns turn into slaughtering butchers but revert to normal when the weapon is removed.
    24. Guns cause violence, which is why there are so many mass killings at gun shows.
    25. A majority of the population supports gun control, just like a majority of the population supported owning slaves.
    26. A self-loading small arm can legitimately be considered to be a "weapon of mass destruction" or an "assault weapon."
    27. Most people can't be trusted, so we should have laws against guns, which most people will abide by because they can be trusted.
    28. The right of online pornographers to exist cannot be questioned because it is constitutionally protected by the Bill of Rights, but the use of handguns for self defense is not really protected by the Bill of Rights.
    29. Free speech entitles one to own newspapers, transmitters, computers, and typewriters, but self-defense only justifies bare hands.
    30. The ACLU is good because it uncompromisingly defends certain parts of the Constitution, and the NRA is bad, because it defends other parts of the Constitution.
    31. Charlton Heston as president of the NRA is a shill who should be ignored, but Michael Douglas as a representative of Handgun Control, Inc. is an ambassador for peace who is entitled to an audience at the UN arms control summit.
    32. Police operate with backup within groups, which is why they need larger capacity pistol magazines than do "civilians" who must face criminals alone and therefore need less ammunition.
    33. We should ban "Saturday Night Specials" and other inexpensive guns because it's not fair that poor people have access to guns too.
    34. Police officers, who qualify with their duty weapons once or twice a year, have some special Jedi-like mastery over handguns that private citizens can never hope to obtain.
    35. Private citizens don't need a gun for self-protection because the police are there to protect them even though the Supreme Court says the police are not responsible for their protection.
    36. Citizens don't need to carry a gun for personal protection but police chiefs, who are desk-bound administrators who work in a building filled with cops, need a gun.
    37. "Assault weapons" have no purpose other than to kill large numbers of people, which is why the police need them but "civilians" do not.
    38. When Microsoft pressures its distributors to give Microsoft preferential promotion, that's bad; but when the Federal government pressures cities to buy guns only from Smith & Wesson, that's good.
    39. Trigger locks do not interfere with the ability to use a gun for defensive purposes, which is why you see police officers with one on their duty weapon.
    40. When Handgun Control, Inc., says they want to "keep guns out of the wrong hands," they don't mean you. Really.
    Credit goes to:
    Google it!

    See What You Share

    See What You Share
    A Showcase of Material Found on Peer-to-Peer Networks throughout the World
    This is more-than-a-little scary...

    Plain-English SysAdmin/Networking reference

    In searching for a quick-reference for tcpdump, I came across this site with tutorial / how-to type articles on System Admin tools, tcpdump, Snort, Apache, Samba, vi, and others... Pretty good information and well worthy of a blog entry just so I can go back and find it for further reading.

    This page is powered by Blogger. Isn't yours?