30 September 2009

My $0.02 on Gun Control - Part 3

Part 3: Education as a Solution

Ignorance solves nothing. There is a lot of misinformation out there for and against gun control. I am not about to try to address any of them. There are already plenty of resources available for that: snopes.com and factcheck.org are a couple. Most of the misinformation is perpetuated by lobbyists on both sides and the common person does little or nothing to discover the truth.

What should everyone know?
Also, do not be afraid of guns. How? Familiarize yourself with them, not academically. Go to a range, rent a handgun, shoot it.

Personally, I am a fan of mandatory two year military service for all eligible 18 year olds. Among the many benefits, this would give most young men and many women the opportunity to learn first-hand how to properly handle firearms.

My $0.02 on Gun Control - Part 2

Part 2: The 2nd Amendment

In my previous post I outlined how I went from an inconsiderate gun user to a gun control advocate to a gun owner advocate.

Now, a look at the 2nd Amendment.
A well regulated militia being necessary to the security of a free State, the right of the People to keep and bear arms shall not be infringed.
What is a militia? According to the US Supreme Court, "... the 'militia' in colonial America consisted of a subset of 'the people'—those who were male, able-bodied, and within a certain age range." That definition is taken from Militia Act of 1792 which defines a militia as consisting of "every 'free able-bodied white male citizen' between the ages of 18 and 45 into a local militia company overseen by the state. Militia members were required to arm themselves at their own expense ..."

From the Wikipedia article on 'militia' ...
In its original sense, militia meant "the state, quality, condition, or activity of being a fighter or warrior." It can be thought of as "combatant activity", "the fighter frame of mind", "the militant mode", "the soldierly status", or "the warrior way".

In this latter usage, a militia is a body of private persons who respond to an emergency threat to public safety, usually one that requires an armed response, but which can also include ordinary law enforcement or disaster responses. The act of bringing to bear arms contextually changes the status of the person, from peaceful citizen, to warrior citizen. The militia is the sum total of persons undergoing this change of state.

Persons have been said to engage in militia in response to a "call up" by any person aware of the threat requiring the response, and thence to be in "called up" status until the emergency is past. There is no minimum size to militia, and a solitary act of defense, including self-defense, can be thought of as one person calling up himself to defend the community, represented by himself or others, and to enforce the law.
I believe the definition can be altered to include any law-abiding citizen regardless of age, race, gender, etc.

So, the militia--as known by the founding fathers--is not the military. It is comprised of ordinary citizens who are required to arm themselves and "who respond to an emergency threat to public safety, usually one that requires an armed response..." Does this sound like CCW permit holders to you? There sure are a lot of similarities.
  • States regulate who may hold CCW permits.
  • The CCW permit issuance process is well regulated by statute.
  • CCW permit holders are required to follow statutory laws most citizens never have to worry about.
  • CCW permit holders are required to arm themselves.
  • CCW permit holders may respond to threats to public safety. Though, they are by no means required to do so.
Granted, there is nothing in Federal or State law that makes a one-to-one militia equals CCW permit holders comparison. This is strictly my opinion but I feel I have made my argument clear. Armed citizens--particularly CCW permit holders--are a modern-day equivalent to a state's militia. If that is the case, then the US Constitution definitively grants the right to bear arms to these people.

"... shall not be infringed." That is a sticky point in the 2nd Amendment. There are valid reasons to infringe on a person's right to bear arms. Convicted criminals, the mentally insane, persons under the influence of alcohol or drugs, etc. should not have the right to possess a firearm. There are plenty of good reasons and case law to support this. However, law-abiding citizens should not have their right infringed upon.

My $0.02 on Gun Control - Part 1

This is a multi-part "mental dump" of something that has been weighing on my mind for a while. It is largely my opinion.

Part 1: Personal History

