Wednesday, January 31, 2007

Complicity in Murder

This would have been more topical awhile back, but considering 
Saddam Hussein's execution is still in very recent memory it is 
worth remembering that the United States government has long been aware of the crimes that Saddam committed, and to a certain
extent complicit.  A key quote from Barry Lando:
The US gave satellite information, more to the Iraqis, enabling them to target Iranian troop concentrations, even though the US knew that the Iraqis were using chemical weapons.

Follow the link for an enlightening interview with a former 60 Minutes producer.

Monday, January 22, 2007

SSH Public Key Authentication

SSH Public Key Authentication
(password-less SSH authentication on *nix systems)

Its a pain to enter in passwords all day. If you are like me and have a dozen or more machines and accounts to maintain, password management gets ridiculous. A great solution is public key authentication. You create a public key and a private key on a client machine, and distribute the public key to the various accounts and servers you need to access. The public key identifies you, and your private key verifies your identity. You only create your key pair once, and place your public key on all the servers you want to configure for password-less login. If you do create another new key pair on the local machine, you will again have to follow the steps for configuring the remote machines.

Keep in mind, the idea is to have a key pair for a specific local account on a specific machine. If you want to be able to use password-less login from another machine, you should create a new key pair on that machine. DON'T simply copy your key pair to another machine.

Public key authentication also makes scripted remote management possible, but thats beyond the scope of this mini-article. So let's begin:

On Local/Client Machine
# Create .ssh directory unless it already exists
mkdir ~/.ssh
cd ~/.ssh

# Create your keypair. Specifying a password will protect your private key even if the private key file is compromised. Remember, the private key file identifies you, and if that file is compromised, the server is compromised as well. Regardless of password security, set secure permissions for this file.
ssh-keygen -t dsa
chmod 600 id_dsa

# Copy your public key to the server, specifically your remote user's home directory.
scp id_dsa.pub remote_username@example.com:/home/remote_username

# Now login to the remote machine via ssh

On Remote/Server Machine
# Create the .ssh directory unless it exists
mkdir ~/.ssh
cd ~/.ssh

# Create the authorized key file unless it already exists
touch authorized_keys2
chmod 600 authorized_keys2

# Append your public key to the authorized key file. Directly editing the key file is generally a bad idea. Then delete the public key file you copied to this machine.
cat ~/id_dsa.pub >> authorized_keys2
rm ~/id_dsa.pub

You may now logout, and log back in. This time you should be automatically logged in without a password prompt.

If you mess up, or your private key is compromised, there is a small amount of cleanup involved. On each of the configured servers, delete the line in the authorized_keys2 file that corresponds to your public key, and delete your local key pair as well. You can then start over.

Strip HTML Tags

It's trivial really...but regexp's are a bitch.

#!/usr/bin/ruby -n
puts $_.gsub(/<\/?[^>]*>/, "")

Sunday, January 21, 2007

Edit A Webpage in Place

This works for Firefox. Enter the following into the address bar.

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

This is an interesting hack. It is nothing of immediate utility, but combined with some other functionailty...


Thursday, January 18, 2007

UNBELIEVABLE!!!!

A quote from today's Senate Judiciary Committee hearings.

Specter: Now wait a minute, wait a minute. The Constitution says you can't take it away except in the case of invasion or rebellion. Doesn't that mean you have the right of habeas corpus?

Gonzales: I meant by that comment that the Constitution doesn't say that every individual in the United States or every citizen has or is assured the right of habeas corpus. It doesn't say that. It simply says that the right of habeas corpus shall not be suspended.


http://www.dailykos.com/storyonly/2007/1/18/15219/0788

Apparently our ATTORNEY GENERAL doesn't understand the fundamental premise of the Constitution, that ALL rights not EXPLICITLY given to the government are retained by the people.

Ruby Cheat Sheets

I found a handy ruby gem that makes reference very easy. gem install cheat to install the gem, then run cheat sheets to get a list of available cheat sheets. Run cheat cheat_name to display useful info.

Sunday, January 14, 2007

United States Activities Inside Iran?

This morning, national security advisor Stephen Hadley spoke about US engagement of Iranians aiding insurgents in Iraq.

When asked whether U.S. forces would cross into Iran to pursue those aiding Iraqi insurgents, he said: He said the priority "is what's going on inside Iraq. ... That's where we're going to deal with his problem." and, "Anytime you have questions about crossing international borders there are legal issues. ... We intend to deal with it by interdicting and disrupting activities in Iraq sponsored by Iran."

