Thwarting Telemarketers

I’ve posted before about Asterisk, the computerized phone system I’ve been using in my home for about a decade now. One thing I love about it is kicking calls over to special functions based on Caller ID. Known telemarketers get a tone and a message saying the number has been disconnected.

I just wish that was available on my cell phone!

I have a spare phone that sits on the counter, permanently plugged in to the wall to keep the battery charged. Our plan was actually cheaper to have this unused phone than to not have it, so we have it. It has been getting calls every few days, probably people calling the person that used to have the number. I ask telemarketers to add us to their ‘Do Not Call’ list, but they then ask what number to add. I don’t know, it’s a spare phone I never use.

So I took the audio from Asterisk and made it the voicemail greeting on this spare phone. Here it is, in case people have a use for it.

Favorite Podcasts

I love podcasts! I’ve been listening to them for about 10 years, and am always finding new ones that I like. I started podcasting in 2008 myself because I liked listening to them so much. I’ve pondered getting satellite radio a few times over the last decade, but always quickly remind myself that podcasts are better. They’re on-demand, and can be downloaded locally so they don’t need an internet connection or clear view of the sky to listen.

My list changes from time to time, but I wanted to share the ones I enjoy. I’m breaking it down into two lists; one is Christian, and the other is not. The “not” list includes tech podcasts, politics, general interest, or whatever doesn’t fit the category “Christian”.

I also want to note that I don’t get to listen to podcasts nearly as much as I would like. Some of the entries below I listen only very occasionally, but I still count them among my favorites.

General Interest

I just wish I had more time to listen. I’ve been trying to break myself of one habit for years that would help a little in that regard. I mentally treat podcasts differently than radio. If I have a podcast on in one room and need to leave the room, answer the phone, or take my attention away for any other reason, I pause it first. It’s a habit I just can’t break, I live in a DVR world where we don’t have to miss anything because of an interruption. I could get through more if I made a playlist in the morning and didn’t touch it for the rest of the day, it would be more like tuning to my favorite radio station and leaving it on all day.

Note: the links to the right under “Favorite podcasts” like the other links over there, get updated about as often as the makeup of the US Congress, if not less often. Don’t be surprised that they don’t match up perfectly.

Bitten by the Home Automation Bug

Not quite two years ago, I wrote about a little timer I made using an Arduino microcontroller and a simple relay. The purpose was to turn a couple lamps on in my living room automatically at sunset, and off around 11:00pm. An old-fashioned timer doesn’t work so well because sunset changes every day, and the timer needed to be reprogrammed every couple of weeks.

That little project was fun, and the timer was quite useful for awhile. However, a few weeks ago, the relay burned out or something went wonky and the project died. I needed a replacement, and didn’t want to take time to rebuild my original timer.

Then I discovered the Belkin Wemo line. There are a few products in the Wemo line, but the one I was most interested in was a simple switched outlet. The advantage is that they are web connected, and can be turned on and off with an app from anywhere you have an internet connection. Among the simple programs is switching relative to sunrise and sunset. It would work nicely. However, I discovered something in the process that would work even better.

Read the rest of this entry »

Securing Asterisk with IPTables

I’ve been running my phone system through Asterisk on Debian (Linux) for a number of years. I’d consider myself a novice to intermediate user of Linux, even though I’ve been tinkering with it for over a decade. I also don’t play with Asterisk very often, but like to get things set up comfortably from time to time so I can leave it alone for awhile.

I recently upgraded from Asterisk 1.6 to 11. In the move, I also spent some time taking a close look at the CLI, which caused me to notice a lot of attempts to either call extensions on my system that didn’t exist, or log in to extensions that didn’t exist. It was apparent that there were attempts being made to hack my system. It was time to dig deeper into security before someone succeeded.

In the past, by happenstance, I tended to avoid some practices that make it easier to hack an Asterisk system. The primary one being I didn’t put any extensions in the default context. Hackers seem to like to focus on that one, and with nothing there, there really is nothing to hack.

