Archive for May, 2011

Django, Apache and Semaphores

Tuesday, May 24th, 2011

At work I use Loki to manage my buildbot infrastructure. It’s deployed on apache via mod_wsgi. Recenlty I’ve been having trouble with Apache crashing with one of two single error lines in the logs:

[notice] seg fault or similar nasty error detected in the parent process
or
[emerg] (28)No space left on device: Couldn’t create accept lock

I came across this post and found it very helpful. Start with seeing if there are left over semaphores when you stop apache:

# ipcs -s | grep apache

If that’s the case then first clear them:

# /usr/bin/ipcs -s | grep apache | awk ‘ { print $2 } ‘ | xargs ipcrm sem

Then tell the kernel to allow more semaphores by adding the followings lines to /etc/sysctl.conf

kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024

then run

# sysctl -p

Once I start everything back up this seems to have fixed my issues.

DIY macbook power supply repair

Monday, May 23rd, 2011

image

Not too long ago our power supply for our macbook died. Just wouldn’t charge anymore. Go a new on on eBay for $30. Problem is that one broke this past weekend at the magnetic connection that connects to the laptop. I had the old one still and the connector was still in good shape. Naturally I just took a pair of wirer cutters to both of them. Free fix! Now I have a working power supply and a power supply cord that twice the length of the original one.

Naturally Decaffeinated

Thursday, May 12th, 2011

I’ve decided there’s no such thing as naturally decaffeinated. Since decaffeination is a chemical process that removes caffeine and that doesn’t happen naturally. There’s not a natural process that reduces caffeine, and a man made chemical process can’t happen naturally. So how about we say Low Caffeine or Less Caffeine?

Mercy in the face of punishment

Sunday, May 8th, 2011

My son has been given mercy enough times to know that mercy means not getting punished. This past week in the face of punishment he requested mercy. His request was denied, but it gave me another opportunity to share with him the eternal punishment we deserve for the sin we commit. When Jesus faced punishment for our disobedience He too requested mercy and was denied. In His obedience we were graciously promised mercy when He paid our debt.

Philippians 2:8 And being found in human form, he humbled himself by becoming obedient to the point of death, even death on a cross.

When we are faced with punishment from our Heavenly Father at the end of times Christ will have already received the punishment and paid the debt we owe. There will be no need for us to plead for mercy for those who know Christ as their savior.

Philippians 2 continues:

9 Therefore God has highly exalted him and bestowed on him the name that is above every name, 10 so that at the name of Jesus every knee should bow, in heaven and on earth and under the earth, 11 and every tongue confess that Jesus Christ is Lord, to the glory of God the Father.

Our God that humbled Himself to a humiliating and excruciating death that we could live eternally in His presence.

The Inteligence of a one year old

Friday, May 6th, 2011

My one year old son was sitting on my lap this morning. He was humming and singing nothing in particular. My wife came over and asked him if he would like to sing The Wheels on the Bus. He considered this for half a second and responded with his favorite new word. “No.” Next she asked him if he’d like to sing The Intsey Weantsy Spider. “No.” Thinking it would be a good laugh to have him say no to something all kids always want she continues with sugar. “Would you like some cake and ice cream?” After careful consideration, he leans forward, looks her directly in the eyes and in a drawn out emphatic delivery responds “Pweeeese”.