This response raises several questions as to whether the U.S. IS currently operating inside Iran. This administration has had a pattern of operating outside of established legal precedent (NSA wiretapping case, abuse of prisoners, suspension of habeas corpus, extraordinary rendition, etc, etc.), then dealing with the consequences (or lack of), later. In my mind, these aren't questions, but rather indications, but there is the cynicism and pragmatism.

Don't get me wrong, if people are assisting insurgents in killing our troops, they should be taken care of. Yet military incursions into a sovereign country against citizens of that country is an act of war, and war must be declared by Congress. Hence the "legal issues" mentioned by Mr. Hadley. Regardless, it has been apparent for some time that the administration's mind and direction are already set.

Just last Thursday, U.S. forces captured and detained 5 Iranian officials of relatively high rank. It has become obvious, that Iran is supporting at least the Shia side of the insurgency, and is establishing a political and military toehold in the power vacuum of Iraq.

War with Iran has already started. With politics, and on a small scale (on our side), soldiers. The battleground just happens to be Iraq.
References:
http://www.cbsnews.com/stories/2007/01/14/ap/politics/mainD8ML45IO0.shtml
http://www.washingtonpost.com/wp-dyn/content/article/2007/01/11/AR2007011100427.html
http://www.slate.com/id/2157489/fr/flyout

Friday, January 12, 2007

Disable Low Disk Space Notification in Windows XP

1.Click Start, click Run, type regedit, and then click OK.
2.Locate and then click the following key in the registry:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
3.On the Edit menu, point to New, and then click DWORD Value.
4.Type NoLowDiskSpaceChecks, and then press ENTER.
5.On the Edit menu, click Modify.
6.Type 1, and then click OK.
7. Logout.

From http://support.microsoft.com/kb/285107

Wednesday, January 03, 2007

Rails Development Using Vim

Rails developers fortunate enough to run OSX have raved to no end about TextMate, but what do the rest of us, being *Nix and Windows users, have available? RadRails is an EXCELLENT IDE, and I have used it almost exclusively for nearly a year now, but as an editor, like all software, it has severe limitations. It's a bit slow and too much of a memory hog for my taste, and not nearly as easy to extend as I would like.

In my experience as a Linux administrator and desktop user, I have learned to appreciate, and now love the Vi editor. Well, more accurately Vim. If you are using a GUI, Cream is an excellent set of customizations for GVim that make Vim more accessible to the new user.

To improve the state of affairs even further, there are various Ruby and Rails specific extensions and customizations that bring Vim to the point of being nearly as good, and better in some ways, than TextMate or RadRails. We're talking autocompletion, autoindention, syntax highlighting, abbreviations, and much much more. See this post (so useful to me that I mirrored it here) for how to tweak Vim for Rails development.


Saturday, December 30, 2006

Ugly fonts in GTK 1.2 Apps

In Ubuntu (and perhaps other distributions), the menus in GTK apps may have a huge, ugly, and nearly unreadable font.


To somewhat fix this, edit /etc/gtk/gtkrc.utf-8 and change the fontset definition.
style "default-text-better" {
fontset = "-bitstream-charter-medium-r-normal-*-*-100-*-*-p-*-iso8859-1,\
--bitstream-charter-medium-r-normal-*-*-100-*-*-p-*-iso8859-1"
}

class "GtkWidget" style "default-text-better"

This will fix the menus, at least.

Friday, December 29, 2006

Blogger Out of Beta

At long last, labels! Now posts can actually be categorized! The blog layout designer is very nice as well.

The suite of applications now offered by Google is amazing. They are all well written, simple, and user friendly. I have only two more wishes. The ability to back up account data, and public key encryption for GMail.

Friday, December 01, 2006

RubyGems Error

If you get this error when trying to install a gem:
/usr/local/lib/ruby/1.8/yaml.rb:133: [BUG] Segmentation fault

Run "gem environment" to find the "gem path" (i.e. /usr/local/lib/ruby/gems/1.8 ) and delete the "source_cache" file located in that directory.


Monday, November 13, 2006

Work Timer

I scratched an itch. Here's a simple task and time tracker written in Ruby.

Election Day Followup

It is great to be a cynic and have fears proven to be false.

Tuesday, November 07, 2006

Election Day

This is perhaps the most important day in recent memory. The results of today's election will affect the course of this nation and by proxy the world. Actually...one can only hope.

It is unfortunate that an opaque and untrustworthy voting system negates the democracy of the process. There are reports from Texas and Florida (go figure) about electronic voting systems switching Democratic votes to Republican. That's one hell of a bug, especially one-way. Not to mention that exit polling is not being done in many areas.