That wasn’t enough though. I really wanted to lock things down and prevent the attempts themselves. The best way, I found, was to bone up on IPTables, the most common firewall on Linux.

I took inventory of what I was doing with my system, and realized that there is only one outside account/system that I use that should need to connect to my system. I have a few phone numbers at, and need their server to be able to reach me if anyone should call one of my numbers. Everything else is internal to my home network.

Below is a set of rules that I put into my IPTables to allow in traffic from IPKall, but block anything else that is attempting to connect to this particular machine.

I should note that SIP is the only service that is open to the internet on this machine. Should I ever need to log in to it via SSH, I would do so by way of another machine on the internal network, either directly or by proxy.

The following is in a shell script. I know very little about IPTables, and learned quickly that the best way to ensure the rules behave as expected is to always start from scratch. If I need to change my rules, I’d do so in this script, and run it again once I’ve made my changes.


# First, I flush out the existing rules
iptables -F

# Next, allow all traffic on the localhost loopback interface
iptables -A INPUT -i lo -j ACCEPT

# Allow already established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow tcp and udp traffic from IPKall and all traffic from the local network
iptables -A INPUT -p tcp -s -j ACCEPT
iptables -A INPUT -p udp -s -j ACCEPT
iptables -A INPUT -p all -s -j ACCEPT

# Allow voice streaming for SIP from IPKall - Note I use a much more limited port range than the default
iptables -A INPUT -p all --destination-port 21000:21030 -s -j ACCEPT

# Set default policies for everyone else (not IPKall or local)
# Disallow any connections on port 5060 (SIP), but allow all outgoing traffic
# Note that 5060 is the only port that forwards to this machine from outside the network,
# so any traffic on any other port would be blocked at the NAT router itself,
# never bothering this machine in the first place
iptables -A INPUT -p tcp --destination-port 5060 -j DROP
iptables -A INPUT -p udp --destination-port 5060 -j DROP

So there you go. This post is really for the benefit of people doing searches for Asterisk and IPTables, and I hope someone finds this useful.

My Reality Show Idea

It seems I’m the only guy in America that doesn’t have a reality show. So I came up with an idea to get one.

A little background is necessary. My reality show would be food-based. I’m not the pickiest eater in the world, but I’m in the top 1% for sure. A while back there was a show on one of the cable stations called “Freaky Eaters” that made me look more-or-less normal, but I’m far from it. My pickiness goes back my entire life. As most kids go through a picky phase but eventually grow out of it, I never did.

My pickiness developed into a sort of phobia. I sometimes have people who think they’re going to convince me to change, but they miss one key element of my pickiness. The most recent example was in February, while on a group trip to Israel. One guy (who meant well), thought he could talk me into trying local foods. He was making comments at nearly every meal for the first few days. Eventually I had to explain it in a way that he could really understand who I am in regard to food. I explained it like this: some people are afraid of the dark, others are terrified of heights, I really don’t like trying new foods.

There’s a caveat to it though. People can live long, relatively normal, and healthy lives avoiding heights and overly-dark places. However, eating only a few different foods, of marginal nutritional value, eventually catches up with a person.

So my reality show idea is to pair people like me up with world-class chefs that can make trying new foods far less scary or intimidating. Of course, it would mean the chefs would have to have a certain level of ability to not take things personally. As a person trained in Architectural design myself, I know that creative people need a fairly thick skin to be successful.

Off the top of my head, I’d love to be paired up with a guy like Gordon Ramsey (who has several reality shows going at any given time), or Graham Elliot (one of the judges on “Master Chef”).

To add a level of interest, it would be fun to not only be introduced to good foods by people who really know food well, but to be taught how to make things that I would end up liking. Ironically, as picky as I am, I do like to cook. I really like to learn to make the things I like, as well as a restaurant would make them.

This show doesn’t have to revolve around me, or around me and the chef. It could feature different chefs, along with different picky eaters. I think it would be interesting to have a few chefs paired up with a few picky eaters, and show segments of each pair every episode, and all the pairs are on for an entire season.

