Sunday, January 26, 2014

A life worthy of the Lord?

What does it mean to live a life worthy of the Lord and to please him in every way (Col. 1:10)? Fortunately, Paul gives us some clues in the text immediately following.
And we pray this in order that you may live a life worthy of the Lord and may please him in every way:
  • bearing fruit in every good work,
  • growing in the knowledge of God,
  • 11being strengthened with all power according to his glorious might so that you may have
    • great endurance
    • and patience,
    and
  • joyfully 12giving thanks to the Father, who has qualified you to share in the inheritance of the saints in the kingdom of light.
Colossians 1:10-12
Bearing fruit in every good work: what does that mean? One thing is that spiritual wisdom, the wisdom from above, is "full of mercy and good fruits" (James 3:17, mentioned earlier). That is, as we are steeped in spiritual wisdom, our lives will bear good fruit.

This reminds me of something Jesus said in John 15: "No branch can bear fruit by itself; it must remain in the vine. Neither can you bear fruit unless you remain in me." Like the disciples, we must remain in Christ to bear fruit. Jesus also said that no good tree bears bad fruit (Luke 6:43), and the reverse; if my life bears good fruit, or the fruit of good works, it can only be because I've been transformed into a good tree. Indeed, Paul tells us to be transformed, so that we can show what (surprise!) the will of God is (Romans 12:2).

That we need help to be transformed is not a reason for despair; consider rather the promise: Paul prays for these Colossians that they would be full of the knowledge of God's will, in order that they can do all this stuff. I think this means that if we're filled with the knowledge of God's will, he'll transform us.

Which reminds me that there are a number of these commands: "be transformed" as above, "be filled with the Spirit" (Ephesians 5), "be holy," i.e., be set apart by God (1 Peter 1), not to mention "Be perfect" (Matthew 5)—for which we seriously need help.

Something about this new way to be human, then, is this: though our natural tendency is to be independent (to go our own way), the truth is that [1] we need help to live a good life, a fulfilled life; and [2] God wants to give us that help.

And that as he helps us, our lives will bear fruit in every good work. A God-pleasing life—may he grant that to you and me.

Saturday, January 18, 2014

Know God's will? More than that—to be filled with that knowledge

I've been thinking about one of my favorite prayers, from Colossians 1:
[W]e have not stopped praying for you and asking God to fill you with the knowledge of his will through all spiritual wisdom and understanding. And we pray this in order that you may live a life worthy of the Lord and may please him in every way…
Sometimes I think I'd like to know what God wants me to do. But to tell the truth it's not mainly so that I may live a life worthy of him. No, it's so that I can stay out of trouble and have nice experiences. Is it God's will that I attend this or that college, study this or that subject, live in this or that city, marry this or that person (or not), etc.?

When I've asked questions like that in the past (and the present too, to be honest), most of the time it's not mainly about pleasing him; it's about pleasing me. "What kind of life will I have if I choose X vs. Y?" is my real thought. Perhaps that's why the Apostle Paul gives us a few important points beyond just knowing God's will:

  • asking God to fill you…
    This isn't something I can necessarily figure out on my own; I need outside help
  • …asking God to fill you with the knowledge of his will…
    Not just that we might know what God wants, but to be filled with the knowledge of that will. What does it mean to be filled with knowledge of something? When the lovely Carol agreed to marry me, I was filled with the knowledge that she loved me and that we would be embarking on a new adventure together; there was room for little else in my head.
  • …through all spiritual wisdom and understanding
    What is spiritual wisdom? I'm not sure, but it reminded me of James 3, which talks about earthly "wisdom":
    But if you harbor bitter envy and selfish ambition in your hearts, do not boast about it or deny the truth. Such "wisdom" does not come down from heaven but is earthly, unspiritual, of the devil. For where jealousy and selfish ambition exist, there is disorder and every evil thing. But the wisdom from above is first pure, then peaceable, reasonable, full of mercy and good fruits, unwavering, without hypocricy. (James 3:14-17)
  • And we pray this in order that you may live a life worthy of the Lord and may please him in every way…
    Which is the point: it's not primarily that I can have the "wrinkle-free life" (to borrow a phrase from Patrick Morley), though God loves to give us good gifts; it's primarily so that I can live worthy of him and please him in every way.

    Now if things always went my way, if I never had any problems, if I never had to go to work… what kind of person would I become? Would I live worthy of the Lord and please him in every way? Maybe some people would, but I almost certainly wouldn't; I would likely not develop patience and compassion and generosity, but would probably be even more self-absorbed and impatient than I already am.

The prayer is for us (for me) to have a new way of living, or a new way of being human. Because what I need most is not more money, or fewer problems; what I need most is to be delivered from selfishness and greed and folly. And that's why I need to be filled with the knowledge of his will, rather than being filled with my own preoccupations and jealousies and petty ambitions.

A new way of being human, in other words.

"while VPNed to the office": part deux

I wrote earlier about communicating with my ISP's mail server while VPNed to the office, and some of my colleagues pointed out that I could instead just use split routing.