I once jokingly told someone that I was born on a horse and with a gun in my hand; that statement is not entirely false, after all, I grew up with guns and horses but this isn't about horses. My father was a competition rifle range shooter when I was very young and he taught me gun safety and how to properly shoot a gun. I have shot rifles, shotguns, and pistols since I have been old enough to hold one on my own but I had never thought much about gun rights, death statistics involving the use of deadly force with a gun, etc. Then I went to college.

During my first semester at the University of Utah I took Political Science 1010 from an anti-gun Democrat professor. Towards the end of the semester I wrote a paper advocating gun control. I walked away from that class a Democrat and with the belief that the wholesale removal of pistols (not all forms of firearms) from the public market and leaving them only for military and law enforcement was a viable solution for reducing gun-related crimes. I knew there were a lot of big holes in that idea. There's a lot of money in pistol manufacturing and dealing and the lack of a legal market would inevitably lead to an illegal market. Sure, pistols might be harder to come by and be more expensive, but they'd still be available to people who wanted them badly enough. At the time, I hadn't given much thought to the potential rancor that current pistol owners might have. Those were the biggest chinks in the armor of my belief.

My father, my wife, my father-in-law and certainly others thought I was off my rocker. I'm from a Republican state, a Republican family, and I married into a Republican family. Gun rights were (and still are) a big deal for them. Nevertheless, I held my ground. That is, until my father-in-law bought me a Cold War era Polizei-issue Walther P38 as a Christmas gift. I had a hard time convincing myself that it wasn't cool to own a gun. It Was Cool. It felt good in my hand. I enjoyed shooting it. Emotion started to wear away my belief in gun control. That belief wasn't entirely gone, mind you, but it was eroded.

I like to think of myself as being fairly responsible. My dad instilled in me a healthy respect for the damage a gun can do. I figured that, now that I have a gun of my own, I should have something to show to Big Brother that I can be trusted with it. So I got a Utah Conceal and Carry permit. By the time my CCW permit arrived in the mail my belief in gun control had entirely eroded and I was left instead with the belief that I had the right to protect myself and my family from anyone who would do us harm criminally. I started to see why gun advocates claim that "An armed society is a polite society. Manners are good when one may have to back up his acts with his life" --Beyond This Horizon (1942). It was about this time that I made my first handgun purchase. I bought a small Sig Sauer 9mm to carry on my person wherever the law would allow me to. And I did. Fortunately, I haven't had to use it in self-defense.

02 June 2009

Can Clausewitz be applied to Cyberspace Warfare?