I just have no idea who to pitch this show idea to. If anyone in a TV production company happens to trip over this post, and this sounds interesting, shoot me an email. You can do so by emailing my first name (Andy) at this website address.

HTPC: Revisited

Almost two years ago, I posted of my transition away from cable/satellite TV to using only internet & over-the-air and a Home Theater PC. Since it has been almost two years, I thought it a good time to update how things are going.

We’re still every bit the “cord cutters” we were back then. We haven’t missed satellite tv, and haven’t looked back. There have been some minor changes to our setup, as I’ve learned more and found different things to enhance the experience.
Read the rest of this entry »

Programming the ChronoDot DS3231 Real Time Clock

In my last post, I introduced my new hobby tinkering with the Arduino microcontroller. I also mentioned a timer that I’m building to power some lamps in my living room.

Since the Arduino doesn’t have a clock built into it, there is an interesting problem wherein there is no way to ensure that the Arduino will turn the relays on and off when I want it to. Enter the Real Time Clock (RTC). It’s a small clock chip with a battery. You program it once to set the time, and from then on it will keep time rather well. The one I have will keep time within a minute or two per year, which is plenty accurate enough for turning on lamps.

The biggest issue I’ve run into is that it has been hard to figure out how to program it with the right time. There are example sketches (program code) out there that will do it, but not exactly as I need it.

The code I got from Jack Christensen over at Adventures in Arduinoland assumes that the clock is set to UTC time, not local time, and the examples that I have found all set the clock to local time. Setting to UTC is important because it automatically adjusts for daylight savings time. It’s also easier to program the code for use anywhere in the world (share it with others) when it is based on UTC time.