Split routing? That's where you tell the VPN software to only route these addresses but leave the other ones alone. The short version is, you put a script into /etc/vpnc/—let's call it /etc/vpnc/foo-vpnc-script—that includes these lines:

#!/bin/sh

# this effectively disables changes to /etc/resolv.conf
# DON'T DO THAT export INTERNAL_IP4_DNS=

CISCO_SPLIT_INC=2
CISCO_SPLIT_INC_0_ADDR=10.0.0.0
CISCO_SPLIT_INC_0_MASK=255.0.0.0
CISCO_SPLIT_INC_0_MASKLEN=8
CISCO_SPLIT_INC_0_PROTOCOL=0
CISCO_SPLIT_INC_0_SPORT=0
CISCO_SPLIT_INC_0_DPORT=0

CISCO_SPLIT_INC_1_ADDR=172.16.0.0
CISCO_SPLIT_INC_1_MASK=255.240.0.0
CISCO_SPLIT_INC_1_MASKLEN=12
CISCO_SPLIT_INC_1_PROTOCOL=0
CISCO_SPLIT_INC_1_SPORT=0
CISCO_SPLIT_INC_1_DPORT=0

. /etc/vpnc/vpnc-script
That's right, /etc/vpnc/vpnc-script looks at those variables, and runs route(8) with the appropriate parameters. Alert readers will note that of the rfc1918 addresses, I left out the 192.168.0.0/16 range. That's my home network, which I don't want routed.

The other thing is, you need a configuration file in /etc/vpnc/; let's call it "foo.conf", which you'd fill in something like this:

IPSec gateway <gateway name/addr>
IPSec ID <secret info>
IPSec secret <more secret info>
Xauth username <your userID>
Script /etc/vpnc/foo-vpnc-script
Then you can say something like $ sudo vpnc foo.conf; when you're done, your routing table ought to look something like this
collin@p3:~> netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         <unchanged>     0.0.0.0         UG        0 0          0 eth0
10.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 tun0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
172.16.0.0      0.0.0.0         255.240.0.0     U         0 0          0 tun0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
<your-vpn-gw>   <unchanged>     255.255.255.255 UGH       0 0          0 eth0
collin@p3:~> 
Much nicer than all the complexity of my earlier post.

Saturday, January 04, 2014

Atmos Energy? Really? Oh, it's proflowers

The really interesting-looking email appeared in my inbox today. It urges me to click on (some ".nl" link) to find out why natural gas is the best choice for clean and responsible energy use, and urges me to click on (another ".nl" link) to see my latest bill.

At first, I wondered if this might be the natural gas equivalent of telephone slamming, but why would my gas supplier be in Europe? Then I looked at the "To:" address on the email and my doubts were erased.

That's right, I used a uniquified email address when ordering flowers from ProFlowers. The scammers claiming to represent "Atmos Energy" (which may as far as I know could be legit) got my email address from proflowers, who are now on my hate list.

A word to the wise...

Friday, January 03, 2014

system(3) gives ECHILD, and all I did was ignore SIGCLD (I hate zombies)

This was a little puzzle, and the tracks are rather obscure, so I thought I'd tell you about it.

I wrote a program that creates a lot of child processes. These child processes may die of their own accord, or they might be killed by the parent process. Consequently, I had (a) few options:

I chose the last option, because it seemed easiest. In hindsight, though… well, I'm getting ahead of myself.

One child process itself spawns a child process (i.e., a grandchild of the SIGCLD-ignoring main process). This grandchild process used the library function system(3), which would often return an error ECHILD (i.e., "No child processes").

I decided to do a web search, something like this; which led me to http://fixunix.com/unix/84125-system-fails-errno%3Dechild.html; the author offers the following throwaway comment: I know one reason for this is that SICCHLD is set to SIG_IGN.

"Whoa," I thought, "that's exactly what I did!"

Here's the thing: the implementation of system(3) creates a child shell process, which runs the command in question; the parent process calls waitpid(2) or something like this, which gets the status from the child (the shell). "Most" of the time, the parent calls waitpid(2) before the child process terminates, and thus has no problem reaping the child's status.

But what if the child completes before the parent calls waitpid(2)? Well, normally the child process becomes a zombie until the parent can reap it. But according to sigaction(2):

  POSIX.1-1990  disallowed  setting  the  action  for  SIGCHLD to
  SIG_IGN.  POSIX.1-2001 allows this possibility, so that  ignor-
  ing SIGCHLD can be used to prevent the creation of zombies (see
  wait(2)). …
Since this grandchild's ancestor had set SIGCHLD to SIG_IGN, and nothing had changed it back to SIG_DFL, zombification was getting preempted; thus, when system(3) tried to reap the status of its already-terminated child (shell) process, nothing was there, not even a zombie, and ECHILD resulted. Once I learned the cause of the problem, the fix was easy:
signal(SIGCLD, SIG_DFL);
before the first call to system(3).

Really, though, I should have coded the main process in a more POSIXly-correct manner, and avoided this whole mess. Live and learn.