Archive for the ‘News’ Category

More Wget

Thursday, April 10th, 2008

It’s hard to understate the usefulness and robust feature set that most of the GNU tools have in their arsenal. Today, I’ll make mention of one such tool, wget, and a novell use of the command.

As I go through my work, I find that sites we agree to take over have little structure. They generally were slapped together a long time ago, with little thought to organization, made with Dreamweaver or, Stallman forbid, FrontPage. I’m not judging; as long as something looks okay in the browser, a company can proclaim, “We’re on the intarwebs!” However, tracking down all of their pages to be converted into a CMS, for instance, can be time consuming. Not wanting to waste a client’s money by searching through the source for links and images, then manually reconstructing the layout of the files, I fell on my trusty GNU tool wget. (I also did not have FTP access, but I knew there were dead pages that I didn’t want to resurrect. Using wget in this case helped me retrieve only the pages that were still linked to from the main page).

Here’s a variation of the incantation of wget I used:

wget -r -A '*.htm*, *.jpg, *.png, *.gif' -l 3 http://www.example-site.com

What’s it all mean?
-r: wget should retrieve recursively
-A: takes a comma-separated list of patterns to match files to accept (use -R to reject). In this case, we want all htm, html, and most picture format files.
-l: denotes how far down the rabbit hole to venture. I started with 1, so only links from the first page were parsed and followed. I then tried 2, following links that were a level below the parent and compared the resulting structure. Trying 3, I found no difference between 3’s results and 2’s results, meaning all links had been followed and accounted for.

The result:
A directory called www.example-site.com that contains the files in their layout on the server. Now I knew which pages needed converting and which images to add to the new site.

A side note: A handy way to see the layout of your newly downloaded directory is to use the tree command.

tree www.example-site.com/

will display something like this:

www.example-site.com/
|– about.html
|– calendar.html
|– committees.html
|– contact.html
|– otherdir
| `– index.html
|– images
| |– header.gif
| |– logo.gif
| `– spacer.gif
|– index.html
|– join.html
|– news.html
|– partnerships.html
`– scoopholiday.html

Walk the Walk

Wednesday, April 2nd, 2008

I’ve had the pleasure of working on the technology that powers iliveinspired.com and know that the founders, Rob and Chris, are working their butts off to make this a great service. Armed with not much more than inspiration and determination, they are taking their service to the world by foot. Their first foray into marching marketing was to sign the Dalai Lama on as a content provider. Not only did the Dalai Lama receive them (read about their trip, starting here), but he embraced them and their message and agreed to work with the service.

Now these two are on a mission to sign Oprah and are generating some press about it. Pick up the story from their blog here, and then read about some of the press they’ve gotten here, here, here, and here. This is a great service, there are lots of different themes to choose from, and it’s a cheap service that can provide a lot of value. Why else would they offer the first 45 days free of charge?

What’s keeping you from living inspired today? Visit I Live Inspired and start receiving daily inspiration on your phone.

Michael Scheuer and Ron Paul

Friday, February 22nd, 2008

There may not be a better authority on Osama Bin Laden than Michael Scheuer. Intimately involved with the tracking down of bin Laden from at least 1996 to 2004, Scheuer has also written several books dealing with the handling of the Middle East by our government over the last 40 years or so. So when this man speaks on the Middle East and bin Laden, he speaks with authority that is unrivaled by most anyone else.

With that in mind, have a listen to an interview he gave recently (video was posted February 19th, 2008). Two things, among the many, that I found enlightening: first, Scheuer makes it clear that bin Laden and al Queda do not hate us for our freedoms, liberties, etc, as Bush, Guiliani, et al, have tried to ram into the conversation. It is about our involvement in the Middle East that bin Laden fights against. Second, of all the presidential candidates, Scheuer believes Ron Paul “gets it”.

Having a girlfriend invested in the green movement, I’d be remiss to comment on another bit of Scheuer’s interview and I’ll paraphrase my understanding of his remarks. When you look at the Middle East, what is there that is of interest to the US? Oil, obviously. Hmm… umm… gee… well… Not much else! So if our government were to get serious about investing in green energy and not using it to garner support while not producing results, we’d lose our interest in the Middle East, at least from a policy perspective. So using less oil = stopping the support of terrorism!

Here’s my beef for the current crop of Bush clones: they preach Christianity, family values, and all that. Fine, all well and good. However, it seems not a week goes by that a Bush supporter in the Congress doesn’t go down in flames with a scandal. But most important of Jesus’ teachings was the Golden Rule: Do unto others as you would have them do unto you. Take a moment and think back to how mad, upset, fearful, irate, how incensed with anger you were on September 11th, 2001. Planes were high-jacked and rammed into the World Trade Center. Now imagine that level of violence occurring everyday. Now double it, and double that. You’re starting to get an approximation of what the average Iraqi goes through each day. Imagine having to cope with all of those emotions everyday. Imagine, upon waking, not knowing whether you’d live or die in some suicide blast or gun fight. A terrible world for anyone. And yet our government is subjecting a country to that everyday with their occupation.

I implore you, regardless of political affiliation, to investigate Michael Scheuer’s writings and interviews and see an expert talk about the situation. Then compare that to the view given by your favorite candidate.

More important than any other issue today is our foreign policy, including the economy. Our next president must understand what’s at stake with respect to the rest of the world, not with respect to a small part of it (namely the European Union countries).

The slim silver lining here is two-fold. Wean our economy and way of life off oil and we lose interest in the Middle East, and, support Ron Paul and bring a man into office that is knowledgeable in both foreign policy and the economy.

Join the REVOLUTION

Save the Tongass

Friday, February 1st, 2008

Add your name to the list of those that want to save the Tongass (read more here).

Call (202-205-1661), write, or email Abigail Kimbell of the US Forest Service and let her know your disapproval. The form email sent from the NRDC site is:

Chief Abigail Kimbell, U.S. Forest Service
1400 Independence Avenue, SW
Washington, DC 20250-0003

Dear Forest Service Chief Kimbell ,

I strongly urge you to protect all remaining roadless areas in
the Tongass National Forest and to direct Forest Service
officials not to increase costly road-building or logging in
this precious national treasure. Roadless areas comprise our
last wild places and they should not be made vulnerable to
logging, drilling or other development. As a nation, we must
continue to safeguard the heart of our national forest legacy by
protecting the ecological health, wildlife habitat, drinking
water and recreational value of those few American forests still
unspoiled by roads.

It makes no sense to use taxpayer subsidies to destroy the
Tongass, America’s great rainforest and one of the crown jewels
of the national forest system, and jeopardize all that it offers
for local hunting, fishing, recreation, tourism and subsistence
use.

Time and again, citizens like me from around the country have
called upon you and the administration to protect the Tongass.
It’s time to heed this overwhelming public sentiment by
preserving, not destroying, the remaining wild stretches of this
truly unique part of our natural heritage.

Sincerely,

YOU!!!

Save $150 Billion Much?

Friday, February 1st, 2008

It’s a sad state of affairs that we as voters must wade through so much posturing and pandering by the presidential candidates. Particularly hard is when we find out after they are elected that their words were vaporous and meaningless. What’s a voter to do?

A study released January 29th of this year by the National Taxpayers Union Foundation helps tax payers cut through the facade and see the real truth, expressed in hard numbers. Keep in mind that the United States has trillions of dollars ($9,200,874,834,693.13) in debt, is spending close to $1 trillion a year on Iraq and Afghanistan, and is facing the housing market implosion. Now, with all this economic unrest, which candidates actually want to do something about it and save some dough?

The four respective frontrunners in the two parties (John McCain, Mitt Romney, Hillary Clinton, and Barack Obama), proposed overall fiscal policy agendas whose net effect would raise annual federal outlays between $6.9 billion and $287.0 billion.

The top-tier GOP candidates often portrayed as “conservative” (Mitt Romney and Mike Huckabee) actually called for significantly larger spending hikes ($19.5 billion and $54.2 billion, respectively), than the so-called “moderate conservative” (John McCain, $6.9 billion).

Among Democrats, Barack Obama, often described as ideologically more “moderate” than Hillary Clinton, actually has the larger agenda of the two ($287.0 billion vs. $218.2 billion).

Defense-related spending items received the highest proposed spending increases among Republican candidates. Huckabee and Romney, for example, offered $67.2 billion and $40.6 billion, respectively. Among Democrats, Clinton’s biggest boost goes toward health care ($113.6 billion) and Obama’s for economy, transportation, and infrastructure ($105.0 billion).

Two of the eight candidates proposed sufficient spending cuts that more than offset their new spending plans: Rudy Giuliani (-$1.4 billion) and Ron Paul (-$150.1 billion).

Taking into account that Rudy Giuliani has dropped out, this makes Ron Paul the only candidate that actually wants to save the country some money, and he wants to do it on a large scale. Why are we pouring in so much money in taxes, to support a government that doesn’t represent us? Why would you support a candidate that wants that trend to continue? Where is this money going to come from?

Would you rather not pay income taxes? I know I would. What if you got to keep an extra third of your income? Don’t you think that’s a bigger chunk than a proposed $300 tax rebate Congress is now considering to “stimulate” the economy? I know it is significantly more for me. I would rather spend the money that I earned than some small rebate the government gives me. We don’t know the source of that rebate either. The administration is currently engaged in deficit spending, racking up more debt to pass on to future generations. How long until China calls in those debts?

It’s time to make the government stop spending, and the only way to do that is by electing Ron Paul, the only candidate left that is 100% for real about cutting spending and saving US citizens their hard-earned income. Read his views, compare them with an open mind to the other candidates, and you’ll see Dr. Paul is truly about getting our country back on track.

Join the REVOLUTION

MySQL -> CSV

Wednesday, January 30th, 2008

Always on the lookout for increases in efficiency, I love when I find a slick snippet of command line goodness that makes a hard sounding task simple and quick. I was tasked with creating an email list from a database and putting it into a csv format, and had only the command line to interface with the DB. My first attempt revolved around using the SELECT … INTO OUTFILE syntax. Unfortunately, I was unable to write out to a file with the DB user I had access to. What’s a fella to do?

Unix pipes to the rescue.

First, the whole command:

echo “select * from example;” | mysql -u user -p dbname | tr ‘^V^I’ ‘,’ > filename.csv

Let’s break this down, in case Ben is reading and can’t follow along. The echo statement contains your query. It is sent to the mysql command, which connects you to the database and executes the query, returning the data in tab-delimited format to the console. The tr command reads from STDIN, and replaces tabs (Ctrl-V Ctrl-I) with whatever delimiter you want (in this case the comma). The final touch is sending it to a file of your choosing.

*Note* - You actually have to type the Ctrl-V Ctrl-I when entering this command. Copy/paste won’t cut it in the example above.

*Note* - You typically do not want to actually enter your mysql password on the command line, as commands run are typically logged. Omit the password to force mysql to ask for it (it won’t interfere with the query). And if you don’t have your mysql access password protected, WTF? You’re asking for trouble.

So there you have it. Simple, easy to follow, effective. As always, this example can be extended into a variety of different ways. It’s up to you to figure it out (you can, of course, pay me to figure it out).

Happy MLK Day

Monday, January 21st, 2008

As we celebrate the life and message of Dr. Martin Luther King, we need to consider his work unfinished. With the presidential campaigns in full force, spreading their vision for the future, it has become clear that one candidate, for me, is truly offering a world view that makes sense.

Dr. Ron Paul is bringing a vision that actually differs from the other candidates. He is challenging the status quo and it is working because there are constant attempts to exclude him from the debates, from political coverage, to label him “un-electable” (thanks Faux…I mean Fox News). Despite this, Dr. Paul’s message is building enthusiasm and excitement across the country.

There are many issues important to me that the candidate must offer solutions to for me to be interested in them (a note: we are interviewing these candidates to be our president, so we need to be as demanding as possible so we get the best. Don’t settle for one based on party lines; consider each viewpoint, which means actually reading about candidates you don’t agree with). First, and probably most important, is Iraq and our withdrawal from Iraq. Goodbye most of the Republicans. Dr. Paul wants us out and for so many good reasons. I believe Dr. Paul is 100% correct in his assessment of why 9/11 happened (speaking of, does Giuliani appear if you say 9/11 three times, like Beetlejuice?). Our foreign policies, our military presence in so many foreign countries, our lust for oil all contribute to us treating other countries, particularly in the Middle East, as second- or third-class world citizens. Sound familiar? Think back to this country’s struggles with civil rights and all the emotions and violence it created (Civil War anyone? KKK anyone). Why do we find it so shocking that we treat foreign governments in much the same way blacks were treated, and the people of those governments lash out at us much the same way the African-Americans lashed out at the establishment for the last 150 years? Fortunately there were voices like MLK to calm the violence and provide a peaceful plan to uplift society. Ron Paul speaks of this peace, on the global scale, and we need to heed that voice!

A second issue, which, while just barely lower on my list than the war, probably is the most important issue our country is facing, and that issue is the economy. For too long the Federal Reserve (a private institution) has held our money supply in its clutches. The FR has gotten us so far away from the Gold Standard that our money is severely devalued. Talking about Nevada and its recent caucus, Dr. Paul wrote in his newsletter:

Nevada, by the way, is known as the Silver State for a reason-its great mining industry produced the precious metal for the beautiful silver dollars minted at the fabled Carson City mint. These constitutional coins, include .775 ounces of silver, in accord with the Coinage Act of 1792. Today these coins, worth $1 in my father’s day, have about $14 in silver. That is, the dollar is worth 1/14th of what it was, thanks to the counterfeiting Federal Reserve.

1/14th of what they were! Economic theory is hard to swallow for most, I know, but this is a pretty clear example of the dire position our economy is in. To make matters worse, this was the situation before the housing bubble burst, and before the Iraq War. You toss those two economic clusterf@cks into the mix and its no wonder the word “recession” is tossed about so freely. From an economic standpoint, we’re sending billions of dollars each year to Iraq, in the form of troops, aid, weapons, etc, and yet we are in the midst of a huge housing crisis, our dollar is severely devalued, and we are being loaned money at an alarming rate by China to finance the war. Do we really think China will not use our debt to them as leverage to get what they want? Since when did the United States put themselves in the pocket of a communist country? And from all the discussion, not a single candidate, aside from Dr. Paul, is seeing the connections and planning accordingly. They want to fix the effects, rather than address the causes, and it seems most want to print more money to assuage the economic crisis.

It is clear to me that Dr. Paul is the guiding light that truly offers the right kind of change, a principled change, based on sound reasoning and policy, and brought to us by a principled man. No candidate can be one-size-fits-all to the American people; we are too diverse for that to ever be the case. However, I believe Dr. Paul’s message to benefit most the common man, middle- and lower-income families, and the American image abroad. Isn’t it time we had a president who actually had policies intended to let Americans live as they see fit and not as some bureaucrat in Washington sees fit?

If so, read his thoughts on the issues and donate to Dr. Paul’s campaign today! Join the REVOLUTION!

Portland is fun

Saturday, December 8th, 2007

While the weather has not cooperated and given me many sunny days yet, I have been enjoying exploring the cyber-presence Portland has, in particular the Craigslist offerings. Today, however, brings a new entry in the NW Nerdery: a movement to rename 42nd Ave to Douglas Adams Blvd. The site, rename42nd.org, is making a serious effort to have the 42nd Ave renamed in honor of Douglas Adams, most notable for authoring the Hitchhiker’s Guide to the Galaxy series. My inner geek smiles wide for this effort and hope they succeed. If you are a Portlander, support the movement. I know I am…

7 Days, 7 Nights, 7 Minutes

Friday, October 19th, 2007

One of the projects I’ve been helping get off the ground is I Live Inspired, an inspirational text-messaging service. The site is good, and the concept is great. One can never have too much inspiration.

The founders, Rob and Chris, are on a mission. They are seeking an audience with the Dalai Lama in Indiana and are walking 7 days in hopes of getting a 7 minute audience. They are also keeping a blog of their adventures. These guys are not much older than me and are trying to get a positive service off the ground. Whether they have audience with the Dalai Lama or not, the experience of the walk, the people they’ve met thus far, and the people they’ve yet to meet, will change their lives. And we get to share in that through their writing.

So take a minute, read up on what the future of America is up to, and if you want some extra inspiration delivered to your phone daily, consider signing up for one of the many great communities at I Live Inspired.

* Disclaimer: While I have helped create the site, I do not receive any compensation for spreading the word. I think its a great service and deserves notice.

Pambiche

Friday, October 5th, 2007

While highlights abound on the Portland tour, one in particular deserves mention. I’ve dined at some pretty sweet places and eaten some fairly exotic foods. While they’ve all been good and memorable, I found that a little Cuban place in Portland has taken the top spot in my dining history. What’s amazing about Pambiche is the unassuming atmosphere surrounding the restaurant. Walking up to, I had no idea what I was about to experience.

Sadly, I was only able to eat there once while in the city, so I can only speak to one dish, Ajiaco. Described as a “one pot meal that comes brimming with a variety of tropical roots and vegetables, corn dumplings, creole seasoned pork and beef”, this tasty meal was unlike any other food I’d tasted. Very subtle flavors and aromas with each spoonful pleased my tastebuds and tummy. And while Cuban food is not traditionally spicy, Pambiche had a homemade spicy sauce which complimented the dish wonderfully.

I am not a food critic so it’s hard to do the experience justice. Next time Portland dining is available, head over to 2811 NE Glisan and taste it firsthand. I plan on doing just that!