Monday, April 25, 2016

Citizens?* Or mere taxpayers?
[* I don't mean Citizens United]

In a recent Harper’s, Marilynne Robinson remarked that whereas our society used to have citizens (who may have a sense of identity based on their country, maybe even pride in or aspirations for their country), we now speak mainly about taxpayers. Both the citizen and the taxpayer are creations of political rhetoric, she wrote, pointing out the power of words to shape our thinking.

But I want to write about paying taxes. As a taxpayer, I’m pleased that my federal and state income taxes are lower than they might be. As a citizen, however, I think it’s outrageous that marginal tax rate is so low for someone with my income.

Back in the 1970s, the top marginal tax rate was about 70% for single taxpayers and about 55% for married couples filing jointly. But ever since the Reagan administration, the top marginal tax rate has been something like 39.6%. I’ve paid this rate. My income hasn’t decreased since that time, but my marginal tax rate for 2015 was 28%. Which is nuts!

Why is the national debt ballooning? Why don’t we have enough money to repair roads and bridges, and to pay our teachers a decent wage? Yes, I know that teachers are paid with state and local taxes, but the federal government also contributed to education funding; these federal subsidies have decreased dramatically since the 1980s.

I also know that we’ve wasted a lot of money fighting wars that we never should have started, and that we have furthermore wasted billions on “security theatre” at the nation’s airports. But if you say, “I’ll support higher tax rates when the government stops wasting money,” you’ll wait forever.

Those are problems I can't solve, but there is an issue I'm considering. I had solar panels installed on my roof last year, and consequently I'm eligible for a tax credit. The question is: Should I ask the federal government (read: "my fellow citizens") to pay for part of my solar panels?

Because tax credits—and, to a lesser degree, tax deductions—are expenditures. A dollar not collected because of tax deductions or tax credits is a dollar not available to fix a road or a bridge; alternately, it's a dollar that can't be used to pay a park ranger, or a dollar we've got to borrow...

Why should I ask my fellow citizens to pay for [part of] my solar panels? I understand the offer is there, and that it's permissible for me to receive it, and as a taxpayer I "should" take it, as I'm entitled to.

But as a citizen, do I really have an obligation to? Following Kant, do I want my fellow citizens to take every legal tax credit and deduction available? As a taxpayer, all I'd care about is myself, but as a citizen...

So there's my quandary.

Sunday, April 24, 2016

Alaska Airlines to Hawaii?

Some folks say that Hawaiian and Alaska are the two best airlines to take to Honolulu. What with Dad's passing last year, I've been making quite a few trips, usually on Alaska; Carol and I just got back from a trip on Hawaiian. Here are a few opinions.
 AlaskaHawaiian
gate experience outbound checkin at San Jose terminal B; your gate may be in terminal A checkin at HNL Hawaiian terminal (can you spell c-r-o-w-d-s?); your gate is in main terminal and may involve quite a hike
Food A wide variety of paid options; usual complimentary beverages; water offered throughout the flight Complimentary meal and glass of wine. Snacks available for purchase; usual complimentary beverages; water offered throughout the flight
in-flight amenities Power outlet at every seat. I saw no power outlets on any leg of this past trip. Safety video (seen on both CA↔HI legs) was particularly entertaining.
baggage Bags come out I think within 20 minutes of landing. Carol's checked bag appeared 30 minutes after we were at the gate at SJC. widebody jet (A330, 2+4+2 seating) means more passengers, hence more bags

Postfix SMTP authentication update

The lovely Carol's blog got hacked, so I updated the password on our ISP account. Mostly this was a matter of changing the passwords on mail clients (Mail.app, thunderbird) but that didn't do it for cron(8)-driven commands that sent mail; for that I needed to update the passwords in old-school files. So now I'm telling you about it, where one of you is my future self :)

On the Mac Mini, the file is sasl_passwd, which I updated using vi(1). After that I had to root around a bit to find out how to update the map, which turned out to be quite simple, once I knew how.

bash-3.2# postmap hash:sasl_passwd
bash-3.2# ls -ot|head
total 440
-rw-------  1 root  16384 Apr 24 10:05 sasl_passwd.db
-rw-------  1 root    XXX Apr 24 10:01 sasl_passwd
-rw-r--r--  2 root  27097 Nov  1 14:32 main.cf
-rw-r--r--  2 root  27097 Nov  1 14:32 main.cf+sasl
-rw-r--r--  1 root  26615 Sep  9  2014 main.cf~orig
-rw-r--r--  1 root     44 Sep  9  2014 custom_header_checks
-rw-r--r--  1 root  26147 Sep  9  2014 main.cf.default
-rw-r--r--  1 root   7443 Sep  9  2014 master.cf
-rw-r--r--  1 root   7443 Sep  9  2014 master.cf.default
bash-3.2# exit
The hint came from http://www.postfix.org/SASL_README.html, particularly this:
  • Use the postmap command whenever you change the /etc/postfix/sasl_passwd file.

And on Debian Wheezy

For some reason the layout is a bit different.
root@p64:/etc/postfix# cd sasl
root@p64:/etc/postfix/sasl# postmap hash:passwd
root@p64:/etc/postfix/sasl# ls -ot
total 16
-rw------- 1 root 12288 Apr 24 10:09 passwd.db
-rw------- 1 root   XXX Apr 24 10:09 passwd
root@p64:/etc/postfix/sasl# exit
collin@p64:~$ echo how about this from p64? | mail -s well? MY.OTHER@EMAIL.ADDRESS
The message was received at my other email address, and I didn't get a bounce.

So apparently I got all this done in under ten minutes. How often does that happen??

Sunday, April 17, 2016

Recovering posts from a toasted wordpress site

The lovely Carol had her wordpress site hacked. Not knowing squat about wordpress except this, I naively thought it would be a Good Idea to pull the posts and the media off the site, blow it away, create a new site on top of it, and put the content back. It wasn't a problem finding the media; I tar(1)ed it up, gzip-ed (in vain) like this:
$ tar -tzf ~/uploaded-images.tgz
wp-content/uploads/
wp-content/uploads/2013/
wp-content/uploads/2013/01/
wp-content/uploads/2013/01/masthead_web.jpg
wp-content/uploads/2013/01/masthead_web-150x150.jpg
wp-content/uploads/2013/01/masthead_web-300x112.jpg
wp-content/uploads/2013/01/masthead_web-1000x288.jpg
wp-content/uploads/2013/01/masthead_web-500x187.jpg
…
But what about the text? I asked the lovely Carol, who said there was no need to capture the comments and a bunch of other stuff. She did, however, want her subscribers.

Following the method shown in that other posting, I went to the database and said

mysql> show tables;             
+--------------------------+
| Tables_in_REDACTED       |
+--------------------------+
| wp_commentmeta           |
| wp_comments              |
| wp_links                 |     
| wp_options               |
| wp_postmeta              |
| wp_posts                 |
| wp_subscribe2            |
| wp_term_relationships    |
| wp_term_taxonomy         |
| wp_termmeta              |
| wp_terms                 |
| wp_usermeta              |
| wp_users                 |       
+--------------------------+
I saved the subscribers off by typing mysql> select * from wp_subscribe2; which will do, because we don't have bazillions of them; a little scripting will get all the email addresses set up as subscribers for the new site.

She doesn't care about saving the old options, or comments, so all I need to do is save the posts and pages. We'll ask the designer who did the original design to please re-do it, once I can give her access.

So, what about saving the posts? It turns out that wp_posts has both the posts and something wordpress calls "pages." My first thought was to save everything into a nice file, like this:

SELECT * INTO OUTFILE '/$HOME/posts-outfile' CHARACTER SET utf8 FROM wp_posts;
which didn't work, because I don't have FILE privilege. Dang.

This worked fine though:

echo -e "use REDACTED\nSELECT post_type, post_date, \
    post_modified, post_title, post_content \
    FROM wp_posts where post_status = 'publish'; " \
 | mysql -h REDACTED -u REDACTED -p | tee $HOME/tempfile
So now I had her posts and "pages"

I then moved everything in the "root" directory of her domain into a subdirectory where nobody will look. By "nobody will look" I mean "nobody has permission." And by "nobody has permission" I mean 0700.

Now getting the data out of the aforementioned temp file was harder than I thought. My first naive thought was to do something like

sed -n 5p TEMPFILE
and just snarf'n'barf the rather long line I got. Bad idea. It almost worked, except for a few things:
  1. a bunch of newline characters, which were represented as "\n"; of course, HTML doesn't care about "\n" and just renders it like that....
  2. Some unwelcome <CR> (aka '\015' or '^M' or '\r') characters, which do a "carriage-return," putting the cursor back at the left margin but without scrolling the window. These caused a jumble of nonsense, but it was over toward the right, where you wouldn't see it without reading the whole thing through
  3. characters with the high-order bit set. These are things in the range 0x91—0x97, which are translated in this chart
I couldn't quite do all this with a shell one-liner, but I tried this:
grep '^page' published-posts-pages.out |sed -n 1p | tr -d '^M' | \
   sed 's/\\n\\n/<p>/g'
which was mostly okay. the bold blue ^M was entered by using <ctrl-V><ctrl-M> I think.

For the "page"s I think I just did the funky characters by hand, addressing (mostly) #1 and #2 in the one-liner. To take care of #3 (the "posts" had a lot more of these than the "pages") I wrote a little Python.

#!/usr/bin/python2.7 -utt
# vim:et:sw=4
import sys

the_line = sys.stdin.read()
sub_table = [
    [ 0x91, '&lsquo;' ],
    [ 0x92, '&rsquo;' ],
    [ 0x93, '&ldquo;' ],
    [ 0x94, '&rdquo;' ],
    [ 0x96, '&ndash;' ],
    [ 0x97, '&mdash;' ],

]
for old_thing, new_thing in sub_table:
    the_line = the_line.replace(chr(old_thing), new_thing)

sys.stdout.write(the_line)
sys.exit(0)
I stuck this into $HOME/bin/chars.py and then, to handle a typical post, said:
$ LANG=C; grep '^post    ' published-posts-pages.out | tr -d '^M' \
   | sed 's/\\n\\n/<p>/g' | sed 's/\\n/<br>/g' | sed -n 12p \
   | ~/bin/chars.py | pbcopy
A few things about this:
  • LANG=C was because I had been trying some other character sets. They didn't work.
  • after translating all the "\n\n"s into "<p>", there were some single "\n"s left, which I translated into "<br>"
  • chars.py of course was to do the right thing with those odd characters
  • I used the Mac OS utility "pbcopy" because the terminal emulator renders unknown characters as '?'. Of course, now that I have chars.py in the pipeline, this was probably superfluous. Well, I could just CMD-v in the wordpress window to add a new post.
That's about it. The site is now ready for the lovely Carol to fine-tune. The .htaccess file currently will allow access only to the IP address of this particular house. When it's ready to publish, we'll remove the IP address restriction.

Saturday, April 16, 2016

I just heard some rembrances of Walt

Walt Gerber had been senior pastor at Menlo Park Presbyterian Church for about 28 years before his retirement early in this millennium. I missed his memorial service a few days ago, but Carol and I watched part of the video recording.

I heard quite a few of Walt's sermons, though I attended MPPC for only about half of his tenure. To tell the truth, I don't remember a lot of what he said, apart from the phrase "hospital for sinners."

No, the biggest impact Walt had on me may have been through the words I heard today. Walt's colleagues recall his love and acceptance, his respect, his belief that God was at work in and through them. Walt always pointed people to Jesus; he talked with Jesus early and often. He knew many of his faults, and he went to Jesus with them.

One of Walt's "faults" was his reluctance to preach. He told us from the pulpit more than once (so I guess I did remember this) that every weekend was white-knuckle time. This became a blessing for the Church in that he would put other staff members into the pulpit quite often; he coached them and put them in front and eventually they graduated to become senior pastors, elsewhere in California, in Washington, in Houston (I think Doug F. has since moved to the east coast) and I don't know where else.

I can't imagine really being like Jesus or Paul, but I sometimes aspire to be like Peter. By this I mean I know I'm not sinless; I'm not self-sacrificial and I don't have as much love as Paul had. But Peter -- when he goofed up, he did it big-time. And when he repented, he did it big-time. I want to be like Peter.

And in the same way, I know I'm not as gifted in the ways I sometimes wish, but I can aspire to be like Walt. So that at my memorial, God willing some decades hence, there will be a few people who will say things like

  • I asked him for advice, and all he said was, "this is how you'll learn to hang on to Jesus";
  • I had written my resignation letter, and he called me out of the blue and said he loved what I was doing, and to keep up the good work;
  • I knew he was talking to Jesus then, because he was always talking to Jesus.
Walt wasn't perfect, but he was God's provision for MPPC--he was God's provision for the Church, and he used Walt at MPPC and turned his "faults" into blessings for the capital-C Church.

Why am I not like Walt today? One reason is that too often, I want you to think I'm clever or competent or something like that; therefore I say things or do things to try to get you to think that about me. If instead my aim were for you to think, "I'm loved" or "Jesus is watching over me to take care of me" or "God is working in everything that happens, so that I can grow up and be like Jesus," then I'd be further along the path toward Walt-ness.

Oh that my faults would become blessings for others through the grace of Jesus Christ, who died for us so that whether we are awake or asleep, we may live together with him!