I have been reading the Cyberspace Policy Review and many related articles written by security professionals, analysts, and the like (here's a good jumping off point). Reading articles such as the Review remind me of my military history classes and studying Clausewitz; that in turn makes me wonder if Clausewitz's military theories can be applied to cyberspace warfare. It may also be entertaining to use Sunzi (Sun Tzu for you folks accustomed to the Wade-Giles Romanization) as a framework.

There may be more to come. I need to re-read Clausewitz (and Sunzi) before I can answer my own question.

30 April 2009

Inner Narrative

Or, as Terry Pratchett may use the phrase: in-ear ne'er a Tiv.

This is primarily introspective but worth sharing. Also, as a byline, I am about to introduce you to A Prairie Home Companion. You'll love it.

Some time ago Riley introduced me to PHC and, in particular, the Professional Organization of English Majors a.k.a. P.O.E.M. (buy the T-shirt!) One of the items that got me hooked was the English Major's Inner Narrative.

I discovered that night that I am not alone: I, too, have an inner narrative. Granted, I did not get my B.A. in English, but History Majors share many things in common with English Majors. One cannot read and write as much as a History Major and not learn English as well as—or better than—any English Major. Just ask my wife (who has a B.A. in English), I speak and write better English than she does. (I love you Jessica.)

To read more P.O.E.M. scripts, search for "English majors script" and have a few chuckles courtesy of the PHC crew.

24 April 2009

The Benefits of a Late Start

Today is the day the company I work for moves the DOD Emall from its home at a commercial data center to a Defense Enterprise Computing Center (DECC) facility. I doubt that the information is classified but I'm not going to reveal which DECC facility we're moving to. Anyway, because the move is going to be a huge undertaking and will require most of the work be done after the sun goes down, I didn't have to be to work until 12:00 MDT.

I wish I could say I slept in, but I didn't and that's okay. I did something even better than catching a few extra winks: I barbecued a steak and fried some eggs outside and had steak and eggs for breakfast! (Sorry, no photos.)

I learned a few things this morning.
  1. I can't eat a large breakfast. I couldn't bring myself to finish the 10-12 oz. steak and four AA large eggs.
  2. The skillet grill attached to the BBQ works for cooking but the self-igniter does not work.
  3. I don't enjoy eating a great meal by myself. Unfortunately, my wife had already left for work; I missed having her with me.
  4. On the other hand, I only blog about things I do on my own so it may be beneficial—for the blog's sake—for me to do a few things solo once in a while.
I think I may have to make steak and eggs (or a morning barbecue) a fairly regular thing, though probably on Saturdays when neither the wife or I have to be anywhere too early.

14 February 2009

Changing The Default Keyring Password In Ubuntu 8.10

Several days ago I changed my user password on my laptop and noticed that, after a boot up or after logging in, the keyring manager would ask me for the keyring password in order to access the WPA password stored there for the various wireless networks I connect to.

My initial reaction was one of annoyance, but after several days I decided to do something about it so I went searching on Google. Not surprisingly, I found several solutions but most were either for versions of Ubuntu too old to be of use or too off base to be correct. Until I stumbled upon a solution that pointed me in the right direction (I can't find the link now, otherwise I'd post it and give proper credit).

Here's the solution for Ubuntu 8.10 (a.k.a. Intrepid Ibex)

Click Applications > Accessories > Passwords and Encryption Keys


Click Edit > Preferences.


You will be presented with a Password Keyrings tab with a "login Automatically unlock when user logs in." option. Highlight that line and click on the "Change Unlock Password" button.


Enter your current keyring password then enter your current user password and click Change. If you do not enter your user login password, you'll still be asked to unlock the keyring after logging in.


Done. Click "Close" on the remaining windows. The next time you log in you will not be prompted for your keyring password.

06 February 2009

My Political Compass

During my morning jaunt through other people's blogs courtesy of Google Reader I read one of my peer's 25 Things meme. One of his items was his political standing. Apparently, there's a political compass test on line (take the test). The test asks some pretty basic questions about your political standing then plots the results on a Cartesian coordinate system. I believe the results to be pretty accurate.

See my political compass

25 August 2007

Set up OSSEC HIDS web UI in OpenBSD Apache jail

Yesterday, I spent a bit of time searching the OSSEC mailing lists, manual, and wiki to find something--anything--OpenBSD-specific. I didn't find a whole lot. So, after some trial and error, I came up with a solution for hosting the OSSEC HIDS Web UI (v0.2) inside the default OpenBSD Apache jail (chroot'ed environment).

My OpenBSD server is running the 4.2 kernel (snapshot taken 2007-08-21) with the base install taken from snapshots (2007-08-23).

These instructions assume you have the $PKG_PATH environmental variable already set to your favorite/nearest OpenBSD package mirror.

# pkg_add php5-core

Follow the install instructions to enable PHP.

# pkg_add wget
# cd /tmp
# wget http://www.ossec.net/files/ossec-hids-1.3.tar.gz
# wget http://www.ossec.net/files/ui/ossec-wui-0.2.tar.gz

For those of you who enjoy checking the MD5/SHA1/GNUPG signatures of packages (HIGHLY recommended), take a look at the OSSEC HIDS Install Instructions.

# tar zxvf /tmp/ossec-hids-1.3.tar.gz
# cd /tmp/ossec-hids-1.3
# sh install.sh

Go through the install (see the link above for instructions) and configure OSSEC to install to /var/www/ossec

Start OSSEC HIDS

