Monday, April 30, 2012

Validate executable exists in shell

Like this!

#! /bin/bash
command_validate() {
command -v ${1} >/dev/null 2>&1 || { echo " WARNING: I require ${1} but it's not installed. Aborting." >&2; exit 1; }
}
command_validate passwd
exit 0


Is that cool, or what?

Via the always helpful stackoverflow.

Saturday, April 28, 2012

Door knob

A thing I knew before today but never really thought about:

At a cost of $3.00 each, it is cheaper to buy a used door knob from the Habitat for Humanity ReStore than to pay a guy to re-key a lock for which you have lost the key.


Tuesday, April 24, 2012

Any other form of existence doesn’t interest me.

I'm doing up thing at work that features a little shell scripting, a lot of Kermit: glue to do a thing with free tools that the big expensive EDI application can't do for itself.

After hours of gazing at complete but scattered kermit docs, examples, source code, I was able to very carefully type the meat of my script.

rename /replace:{{}{\%6-\%7}{^}} \m(filename) \%4

This is the watershed.  It's all downhill from here.

Now the shell script can iterate over a text file, pass variables to the kermit script which contains that painfully wrought line above.

kermitget.sh ftp.blah.com user password destination store prefix date-time

And all kinds of crazy Turing-stuff will happen. 

A three-line function will call a 20-line Kermit script, process hundreds of customer names, thousands of files.  Data flies into EDI which sends it to JDE which turns into orders, requests.  Things get built, shipped.  We make money.

Stuff happens.

"Meaningful Work or Death. Any other form of existence doesn’t interest me."


Saturday, April 21, 2012

Instructions on Friday the Thirteenth - Max Wolf Valerio

Instructions on Friday the Thirteenth   -   Max Wolf Valerio


Fall asleep with your contacts on

dream of forests lit up with light bulbs



And the thirteenth floor

        disappears –                  an elevator floats inside the liquid tower 



                  wake up again           and again            under     

                        scrolling stars – 


 

And there is a Catskill eagle . . .

Love is like a friendship caught on fire. In the beginning a flame, very pretty, often hot and fierce, but still only light and flickering. As love grows older, our hearts mature and our love becomes as coals, deep-burning and unquenchable.

~Bruce Lee

And there is a Catskill eagle in some souls that can alike dive down into the blackest gorges, and soar out of them again and become invisible in the sunny spaces. And even if he for ever flies within the gorge, that gorge is in the mountains; so that even in his lowest swoop the mountain eagle is still higher than other birds upon the plain, even though they soar.

~Moby Dick



Thursday, April 19, 2012

You got your programming in my systems administration

You've got Puppet.  You got your emacs.  This is how to make them play nice together.

Get puppet-mode.el here.

Edit .emacs like so

(when
(load
(expand-file-name "~/.emacs.d/puppet/puppet-mode.el"))
(package-initialize))

(setq auto-mode-alist (cons '("\\.pp$" . puppet-mode) auto-mode-alist))


And voy-la - .pp files are now pretty and tab correctly automagically.

Fuck .... fuck ... fuck .. fuck fuckfuck!

RT : RT : Look kids! A real live SPACESHIP. You'll be able to go watch it rot in a MUSEUM.

I did not love Shuttle.  Too big.  Too expensive.  Too government.  Too design-by-committee.  Not enough mission.  Too much 'we have a space station to justify the Space Truck that justifies the space station'.

Those wings ... those stupid wings.

And now it's all gone and we're paying a platoon of bureaucrats astronauts to train to ride to space in another country's ships in fucking Soviet designed rockets.

I am an optimist.  I believe what will come next, SpaceX or Blue Origin or whatever, will be better, will be the start of the real space age.  Spaceships and industry and bases and people in the high frontier forever and ever amen.

I do, I do, I do.

But I did love the idea of her.  An actual space-ship.  American-friggin-made.  Up like a rocket, glides home like a prayer.  Manned missions to space, an expression of the best of what we are as a civilization.

I'll miss that gorgeous complicated expensive beautiful fragile flying machine. 

You'll never see her like again.


See also here.

Monday, April 16, 2012

Vobis non me dux

We need a little more of this:
... better yet, give him the real reason: "Well, I need a magazine with thirty-three rounds in it because f&#$ you, Ed." Seriously, where does he get off thinking how many "bullets" are in my magazines is any business of his? Vobis non me dux, Ed; you ain't the boss of me.




Gadsden Flag



Don't Tread On Me.  Vobis non me dux.  Same thing, different verse

Cereal

I said "I'm going to Wal-Mart - anyone need anything?"

"Cereal," said the children.

"Hmm.  I bet I could make cereal .."

"No!" the littlest one cried.  "Food poisoning!  We'll never eat cereal again!"

Drama queen.  He ate one piece of bread from my first batch.  It was not good.  I've gotten better since.

How hard could it be ...

The goal is to make the dough extremely thin with areas of near transparency. You may notice that you are in effect making one huge bran flake at this point.

Seems to meet my standard for manufacturing at home: cheap, easy, quick, repeatable.  And you only need to add raisins to produce the acme of breakfast cereals.


Sunday, April 15, 2012

The only solution is to do more of the same that has not worked in the past

[Obama] added, “I personally, and my administration’s position, is that legalization is not the answer.” Drug operations could come to “dominate certain countries if they were allowed to operate legally without any constraint,” he said, and “could be just as corrupting if not more corrupting then the status quo.”

Obama Says Legalization Is Not the Answer on Drugs


When you automate crap you get very fast crap

I was pointed to 'The Venus Project' as The Way Things Will Be in the Post Scarcity world.

The model aims to incorporate sustainable cities and values, energy efficiency, collective farms, natural resource management and advanced automation into a global socio-economic system based on social cooperation and scientific methodology.

Communism with robots would still be as shitty as old-fashioned industrial-age Communism.



Communisim



Meanwhile, over here in reality Gerrib notes that the actual present is a post-scarcity world.



Tuesday, April 10, 2012

Breaking Fast

Well that Lenten Fast went by pretty quickly.


Credit for the idea - in hindsight - goes to Travis, who is the only person I know of who has given up 'blogging' for Lent.  He did it first. Or 'did it first in my limited circle of acquaintances.


Some people died, things happened.  Without a lot of blogs to read I had
no idea that they died, who they were, why I should care.  So I
didn't.  That was nice.


Facebook can go f* themselves.  Nothing personal, I just don't feel a burning desire to re-mire myself in that slough of suck.  Except that my daughter insists on posting pictures of my grandson there.  If I didn't get to see him practically every day I'd have no idea what he looks like.


Still making Bread, at home.  I've gotten better at it.  First I had to stop trying to cowboy the thing and follow the work instructions to the letter.  Then I learned what you can cowboy, and what has to be done just so.

The recipe work instructions?  Go here, google 'bread'. 


The older kids made a shantytown at school, to learn what it was like to be in the Bonus Army. They skipped the tear gas part which takes away half the fun.  Also they weren't very good shanties, what with being _inside_ and all.  If I were in charge I'd have them build something big and important, more representative of that era, something you had to work at.  Hoover Dam.  World War II.


"Glance at the sun.
See the moon and the stars.
Gaze at the beauty of the earth's greenings.
Now,
Think."


Hildegard of Bingen