So because I had such a hard time, I modified the example that is found here to set the clock to UTC, and figured out how I needed to modify it here. All you need to do is paste this into the Arduino programmer, modify the variable for the UTC offset to fit your timezone, and upload it. (I’m in UTC – 5, so mine is set to float UTCOffset = -5.0; It is set as a float for those locations that may be offset by an amount that is not a whole hour (for example, Nepal is UTC +5.75). If you’re powering the RTC from the pins, you’ll have to uncomment those and modify them to fit your configuration.

// Date and time functions using a DS1307 RTC connected via I2C and Wire lib

#include <Wire.h>
#include "RTClib.h"


float UTCOffset = -5.0;    // Your timezone relative to UTC

void setup () {
    // Uncomment the following lines to use pins 4 & 5 as power and ground for the RTC
    // pinMode(4, OUTPUT);
    // digitalWrite(4, HIGH);  // HIGH for power
    // pinMode(5, OUTPUT);
    // digitalWrite(5, LOW);   // LOW for ground
    RTC.adjust(DateTime(__DATE__, __TIME__));  // sets the clock to the time when this sketch is compiled
    DateTime now =;
    DateTime UTCTime(now.unixtime() - 3600 * UTCOffset);   // Adjust the time from local to UTC

void loop () {
    DateTime now =;
    Serial.print(now.year(), DEC);
    Serial.print(now.month(), DEC);
    Serial.print(, DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(now.minute(), DEC);
    Serial.print(now.second(), DEC);
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print(future.month(), DEC);
    Serial.print(, DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(future.minute(), DEC);
    Serial.print(future.second(), DEC);

Learning Programming with the Arduino Microcontroller

A few weeks ago, I got my hands on an Arduino starter kit. The Arduino is a microcontroller that is capable of doing a lot of really cool things. The starter kit included the Arduino board, a collection of electronic parts (LEDs, a breadboard, wiring, resistors, potentiometers, an LCD screen, and some other things), and a book to start learning the programming. The Arduino is programmed using a modified version of C++, so learning to program it means that your programming skills can be easily transfered elsewhere.

Learning to program the Arduino is not hard, and it’s a lot of fun. The first thing you’ll learn is how to make the LED on the board blink. It’s very simple, but seeing it do what you tell it to do is exciting.

I’ve gone about half way through the book, putting together example projects. Once I got half way through, I started having my own ideas that I wanted to try. The projects I’ve done include: A “Spaceship interface”, “Love-o-meter”, Color mixing lamp, Mood Cue, Light Theremin, and a Crystal Ball. The Spaceship interface is the first project, to give you the basics of hooking up buttons, LEDs, resistors, and working with inputs & outputs in the code. It’s very simple, just a couple lights that change when you push the button. When you’re done, it looks like something you’d see in an old sci-fi movie.

The Love-o-meter is simply a temperature sensor connected to some lights. The warmer it gets, the more lights turn on.

The color mixing lamp is really cool. It’s an LED with red, green, and blue elements in it. You can make any color you want by mixing the light from the elements.

The mood cue uses a stepper motor to point an indicator. The purpose is to learn the use of the stepper motor.

The light theremin is interesting. It uses a light sensor, and outputs a varied pitch tone based on the amount of light it sees.

I modified the code for the Crystal Ball. It’s supposed to be like a “magic 8 ball”. You program it with 8 possible answers and have a switch that’s activated by turning the board over. I never got the switch to attach to the breadboard because the pins are too short, so I just wired in a pushbutton switch instead. Instead of 8 random answers, I put in 8 random trivia facts. It was a fun project to learn how to get an LCD screen working.

Beyond that, I’ve been working on a few other projects that came to mind. One of them is a timer to control two lamps in my living room. Right now those lamps are on timers and come on in the evening, and turn off around 10:30. However, I have to adjust the timers every few weeks to follow the changing sunset time. My new timer will have a clock built in, and be able to calculate when sunset is, so I won’t have to adjust for it any more.

While contemplating that project, I found this. It’s a goofy little project, but it does almost exactly what I want my timer to do. The only difference is that I will drive a relay instead of an LED.

I emailed the guy who made that and asked if he could point me in the right direction for tracking sunrise/sunset times, since that is still a bit beyond my current abilities. He gladly shared his code with me, and has been very helpful in getting it modified to suit my needs. He also pointed me to the Arduino forums, where there is a wealth of knowledge to help figure this interesting little board out.

The other project I’m working on is a simple one to understand and build. I bought an old stoplight at a surplus store, and am fixing it up for my rec room. It will be driving by relays that are controlled by an Arduino when I’m done with it. The programming is super simple, not much more complicated than the “blink” program that is the first thing you learn with the Arduino, it will just have three lights instead of one, and the “blinks” will be very slow, and never on at the same time. I may get fancy and figure out how to connect a motion sensor to it so it only runs while we are in the room (no point in powering lights when there’s no on there to see them).

I have been having a great time, and look forward to a lot of fun projects in the future. Not only that, but I’m getting things figured out now, so when my kids get a little older, I can help them learn to program and make neat little projects too!

The Parable of the Pharisee and the Tax Collector

This post is a bit long. If you wish to skip the story behind the question that instigated this post, feel free to move down to the tweet that is embedded below and begin there.

Last night I went to be in the live audiance of The Late Debate, a local political radio talk show. I walked in a few minutes after the show started, and they were discussing gay “marriage”, which is a hot-button issue right now in Minnesota. (Last November, a ballot initiative to amend the state constitution to forever define marriage as between one man and one woman was defeated, and the Democrats took control of both houses of the legislature – already controlling the Governorship, and it’s presumed that they will pass a bill to redefine marriage to include same-sex couples).

As I walked in, their liberal guest, known to the Minnesota politcal world as “Two-Put Tommy” (Google it, I’d rather not reward him with a link), was in the middle of a screed against Christians, the primary opponents to the bill. He was chastizing Christians for cherry-picking the Biblical commands that they wish to “enforce” on everyone. His opinion seemed to be that homosexuality was only really discussed in the Old Testament, and the Old Testament (if I understand his thinking correctly) should have been made null and void by the New, which he asserts doesn’t address homosexuality.

When I got home, I posted a series of tweets addressing my frustration over such argumentation, which certainly isn’t unique to Tommy. It’s actually pretty much standard fare for non-Christians (or nominal Christians) who take issue with the moral views of Christians. There is nothing that frustrates me more about non-Christians than when they make Biblical arguments with Christians. It’s is extremely rare that they’ve ever actually read the Bible, and if they have they don’t make any effort to understand it in any meaningful way. Ask them what kind of Systematic Theology they subscribe to, or the Hermeneutical method they use to understand scripture and you’re likely to get a blank stare as an answer. Clearly they use the hostile Liberal media Hermeneutic of “it means what I think it means,” and their approach to Systematic Theology is similar.

Specifically what I proceeded to address in my Twitter posts was that there are actually three different forms of Law in the Bible: Civil, Ceremonial, and Moral. The Civil Law was their governmental law. It applied to that people at that time, in that place. It does not apply to anyone today, anywhere in the world, not even modern Israel.

The Ceremonial Law was their religious law. It involved things like animal sacrifice, dietary restrictions, and circumcision, among other things. That is what defined Judaism then, and still defines Judaism today. This is the Law that “went away” under the New Testament (it was always intended as a means of showing that we can’t acquire salvation on our own, we’re dependent upon the grace of God – Galatians 3:23-24).

The Moral Law is what Christians refer to in public discourse. The Moral Law applies to all people, at all times, and in all places. The foundation for the Moral Law is the Ten Commandments, though even they are divided in their application. The first tablet (commandments 1-5) reflect the nature of how man is to relate to God. If we’re going to talk about “separation of church and state”, these are the prerogative of the church. The second tablet (commandments 6-10) reflect the nature of how man is to relate to other men (I’m using “man” and “men” generically, of course, women are included). These commandments are: 6) Do not murder; 7) do not commit adultery; 8) do not steal; 9) do not lie; and 10) do not covet (often addressed in civil law under various conspiracy laws).

