Sunday, December 06, 2020

A lucky hdd recovery adventure

In all my years of home computing, I never had a catastrophic hard drive failure. Saturday's excitement felt like one, with I/O errors on the journal.

The usual graphical display on my computer was replaced by large white typewriter-style characters on a dark background, dire warnings about I/O errors, nonexistent device on remount, and other words I don't recall. I found a USB drive that still had knoppix 8.6, and booted. Diagnostics (CPU, memory) found no problems so I tried "e2fsck -y" on the failed partitions (both / and /home, which made me think "electronics" rather than "bad spot on the disk"). That ended with "Filesystem still contains errors!"

I tried to remove the journal with tune2fs, which insisted on first trying to replay the journal, that's right, the very journal I wanted to ignore/remove. After a few hours of futility, I had an idea. Since there were I/O errors on the disk drive, but all were happening at rather high block numbers (with at least 9 digits if I recall correctly), I thought, what if I just did a block-for-block copy onto a new drive?

Off to the store for a 1TB internal SSD with SATA connectors: about $100—a dime per gigabyte! This is an amazing time we live in. "fdisk -l" gave me the bad drive's layout; I partitioned the new drive with the same-size partitions... I think the new drive is slightly larger, but who cares? I copied the filesystem partitions over, and was pleasantly surprised to note that the filesystem uuids matched. (D'oh!) The root partition (just 60GB) was done in less than 10 minutes:

Linuxknoppix@Microknoppix:~$ dd if=/dev/sda1 of=/dev/sdb1 bs=1M
61440+0 records in
61440+0 records out
64424509440 bytes (64 GB, 60 GiB) copied, 408.774 s, 158 MB/s
knoppix@Microknoppix:~$ 
Muttering "Let fortune favor the foolish," I typed:
root@Microknoppix:/home/knoppix# e2fsck -y /dev/sdb1
e2fsck 1.44.5 (15-Dec-2018)
/dev/sdb1: clean, 309900/3909120 files, 5462752/15728640 blocks
root@Microknoppix:/home/knoppix# mount /dev/sdb1 /mnt
root@Microknoppix:/home/knoppix# ls /mnt
bin   etc    home            lib         media  proc  sbin  tmp  vmlinuz
boot  extra  initrd.img      lib64       mnt    root  srv   usr  vmlinuz.old
dev   foo    initrd.img.old  lost+found  opt    run   sys   var
root@Microknoppix:/home/knoppix# 
That may have been a little foolhardy, but I went to bed hoping for similar grace to befall on /home (over 800GB). The next morning, the copy was done. The news was happy:
root@Microknoppix:/home/knoppix# fdisk -l /dev/sdb
Disk /dev/sdb: 931.5 GiB, 1000207286272 bytes, 1953529856 sectors
Disk model: SanDisk SSD PLUS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5fa89795

Device     Boot     Start        End    Sectors   Size Id Type
/dev/sdb1  *         2048  125831167  125829120    60G 83 Linux                 ← root partition
/dev/sdb2       125831168 1953529855 1827698688 871.5G  5 Extended
/dev/sdb5       125833216  159387647   33554432    16G 82 Linux swap / Solaris
/dev/sdb6       159389696 1953529855 1794140160 855.5G 83 Linux                 ← /home
root@Microknoppix:/home/knoppix# e2fsck -fy /dev/sdb6
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Inode 33692836 extent tree (at level 1) could be shorter.  Optimize? yes

Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sdb6: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb6: 299071/56074240 files (1.4% non-contiguous), 54502379/224266934 blocks
root@Microknoppix:/home/knoppix# e2fsck -fy /dev/sdb1
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 309900/3909120 files (0.4% non-contiguous), 5462752/15728640 blocks
root@Microknoppix:/home/knoppix# 
Initial checks suggest that nothing important was lost. If something important had been lost, it would have been mightily inconvenient, but not really catastrophic. That said, I decided to add this device to my crashplan subscription.

Sunday, October 04, 2020

Collin reads the 2020 California ballot propositions

The following are of course just my opinions, informed by various biased information sources (all sources are biased, including yours)

Prop 14: authorize $5.5 billion in bonds for medical research

I think NO. Why bonds? If we want to spend money on research, just spend it; don't borrow it. This is like taking out a loan to fill the tank for the next year. I'm unconvinced by the proponents' arguments.