They say never to attribute malice to incompetence or stupidity...but yet again, cynicism colors my perception. I think it quite unlikely that the Democrats will win overall this election. Not that I particularly like the Democratic party, but the Republican party has done more to destroy the liberty of the American people than any of the enemies it has sworn to protect us from.

Monday, November 06, 2006

PHPMyAdmin Authentication Error

Error: PHPMyAdmin - Client does not support authentication protocol requested by server; consider upgrading MySQL client.
Explanation: The user's password is stored on the server in the new password format.
Solution: In the server MySQL console: set password for user@host = OLD_PASSWORD('the_password');

Sunday, November 05, 2006

Fedora Core 6

I decided to give Fedora Core 6 a go since I had to reinstall Linux anyway.

My First Thoughts:
  • Installation isn't too bad...much better than the slow Ubuntu LiveCD
  • I've got a lot of tweaking to do.
  • These icons are HORRID!
  • Where are my Nautilus bookmarks??? Where is the side panel???
I went the whole way and installed my entire toolset, here's to trying this out for a bit. My install notes are here.

Friday, November 03, 2006

Hard Lessons Learned...again

So yeah...I was trying to set up a VMWare virtual machine, and no matter what OS I tried to install, I would get errors. I poked around and noticed that a file in my /tmp directory was eating up ALL my disk space. A file with no owner...

Well, I can't delete it, so I go to single user mode...and still can't delete it. Oh joy!

Time to bust out the trusty Knoppix boot DVD. I run reiserfsck and find errors. Big surprise there. I run it again to fix and proceed to corrupt the partition even more. (Oh, by the way, this is my / partition, which is separate from my /home partition, thank god!!!). Of course the on-screen instructions DONT TELL YOU to --scan-whole-partition when you run reiserfsck --rebuild-tree ( it should be reiserfsck --scan-whole-partition --rebuild-tree /dev/hda1). So I proceeded to fubar my root partition beyond all recognition. Guess who didn't make backups???

I managed to clear space off my trusty 40GB IBM SCSI HD, and try to install Ubuntu Edgy Eft. 6 attempts later...I give up (due to some horrific installer bugs) and try Dapper Drake. I don't know what the hell is wrong with my box...but only the Xubuntu 6.06 installer worked. All the other installers hung at some point. Hey, maybe my RAM is bad. I'll start Memcheck before going to bed.

But anyway...my rant is coming to a close. Lesson learned...BACK UP YOUR SHIT. I had tweaked this box for almost 2 years running (thank you Debian/Ubuntu for in-place distro updates!) and I lost a LOT of config files...not to mention weeks of work logs, journal entries, and wiki entries stored in my /var/www folder.

Today sucked.

UPDATE: It was bad RAM.

Sunday, October 29, 2006

The Joke of Airline Security

From Wired:
Security researcher Christopher Soghoian created the Northwest Airline Boarding Pass Generator in the hope of spurring Congress to look closely at the nation's aviation security policies, which he calls "security theater."

The site lets anyone create a facsimile of a Northwest Airlines boarding pass, with whatever name they choose.

On Friday, Congress heard Soghoian's message loud and clear. But instead of promising to reform broken airport security procedures, Rep. Edward Markey (D- Massachusetts), a member of the House Homeland Security committee known for his defenses of privacy, wants the site shut down and Soghoian arrested.

A warrant was submitted, and the Feds broke down his door taking computers, etc. I guess it is a crime to point out that the emperor has no clothes. This "fake boarding pass generator" had nothing to do with computer security. Any 6 year old that can type on a keyboard could edit the HTML of an internet issued "boarding pass" and reprint it.

My point here is that the government really doesn't care about security. A state of fear is to be instilled in the populace, and limited token steps are taken to give the impression of security. Not only does this create a cycle of dependence on the powers that be for security, it is a slow path to the elimination of freedoms of the public and empowerment of the establishment.

Maybe I am just a cynic and see pretense and dissimulation in the place of stupidity, shortsightedness, and incompetence.

Saturday, October 28, 2006

Merchanthound.com

The Merchant Hound site is coming along quite nicely. Fun Ajax action, and very aggressive caching make for a fast enjoyable experience. I'd use the site myself if I bought anything online anymore. I am still working out some of the kinks in the page and database cache, so performance can be spotty at times, especially when I am committing changes for the day.

I fixed the XML product feeds today. They look beautiful on the Google feed reader.