# /var/www/ossec/bin/ossec-control start

And install the web UI

# cd /var/www/ossec
# tar zxvf /tmp/ossec-wui-0.2.tar.gz
# cd ossec-wui-0.2
# sh setup.sh

The setup.sh script is pretty basic, it asks you for a user name and password to use with the web UI. Now, I'm not a big fan of having files in chroot environments (well, anywhere) with the x bit set unnecessarily, so ...

# chmod -x CONTRIB
# chmod -x index.php
# chmod -x setup.sh

And, for extra protection:

# mv setup.sh sh.setup

... or whatever you want to call it (don't presume that that is the name I chose :) ).

# vi ossec_conf.php

Change $ossec_dir to point to /ossec

/* Ossec directory */
$ossec_dir="/ossec";

The reason OSSEC HIDS and the web UI are installed in /var/www is because we're working in a chroot'ed environment; nothing on the inside can access the outside. The "inside" for Apache's jail is /var/www.

Finally, create a symbolic link in /var/www/htdocs to point to the ossec-wui-0.2/ directory.

# cd /var/www/htdocs
# ln -s ../ossec/ossec-wui-0.2 ossec-wui

Be sure to use the relative path. Remember, Apache, once started, won't be able to access anything outside /var/www (which becomes / as far as Apache is concerned). Test the install by browsing to http://yourdomain.com/ossec-wui. You should get the OSSEC Web UI with the OSSEC-generated alerts, et cetera. If you get an error telling you it can't access the OSSEC files (I forget exactly what it says), check the value of $ossec_dir in the /var/www/ossec/ossec-wui-0.2/ossec_conf.php file.

Cleanup.

If you don't want to hold onto the archives in /tmp, delete them or let the system clean them out on the next boot.

14 July 2007

A Brief Vim Tutorial

The following commands are based on the command set in Vim version 6.4 and later. For a more in-depth tutorial, use vimtutor at a Linux command prompt or use the gVim Tutorial for Windows. Additional Vim help can be found by using the :h command within Vim or by visiting the vim.org documentation.

Normal v. Edit Mode
There are two modes in Vim, the Normal (or Command) mode and the Edit mode. When Vim is first started it is in the Normal mode. This allows you to navigate through the file or perform advanced editing. If you are ever unsure about something you typed, press to place you in Normal mode. Then retype the command you wanted.

NOTE: All commands in Vim are case sensitive. If the Vim command is not working the way it should, check your Caps Lock status, it is probably on.

Navigation
There are several methods for navigating a file with Vim.
The h, j, k, l keys (the "legacy" keys)
h moves the cursor up one line
k moves the cursor left one character
j moves the cursor down one line
l moves the cursor right one character
The Left, Up, Down, Right arrow keys
Each arrow key moves the cursor one line/character accordingly
To move more than one line/character in any direction, enter a number then the direction key. For example, to move down 33 lines, enter 33j. To move forward three words, enter 3w.

0 (zero) moves the cursor to the beginning of the current line.
$ moves the cursor to the end of the current line.
w moves the cursor to the beginning (first letter) of the next word.
e moves the cursor to the end (last letter) of the next word.
gg moves the cursor to the beginning of the file.
#g moves the cursor down # lines.
G moves the cursor to the end of the file.
#G moves the cursor to line number # (eg. 485G will move the cursor to line 485 [try this in the Vim tutor]).
CTRL-G This command shows your location in the file and the file status.

Insert/Append
There are several methods for entering Vim's Edit mode. The most common are the Insert command and the Append command.
i Move the cursor to the desired location and then press i to enter the Edit mode. Vim will display "-- INSERT --" at the bottom of the window to indicate you are in Edit/Insert mode. Anything you type after issuing the Insert command (i) will be inserted into the file you are editing. To return to the Normal mode, press . Use the arrow keys to navigate while in Edit mode or press to return to Normal mode and use the hjkl keys to navigate.
a The append command will advance the cursor one character to the right and place you in Edit mode. As with the insert command, use to return to Normal mode.
A Begin appending at the end of the current line.
o (lower case 'o') This command creates a new line under the cursor, moves the cursor to the beginning of the new line and places you into Edit mode.
O (upper case 'O') This command creates a new line above the cursor, moves the cursor to the beginning of the new line and places you into Edit mode.

Changing Letters, Words, and Lines
r The replace command replaces one character. To change mall to mail, move the cursor over the first 'l' in mall and type ri to replace the 'l' with an 'i'.
R Replace more than one character. This command will place you in Replace mode which is similar to Edit mode except that every typed character will delete/replace an existing character. As with Edit mode, use to return to Normal mode.
cw This allows you to change a word. Move the cursor to the beginning of a word or segment of a word then type cw. The word (or remainder of the word) will be removed and you will be placed in Edit mode. Use to return to Normal mode.
ce This command removes the entire current word and places you in Edit mode.
c$ This command will remove everything on the current line from the cursor onward and will place you in Edit mode.

Deleting Letters, Words, and Lines
To delete more than one character/word/line, enter a number then the appropriate delete command. For example, to delete 100 lines, enter 100dd.

x This command deletes the character under the cursor
#x This command deletes # characters from the cursor to #.
dw This command deletes the word or partial word under the cursor.
d$ This command deletes a line from the cursor position to the end of the line.
C This command is similar to d$ except that it also puts you into Edit Mode.
d0 (d+zero) This command deletes a line from the cursor position to the beginning of the line.
dd This command deletes the current line in its entirety
#dd This command deletes # lines.
D This command deletes a line from the cursor position to the end of the line.

Pasting Letters, Words, and Lines
p This command puts the last deleted character/word/line at the cursor position
P This command puts the last deleted character/word/line before the cursor.
NOTE: For more advanced cut and paste techniques, refer to the Vim documentation, use :h y within Vim, or go to Lesson 6.4 in the Vim tutor.

Undo
u This command undoes the last command. Multiple u commands will undo multiple events.
U This command undoes changes to a whole line.
:u This is the same as u
CTRL-R Redo (undo an undo).

Search, Search and Replace
NOTE: Searches are case sensitive and use regular expression syntax. Case sensitivity can be overridden.

Searching
/ Searches for a phrase from the cursor position forward through the file (eg. /Hello will search for "Hello").
? Searches for a phrase backwards through the file (eg. ?Hello will do a reverse search for "Hello").
n Repeat the last search / or ? search again.
N Repeat the last search in the opposite direction.
CTRL-O Return to where you began your search, repeat to go back further.
CTRL-I The opposite of CTRL-O.

Search and Replace
:s/find/replace/ Search and replace on the current line only.
:%s/find/replace/ Search and replace globally.
:#,#s/find/replace/ Search and replace between line numbers #,#

Search Flags
These flags work for both :s// and :%s//
:s/find/replace/i will ignore case.
:s/find/replace/g will make the changes globally on the line or file.
:s/find/replace/c will prompt before making a change.
:s/find/replace/e will ignore errors.
NOTE: The search flags can be used together (:%s/find/replace/igc).

Use :h and go to |usr_12.txt| Clever tricks for more advanced search and replace options.

Quitting and Saving
:q This command will quit Vim
:q! This command will quit Vim WITHOUT saving changes
:qa! This is the same as :q! but will quit Vim if you are editing multiple files
:wq This command will write the changes to the file and quit Vim
:wq! This command will write the changes to the file and quit Vim (useful for "read-only" files)
:ZZ This is the same as :wq
:x This is the same as :wq
:x! This is the same as :wq!
:w filename This command will write the contents of the file to "filename"

Opening Files Within Vim
:e filename This command will open "filename" in the current Vim window/frame
You can also open files with Vim from the command line. (eg. vim file1 file2 file3). Vim will open file1 first, then file2, then file3. Use :n to move to the next file.