Prop 15: property tax on commercial and industrial real estate to be based on market value

YES. In the 1970s, proposition 13 was a bad idea (i voted NO), but only now do we understand the effect of REDUCING the property tax burden on businesses. When you or I buy a home, we buy it. When a company buys real estate, the company doesn't actually buy it; instead, there is some hocus-pocus by which the real estate doesn't legally change hands. Thus, those commercial and industrial properties that have different businesses on them than they did in the early 1980s—those properties are still owned by the same legal entities that are/were the landlords in the 1980s. Thus, the property tax burden on those parcels of real estate are based on the last "real" purchase, which was in the 1980s or earlier!

That's why homeowners now pay a higher share of the state's property tax burden then they did in the late 1970s.

It's time for businesses to pay their fair share of the property tax burden in California. Opponents say it'll increase the cost of doing business. Well, yeah. Failing to pass that will make it harder for your children and grandchildren to buy a home in California. What's more important? I've made my decision.

Prop 16: Make Affirmative Action Great Again

YES. Having read White Fragility and White Awake and the alarming statistics on racism's toxic effect on our country, I repent of my past opposition to race-based affirmative action.

The current ban on considering race, sex, color, ethnicity, etc. in public education, employment, contracting—the current ban is the way that the establishment is effectively saying "Keep Racism, Sexism etc. Alive!" It's time to reject that thinking.

Prop 17: Let parolees vote

YES. Parolees already have the deck stacked against them. Restoring their right to vote once they're "out" reduces recidivism. Let's give them a fair chance.

Prop 18: Let 17-year-olds vote in primary/special elections if they'll be 18 for the general

NO. Suppose this were the law in 2019. If you were born November 2, 1992, you could have voted in this year's primary election, but not if it were November 4th. So on March 3, you would have been 17 years and four months old.

Yeah, NO.

Prop 19: Close property tax loopholes

