dannyman.toldme.com


About Me, News and Reaction, Religion

Dan Savage Calls “Bullshit” On Parts of the Bible

Link: https://dannyman.toldme.com/2012/05/01/dan-savage-leviticus-bullshi/

http://youtu.be/ao0k9qDsOvs

What sort of disturbs me is the Christians walking out. The religion says you have an obligation to spread the gospel, to preach The Word. That means you ought to interact with non-believers and skeptics, not leave the room as soon as some public figure challenges some or another point regarding your religious faith.

Jesus would have stuck around, and perhaps had some salient response regarding the morality of slavery, stoning, and tolerance of non-traditional sexual practices.

1 Comment


Quotes

Know When to Hold’m

Link: https://dannyman.toldme.com/2012/05/05/stfu/

“If I were committed only to being right, I would go out and talk anyway, but because I’m committed to making a difference, I wait until I’m ready.”  –Julia Butterfly Hill

Feedback Welcome


JIRA, Technical

Work Note: Quarterly Reports from MySQL

Link: https://dannyman.toldme.com/2012/05/08/jira-sla-sql-query/

I am not a DBA. I am but a humble SysAdmin who gets asked to figure out things like “how have we been at meeting our SLAs over time?” After I try to excuse myself I’ll inevitably end up say at the JIRA database running a query like this:

echo
echo "Incidents (P3)"
mysql -u jira jiradb< <__id3q
select year(created) as "Year", quarter(created) as "Quarter",
    count(pkey) as "Total",
    sum(resolutiondate < date_add(created, interval x day)) as "Met SLA",
    sum(resolutiondate < date_add(created, interval x day)) / count(pkey) as "SLA %%"
    from jiraissue where pkey like 'OPS-%' and priority = 3
    and assignee != 'nagios' and issuetype = 26
    group by year(created), quarter(created) order by created;
__id3q

That above is a fragment from a shell script. Shell scripts are great for complex SQL queries, I find. Set a value x at interval x day and the output looks something like:

Incidents (P3)
Year    Quarter Total   Met SLA SLA %%
2011    2       xxx     xxx     x.xxxx
2011    3       xxx     xxx     x.xxxx
2011    4       xxx     xxx     x.xxxx
2012    1       xxx     xxx     x.xxxx
2012    2       xxx     xxx     x.xxxx

The query does some things that are newer to my limited understanding of SQL. For me the magic bits are sum()ed columns and the availability of quarter() … you can do monthly reports just as easily with month(). I’d love to concatenate Year-Month into a string like “2012-05” but for the purposes of making my boss a little happier queries like this are good to have in the locker.

Some day I’ll be hip enough to convert things like this into JIRA widgets.

Oh yeah, and if your SLAs are measured in “business hours” or “business days” this will give you only a crude understanding of how well you have met your SLAs … an accurate measure would probably get embedded in a handler that gets called on issue close which can evaluate SLA fulfillment per issue priority and the local work schedule.

1 Comment


FreeBSD, JIRA, Linux, Mac OS X, Technical

Strip Non-Ascii From a File

Link: https://dannyman.toldme.com/2012/05/10/mysql-not-configured-for-utf8/

I have had bad luck trying to coax this out of Google, so here’s a Perl one-liner:

perl -pi -e 's/[\x80-\xEF]//g' file.txt

Where file.txt is a file you want to clean up.

Why this comes up is because we have a web application that was set up to hit a MySQL database, which is incorrectly configured to store text as ASCII instead of UTF-8. The application assumes that all text is Unicode and that the database is correctly configured, and every week or two someone asks me why they are getting this weird gnarly error. Typically they are pasting in some weird UTF-8 whitespace character sent to us from Ukraine.

Eventually the database will be reloaded as UTF-8 and the problem will be solved. Until then, I can tell folks to use the Perl command above. It just looks for anything with the high bit set and strips it out.

Feedback Welcome


Sundry, Technology, Testimonials

Way to go, Facebook!

Link: https://dannyman.toldme.com/2012/05/22/fb-got-it-right/

I am skeptical of Facebook’s long-term prospects, but as a guy who has worked at his share of Silicon Valley startups, and as a guy who has taken a modest loss on FB by betting on an opening-day bounce, I have got to give them credit: their IPO “flop” means they got it right, and hopefully made the stock market a slightly better place:

1) By setting their price at, or in this case, above what the market will pay, the company’s investors make the most money off their stock. If there’s an opening-day bump, that means they left money on the table for the underwriting bankers to profit from.

2) By being such a “dud” hopefully they dampen future expectations that a hot IPO should “pop” on the opening day. The true value of the stock market is as a mediator of investment. Speculative trading is just white collar gambling.

And unless the company totally implodes before their lock out period, I am not worried about the rank-and-file employees either. In pre-IPO companies employees are typically awarded options at a very modest fraction of the stock’s future public price. Most Facebook employees are probably looking forward to some windfall in the near future; Some will become rich, many others will be able to afford a house on the peninsula, and more still will be able to zero out credit card debt, student or car loans.

Valley companies that want to succeed look out for their employees. Even at an old public company like Cisco, we get to purchase our public stock at a 15% discount, which means the employees get some nice equity action even in a down market. I won’t be crying a river for Facebook employees any time soon.

Feedback Welcome


Linux, Technical, Technology, Testimonials

Dear Ubuntu: Stop Asking me for my Password!

Link: https://dannyman.toldme.com/2012/05/24/ubuntu-password-prompt/

I like Ubuntu. Or at least I liked it a few years back when you got a very nice functional desktop out of the box … but that is a different gripe.

I really like an OS that updates the software for me. Really, downloading and installing updates is for chumps! Way to go, Ubuntu!

But here’s a feature that has been bugging me for years: the system pops up a window saying “hey, I’m going to update the system software for you.”

And I’m like “sure, go ahead, be my guest!”

Then it’s like “okay, please give me the administrator password.”

And I’m like “well, okay . . . but . . .”

Each time the computer pops up a window unbidden offering to do me a favor in exchange for my password, I am wondering when some bastard will get around to writing a bit of malware that offers to do something nice for me in exchange for my password. Maybe a web site can launch a convincing-looking software-update window and prompt me for a password. It is going to be epic just how many users can be convinced to type their system passwords into a malware site.

If you are a part of the system that has access to do heavy lifting, please do not approach the user asking for a password. It teaches the user that “hey, its normal for your computer to pop up some window and ask for a password and when that happens you should totally humor the computer and give it your password.” You want to update my software? Great! You want to check with the person using the computer to make sure its a good time? Great, ask away, tell them your plans. But when they say yes, just fricking do it, and don’t ask them for their password.

1 Comment


Arrr! . . . Avast!
Site Archive