There is a lot more to be said on this, but my point is to set the stage to answer a question that was asked of me in response to my series of tweets. Jack Tomczak, one of the hosts of “The Late Debate”, and I have been following each other on Twitter for some time, and have conversed on many issues via Twitter. He takes issue with my understanding of morality and moral law (religiously he is a cultural Catholic, and politically he has strong Libertarian sympathies – we’re similar politically, but differ over issues like marriage). Jack subscribes to the main-stream Libertarian view on marriage that marriage is a religious rite and institution, and it would be better for the state to cease involvement in marriage altogether- stop issuing marriage licences and stop offering special benefits to married people such as tax credits. Because he sees it as a religious affair, he sees all arguments for the preservation of traditional marriage, and state recognition thereof as ultimately being religious in nature.

My view is that religion and morality have a lot of overlap, but morality is not necessarily religious in nature. Religious values are a subset of morality. Everything religious should be moral, but not everything dealing with morality is necessarily religious.

Because Jack doesn’t see homosexuality as immoral, and I do; coupled with his view of morality and religion being indistinguishable from each other, he asked the following question:

I think Jack meant Luke 18:9-14, which says, in the English Standard Version:

He also told this parable to some who trusted in themselves that they were righteous, and treated others with contempt: “Two men went up into the temple to pray, one a Pharisee and the other a tax collector. The Pharisee, standing by himself, prayed thus: ‘God, I thank you that I am not like other men, extortioners, unjust, adulterers, or even like this tax collector. I fast twice a week; I give tithes of all that I get.’ But the tax collector, standing far off, would not even lift up his eyes to heaven, but beat his breast, saying, ‘God, be merciful to me, a sinner!’ I tell you, this man went down to his house justified, rather than the other. For everyone who exalts himself will be humbled, but the one who humbles himself will be exalted.”

I can only presume that Jack is asking if I’m being a bit self-righteous in my views on homosexuality. I understand that thinking, but let me address it why that is not the case.

First of all, I’d like to point out that this is a parable. A lot of people have opinions on what parables are supposed to mean, but let me quote Jesus himself rather than giving my opinion. In Matthew 13, Jesus’ disciples ask him why he speaks in parables:

Then the disciples came and said to him, “Why do you speak to them in parables?” And he answered them, “To you it has been given to know the secrets of the kingdom of heaven, but to them it has not been given. For to the one who has, more will be given, and he will have an abundance, but from the one who has not, even what he has will be taken away. This is why I speak to them in parables, because seeing they do not see, and hearing they do not hear, nor do they understand. Indeed, in their case the prophecy of Isaiah is fulfilled that says:

   “You will indeed hear but never understand,
     and you will indeed see but never perceive.”
   For this people’s heart has grown dull,
     and with their ears they can barely hear,
     and their eyes they have closed,
   lest they should see with their eyes
     and hear with their ears
   and understand with their heart
     and hturn, and I would heal them.’

But blessed are your eyes, for they see, and your ears, for they hear. For truly, I say to you, many prophets and righteous people longed to see what you see, and did not see it, and to hear what you hear, and did not hear it.

In other words, it was meant to be confusing. Also, those who do understand it do so not of themselves, but because God himself has gracefully given them understanding. I have no grounds to boast to Jack that I understand this parable while it seems that he does not.

The parable of the Pharisee and the Tax Collector is one that goes straight to the heart of the Gospel. The Pharisee represented a religious system that says “do x and you’ll be saved.” That runs antithetical to the Gospel, which says that you can’t do anything to be saved, your salvation is a gracious and unmerited gift from God.

I understand my own sin. Like every other Bible-believing Christian, I hate the sin that is in myself more than anything else in the world. I hate the sin in myself more than the sins of other people. I understand that because of my own sin, I am not righteous, and I deserve the judgment of God.

The people in my discussion with Jack, those who are irreligious, homosexual, and wish to marry, are not represented at all in this parable. The Pharisee is the religious institutional leadership who arrogantly believe that their position within the religious system makes them better than everyone else, and worthy of Heaven. The tax collector is the repentent sinner who knows that he’s got an appointment in God’s courtroom, where he’ll be found guilty and punished. He calls out to the Judge for mercy, which is what the Judge is looking for. The irreligious person isn’t in the parable at all. He just doesn’t care. He lives his life as he sees fit and doesn’t consider the consequences. He’s not up at the Temple praying as these two are, he’s down in his house fornicating with his neighbor’s daughter.

I’m the tax collector in that parable. Not only am I grateful for the unmerited salvation that I have been given through Jesus Christ, I want others to come to the same knowledge of salvation as well.

And Jack, I’d love to explain the Gospel in full to you sometime. Perhaps next time I am able to join the Late Debate crowd on a Friday evening, we can discuss it in more depth.

My Twitter Philosophy

I’ve been on twitter for a while, two years as a regular user, almost six since I first created my account.

I think I tend to be a typical user as far as who I follow and what I tweet. Some are very topical, they may be tech celebs, so they only tweet tech-related stuff, just as an example.

I have two main subjects I tweet on: faith and politics. When it comes to politics, I have found no better way to keep up with state and local stuff than twitter. I just don’t have the time with three kids to follow the blogs or local media to keep up. Outside of faith and politics, I’m not afraid to tweet on whatever subject is on my mind, but other topics are less commonly found in my stream.

As for who I follow, as with most people, I follow those whom I find interesting. I also do follow-backs, but not automatically. Twitter can be a cesspool of attention-seeking glory-hounds and wanna-be self-made millionaires that will follow people by the thousands just to get follow-backs. That defeats the purpose of twitter as I see it; a community of people who have similar interests. Thus, if you follow me, and show me that you actually read my tweets (like a simple reply that is relevant to what I’ve tweeted), I’ll most likely follow you back.

However, my feed sometimes gets a little out of control, and it gets hard for me to keep up, so I sometimes feel the need to trim the list of people I follow. Usually first on the list is those who I don’t know that don’t follow me back. It’s usually an indication that someone met the criteria I illustrated above to get a follow-back, and then unfollowed me.