YES (as if you couldn't tell from the title I gave it). Why should inherited real estate be immune to reassessment— other than what's used for a home, I mean? Suppose a guy has bought two houses: one where he lives, purchased in the 1980s for about $125K, and another as a rental, purchased in 2000 for about $400K. When he and his wife die, the houses will likely be worth substantially more than what he paid for them. Suppose his heirs move into the family home, and keep the rental as a rental.

Both houses have changed hands; why should either of them be immune from reassessment (for purposes of calculating property taxes)? Even if the family home isn't re-appraised or reassessed, why should the rental be immune? Prop 19 doesn't require the famiily home to be reassessed in this case, but it would allow the rental to be reassessed—as it should be!

Prop 20: Disallows parole for certain offenses; requires more DNA samples to be collected

NO. This is rather a tough one. Prisons are already overcrowded. For-profit prisons love this proposition. This increases costs of various kinds; where is the evidence that it will reduce crime or improve the chances of catching perpetrators of future crimes?

What makes this a tough one is the scary stories of crimes that are currently considered nonviolent. But on balance I still think NO.

Prop 21: Allows localities to have stricter rent control than state law

NO. This depresses new construction and new improvements. I understand that rents are too high, but the state already has rent control, and further depressing new construction is absolutely not the answer.

Prop 22: Let uber, lyft, doordash &c to continue exploiting drivers

NO. Just no. Drivers really are employees.

Here's an example. Suppose you're an uber driver in Monterey, and you get a fare around 10am. You don't know where the fare's destination is; all you know is that they want a ride somewhere. If they want to go to the beach or to Pacific Grove or Carmel, that's fine, but you don't want to drive them to SFO because you would miss your 1pm medical appointment. Suppose you say "yes" and you find out they really do want to go to SFO? If you reject them, uber *will* penalize you. You really are not a contractor.

Uber and Lyft and Doordash and their ilk are mis-characterizing their employees as contractors. This injustice was remedied by state law, but now they want to overturn the law so they can continue exploiting drivers.

Prop 23: Stricter requirements on kidney dialysis clinics

YES. Operators of these (mostly lucrative) clinics do not want higher safety standards because they want to keep milking this cash cow. But people die because of preventable screwups at these clinics. I remember reading about a case where some plastic tubing came loose during dialysis and sprayed blood all over the place. A tech grabbed it and reconnected it. The patient died a few days later from an infection.

If a certified MD had been present, could that have been prevented? Would stricter safety procedures have been in place? Maybe, maybe not, but given that no MD was required, and given the industry's opposition to prop 23, I have eto guess that lots of these clinics don't have MDs present during treatment.

Let's put patients ahead of profits—that's what I think

Prop 24: Amends consumer privacy laws

NO. The legislative analyst points out (p. 67 of your voter information guide) that privacy requirements will be loosened on some businesses that are currently subject to state standards. Today if a business buys/sells personal data of 50,000 consumers, households, or devices annually are subject to those standards. The propsition doesn't include devices in the count, and raises the annual threshold to 100,000. To me that's a red flag.

Prop 25: Support state law replacing money bail system

YES. Money bail is unjust discrimination, as state law recognizes. But the bail system keeps the bail bonds industry alive. That industry exploits the poor and has political power (because of the profits generated) to keep this exploitation going. End this unjust pilfering of the disadvantaged, I say!

Monday, August 31, 2020

pdftk to the rescue (or: how to sign a PDF using a pen)

From the manpage: “If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents.”

True, but the usage isn't always intuitive. Well, maybe it would be if I did these things every day. Which I don't. This one thing, that I have to do every few months (trying to make it less frequent), goes something like this:

  • Receive a PDF; call it orig.pdf
  • print page 3, sign, and scan; call that sigs.png
  • Create a new PDF which is the old one for pages 1–2, the scanned image from the previous step, and the old one for page 4; save as signed.pdf
Here is my cheat sheet for next time:
$ convert sigs.png sigs.pdf
$ pdftk A=orig.pdf B=sigs.pdf cat A1-2 B1 A4 output signed.pdf
There. Now the next time I have to do it, I won't have to stare at the manpage and try to reconstruct this incantation.

Sunday, August 09, 2020

Some Words on Anxiety

I have been thinking lately about anxiety. You know what the Apostle Paul said about anxiety, right?
And, apart from other things, there is the daily pressure upon me of my anxiety for all the churches. Who is weak, and I am not weak? Who is made to fall, and I am not indignant?
2 Corinthians 11:28–29 (RSV)
That’s right; he felt the pressure, just like you do. You want people to choose love and faith and generosity, rather than indifference and fear and envy. You long to see Christ formed in them. And in these pandemic times, you can’t see them in person to encourage them, or hold their hands while you pray for them. Paul knew about that, too.
Night and day we pray most earnestly that we may see you again and supply what is lacking in your faith. Now may our God and Father himself and our Lord Jesus clear the way for us to come to you. May the Lord make your love increase and overflow for each other and for everyone else, just as ours does for you.
1 Thessalonians 3:10–12 (NIV 1984)
Is anxiety good then?

Well, it’s not really recommended. Another famous writing of Paul tells us not to worry about anything, but to pray about everything (Philippians 4:6–7). And the Lord Jesus himself told us,

So do not worry, saying, “What shall we eat?” or “What shall we drink?” or “What shall we wear?” For the pagans run after all these things, and your heavenly Father knows that you need them. But seek first his kingdom and his righteousness, and all these things will be given to you as well. Therefore do not worry about tomorrow, for tomorrow will worry about itself. Each day has enough trouble of its own.
Matthew 6:31–33 (NIV 1984)
I’ll add a pastoral word here: Paul the Apostle himself was at times beset by anxiety, so he is not scolding us, wagging a finger as he lectures us about worry. Neither is the Lord Jesus assuming a punitive posture in this extract from the Sermon on the Mount. Rather, his attitude is more like this father, coaxing his child to take a first step:
This is the same Jesus who said, “Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you and learn from me, for I am gentle and humble in heart, and you will find rest for your souls. For my yoke is easy, and my burden is light.” (Matthew 11:28–30)

That invitation from our Lord is intended for everyone who is weary and burdened, for those “in ministry” and for those who don’t think of themselves that way. In other words, it’s for you and me.

So let us come to him, let us take another step to him. That, more than any of our accomplishments or possessions, is what pleases him, and what brings us life and peace.

Saturday, July 25, 2020

Ash Wednesday thoughts

[found on the Notes app on my phone, from February]

It was a good day to die, as Garrison Keillor said of that spring day in Minnesota, with the tomatoes just planted. His aunt was looking over her garden when her heart just decided to stop.

His monologue came to mind today, Ash Wednesday. “Remember that you are dust, and that to dust you shall return,” say the priests. It’s a good thing for me to remember, because like most Americans, I tend to ignore my mortality. But it struck me the other day that I probably have fewer than 10,000 of them left.

Indeed, as I’ve heard a few times recently, “Life is short. We don't have much time to gladden the hearts of those who walk this way with us. So, be swift to love and make haste to be kind.” (attributed to Henri-Frédéric Amiel)

I hope in this Lenten season that I’ll be diligent to do that.


At the end of his monologue, Keillor remarked that it was indeed a good day to die. And if a good day to die, how much more was it a good day to live?

Tuesday, July 14, 2020

I’m blind! Well, I was, anyway

In case you missed it, Matthew Dutton-Gillet, formerly rector at Trinity Menlo Park (California) was caught misappropriating church funds for personal use, at least $125,000 taken over the past five years. I was very disappointed to learn of this news, but beyond that, I was surprised to note that the idea of jail time for Matthew had not occurred to me until some weeks afterward.

That was a blind spot for me. Matthew committed a crime, maybe more than one, and he admitted this. How did it escape me that this is a criminal case? I’m far from the only one; there are Trinity members who to this day say that the police should not have been informed. I suppose that because we like and respect Matthew, we don’t want to think he’s also a criminal.

Speaking of “cognitive dissonance”…

Last November, we learned that MPPC’s senior pastor, John Ortberg Jr., was put on personal leave because of an error in judgment regarding a certain volunteer. (In case you missed it, here’s a timeline.) Some things about the whole story were puzzling (why did that volunteer confide in Daniel Lavery, formerly Mallory Ortberg?), but because I like and respect John, I don’t like to think of him as recklessly endangering children. I didn’t want to think about it; I wanted all to be well. MPPC’s communications folks were ready to help me with that.

As you can see, I have blind spots galore. When it was revealed earlier this month that the volunteer was John’s younger son, John III, some scales fell off even my eyes. One puzzling question was shockingly answered, and yes, it now seems to me astoundingly reckless to allow John III to be alone with children to whom he felt sexually attracted.

In the week or so since I started writing this, I have seen a wide variety of responses from people I know personally at MPPC. Apparently I am not alone in my disorientation. As Jeremiah famously wrote, “the heart is deceitful above all things and beyond cure; who can know it?” It is difficult—for me anyway—to discern the severity and gravity of mistakes made by people we respect or admire. I now have a new understanding of how deeply and severely I at least can deceive myself.

Thus I am so very glad that the Lord Jesus Christ promised that the Spirit of Truth would guide us into all truth. How much I need to pay attention to that Spirit in these days!

Monday, July 13, 2020

Debian9 upgrade

I mentioned in an earlier post that upgrading from debian8 (jessie) to 9 (stretch) solved a display mystery. (I wonder if a 3440x1440 monitor will work on this distro.) This post will record mysteries created, rather than solved.
  • xsane: no devices found
    So I had to download brscan4, I forget where from... brscan4-0.4.9-1.amd64.deb
    Then I had to use brsaneconfig. Like this:
    sudo brsaneconfig4 -a name=mfc9340 model=MFC-9340CDW ip=192.168.1.40
  • …that's it for now!
I understand that upgrading to buster (debian10) will remove python2. Since I'm a Python Dinosaur (not really analogous to my granddaughter's "Dragon Pig" concept), python3 is the new-fangled (or -fanged) thing that I don't quite feel comfortable with.
And then there was an broadband internet service change 2020-08-14
"ping" tried to use ipv6 addresses. So I did this:
collin@p64:~$ cat /etc/sysctl.d/local.conf 
net.ipv6.conf.all.disable_ipv6 = 1
collin@p64:~$ 
And after filling in DNS servers in /etc/resolv.conf, I made it not a symlink and told network manager not to update it
BUT! That was a bad idea.
[main]
plugins=ifupdown,keyfile
dns=none                       ←add
...
/etc/NetworkManager/NetworkManager.conf
Why was it a bad idea? Because I thought I could use my ISP's nameservers. But since my IP address was assigned by AT&T, my ISP's nameservers rejected all my queries. I hate rejection. So I'll stop asking.