Search Results: "apollock"

14 December 2008

Andrew Pollock: [tech] Asterisk call notification

My home Asterisk configuration has been pretty static for a while. It works well, and so I haven't had a need to mess around with it. There's a couple of outstanding features I've wanted to implement for a while though, and I've now got one of them out of the way. All calls that come in from the local PSTN line, the Vonage ATA, and the SIP connection to Engin, hit a menu, where the caller selects whether they want to speak to Sarah or myself. The sole purpose of this is to determine what to do with the call if no one answers (which voicemail box or cell phone to send the call to). A convenient side-effect of this is that it defeats most telemarketers. Ages ago, I set up caller ID announcement to my MythTV setup, so if we happened to be watching TV or a recording when a call came in, it briefly popped up on the TV. Fortunately, we're not huge square-eyes, and spend more time goofing off on our laptops, so I wanted a way to display notifications on our laptops when calls came in as well. I had this crazy design in my head of having a server process on my Asterisk box, and then clients on our laptops could connect to it, and be informed of new calls. Before I went on a coding frenzy, and did something with the Observer pattern and more socket programming than I really wanted to, I thought I'd check if this was solved problem. Turns out, it kind of is. I found the Notify application for Asterisk (which I've made a package for Debian Etch), which blats a UDP message to particular host as part of a dialplan. It's more intended to go in person-specific extensions, but as the majority of calls go into the main menu and never come out before hitting a person-specific extension, and I still wanted to know about them for my own perverse pleasure, I added multiple calls to the Notify application in the main menu dialplan. The site for the application also mentioned some third-party clients for Linux and MacOS, but I've been looking for an excuse to try and write something that used Growl, so I wrote my own Python application, initially on Linux, and then I essentially swapped out the pynotify code for the equivalent Growl code, and it worked just as well on Sarah's Mac. So it's not quite the solution that I had in mind, because it doesn't really scale, but for our two-user home setup, it's adequate. I might still try and write some middleware between a client for this application and an infinite number of observers, but there's no urgency. The dialplan for our main menu now looks something like this:
exten => s,1,Background(for)
exten => s,n,AGI(mythtv-cid.agi)
exten => s,n,Notify($ CALLERID(num) $ CALLERID(name) $ EXTEN /icarus)
exten => s,n,Notify($ CALLERID(num) $ CALLERID(name) $ EXTEN /iapyx)
exten => s,n,Set(TIMEOUT(digit)=5)      ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10)  ; Set Response Timeout to 10 seconds
exten => s,n,Background(names/sarah)
exten => s,n,Background(press-1)
exten => s,n,Background(for)
exten => s,n,Background(names/andrew)
exten => s,n,Background(press-2)
exten => s,n,WaitExten
A call comes in, hits the menu, and the caller ID info is displayed on MythTV (if something's being watched) and our two laptops (if they're awake). Unfortunately my Git-fu is atrocious, so I can't figure out how to link to a web-browseable repository that contains the source for my client, but if I figure that out, I'll update this with a link later. Update I managed to summon enough Git-fu to put the repository online. It's available at http://git.andrew.net.au/?p=asterisk-notify-client.git;a=summary Now I just have to use it properly.

11 December 2008

Andrew Pollock: [tech] My SSH Tip Of The Day

There seems to be a bit of a meme here... I have a set of computers that I frequently reinstall for testing purposes. The "zomg! The host key has changed!" gets very tiresome very quickly.
Host reinstallalot
        UserKnownHostsFile /dev/null
        StrictHostKeyChecking no

8 December 2008

Andrew Pollock: [tech] RHEL doesn't have sysfsutils?

I'm reading the Red Hat I/O Performance Tuning Guide, because hey, it's all Linux, and I might just learn something. So far, I've learned that RHEL doesn't have sysfsutils. How very weird.
Unlike the /proc/sys/ file system, the /sys/ file system does not have a utility similar to sysctl that can make such changes persistent thoughout (sic) system reboots.
and
However, as mentioned in Section 4, Selecting a Scheduler , any tuning made though echo commands to the /sys/ file system is not persistent throughout system reboots. As such, to make any scheduler selection/request queue settings persistent throughout system reboots, use /etc/rc.d/rc.local.
Of course, for all I know, this information may be out of date with respect to the current release, but Debian's had sysfsutils since November 2003.

7 December 2008

Andrew Pollock: [life] Happy shareholder/customer of Netflix

Netflix really is a great service. (That is why I bought some shares in them after all) I like their core product offering, and I like that they're fairly switched on technically with their website. Now I also like their phone support. We were supposed to receive Clerks: Tenth Anniversary Edition, but we received the bonus disk instead (I'm not even sure how you can do that, it doesn't appear to come up when you search for "Clerks"). I reported it as mislabeled, via the website, but this wasn't really accurate: the sleeve said it was the bonus disk. We'd just been shipped the wrong disk. I wasn't sure whether the mistake was that we'd received the wrong disk, or that it was misrepresented in the DVD list on the website. I discovered that our $13.99 a month seems to entitle us to 24-hour telephone support (can you believe that?), so I called them up, bashed in our customer identification number, and in under a minute at 11:48pm on a Saturday night, was connected to an all-American sounding "Jill", who very quickly identified that we had indeed been shipped the wrong DVD, and so organised for the right one to be shipped out. The entire experience was delightful. Yay for Netflix having competent phone support.

5 December 2008

Andrew Pollock: [life] Whoa

It wasn't me.

28 November 2008

Andrew Pollock: [tech] Wising up about SMART

I've always installed the smartmontools package on my servers because I figured it'd maybe give me some early warning about an impending disk failure. Getting proper SMART access was one of the motivating factors in moving my home-brew SAN from IDE-to-USB disks to native SATA. Since then, I've had two drives fail on me. One of the original four that I bought, and the replacement one that Seagate shipped to me. (Incidentally, I love how your only recourse to a replacement drive failing with Seagate is they'll ship you another (reconditioned) replacement drive. I can see the shipping expenses racking up very quickly). I decided to do the expedited return when the second drive failed, just because it meant I didn't have to be without a disk in my RAID-10 for a week while I waited for them to receive my drive and turn around and ship me a replacement drive, and it also meant I didn't have to mess around with packaging it myself. (Incidentally, I wonder what happens in Seagate's reconditioning process? Will someone else get my failed drive (i.e. the same serial number) after they replace the platters or whatever it was that failed? Would it be interesting to set up a website where people could register the serial numbers of drives they returned to Seagate, and how they died, and at how many power-on hours? How many times does a drive get "reborn"?) Whilst I was waiting for the replacement drive to arrive, I messed around with the failed one (I removed it from the RAID array), fiddling with the SMART self-tests that smartctl can initiate for you. The faulty drive failed the long self-test at the same LBA every time I ran it. It was around this time that I realised that the default configuration that comes with the Debian smartmontools package isn't all that useful with SATA disks. It ships with
DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner
which, as it turns out, doesn't detect SATA drives properly. I got
Nov 24 22:00:13 minotaur smartd[2990]: Device /dev/sda: ATA disk detected behind SAT layer 
Nov 24 22:00:13 minotaur smartd[2990]:   Try adding '-d sat' to the device line in the smartd.conf file. 
Nov 24 22:00:13 minotaur smartd[2990]:   For example: '/dev/sda -a -d sat' 
logged. It seems to me that if the software can detect this situation, it should be able to just try the "-d sat" behaviour automatically. So it seems that this whole time, I haven't been getting any SMART monitoring of my SATA drives. hddtemp has been happily logging the temperatures for me though. So I took the advice in the comments of /etc/smartd.conf and removed the DEVICESCAN entry in favour of explicitly naming the disks I wanted to monitor. I also discovered that I can have smartd kick off scheduled short and long self-tests on whatever schedule floats my boat. So now I've got something like this:
/dev/sda -d sat \
         -M exec /usr/share/smartmontools/smartd-runner \
         -s (L/../.././01 S/../.././(00 12))
This runs a long self-test at 1am every day, and a short one at midnight and midday. Hopefully this will help predict the next drive a bit earlier. I'm now debating whether to set up an active Nagios monitor for SMART, or to see if I can write a passive one that runs as part of the smartd-runner infrastructure that the smartmontools package provides (and is pretty neat). I guess it's already setup to email me, so it doesn't really matter whether it's Nagios emailing me, or smartd itself.

27 November 2008

Andrew Pollock: [life] Sprained ankle, part 2

My ankle still isn't quite right since I sprained it back at the end of August. It still looks more swollen compared to my other foot, gets stiff when elevated, and my foot doesn't have the same range of movement as my left one. I trundled off to a podiatrist yesterday, and he had a poke around, and then looked at it under a fluoroscope while he torqued my ankle. Based on that, it looks like I have a anterior talofibular ligament instability. When he torqued my ankle in one direction, there was a 1.5cm gap between the bones of my foot where there should have been about a 0.5cm gap. This ligament's position certainly corresponds with where there's still some swelling, so it makes sense. I've got some (utterly boring) exercises to do, and I have to go back and see him again in 5 weeks. He said surgery may be necessary to fix it, as left uncorrected, I could have a bad time with arthritis in my 50's, and there'd be not a lot that could be done about it at that stage. So we went out and bought a balance board last night, and I'll be spending the small amount of time I watch TV standing on one leg.

22 November 2008

Andrew Pollock: [life/americania] Expedia class action

Looks like I might be in my very first class action. Excitement, he wrote.

17 November 2008

Andrew Pollock: [opinion] Watch this space

Those infamous Somali pirates have hijacked an oil supertanker A Saudi oil supertanker at that. Carrying $100 million worth of oil, which I believe was headed for the US. They've also got the Ukrainian ship full of tanks and what-not, which apparently pissed off the Russians. I predict that real soon there's going to be serious action in that part of the world...

9 November 2008

Andrew Pollock: [tech] Keeping hard drives cool

I've had this crazy ATA over Ethernet SAN for my MythTV setup for as long as I've been running MythTV. I'm using minotaur, an old Pentium III 1RU VA Linux server as the "head". Originally, I had 4 IDE hard drives, attached to minotaur via IDE-USB adapters. This worked perfectly fine, but I missed the ability to query SMART information, and do other low-level drive tweaking with hddparm So a while ago, NewEgg had a sale on 750Gb SATA drives, and I bought a 4 port eSATA card, and took the plunge with SATA. That all went fine. The entire time, I've had the 4 hard drives themselves just sitting on top of minotaur, on cork trivets. The whole arrangement is in the bottom of our linen closet, as this is where the patch panel for the apartment is. I've graphed the temperature of linen closet for some time now, but the benefit of having hard drives connected via SATA was that I could easily graph the temperature of them as well, which I started doing recently. The catalyst for wanting to do this was that I had a drive fail, and I was concerned that they were getting too hot, just sitting in the closet with no airflow. Matt Bottrell's recent reminder of Google's research into hard drive failures also helped bring this concern to forefront. Seagate's product documentation for the Barracuda 7200.10 claims that ambient operating temperature must be between 0 C and 60 C. I'm assuming that's the environment the hard drive is in, and not the temperature of the drive itself as reported by something like hddtemp. The closet is typically in the high 30's. If you believe what SMART reports, it seems to imply that anything over 45 C is a Bad Thingtm. So after I had a drive fail, I figured I should probably try to do something about the temperature situation, and started looking around for an external enclosure. I'd previously had problems with the IEC-to-Molex power supplies I was using to power the disks, and think that they'd been the cause of some failures of my IDE disks, so was quite eager to stop using them as well, which was something else an external enclosure would give me. I had trouble finding an enclosure that presented 4 separate eSATA ports, and I was talking to Marc about SATA port multipliers, when he mentioned he had a brand-new unused full-height SCSI enclosure, for four disks, which was surplus to his requirements. Since all I really needed was external power and cooling, I thought I could cannibalise this to my needs. Sure enough, I could just remove the SCSI cables and their Centronics connectors, and feed the eSATA cables out the gap they left, and use the molex-SATA power splitters I already had. Because the enclosure was intended for full-height 3.5" hard drives, there was plenty of air space between each disk. The enclosure included two fans. The results? Well the graph speaks for itself:

Graph of hard drive temperatures (I'm not entirely sure why minotaur's internal disk occasionally reports a very low temperature) The added bonus is I've cleaned up the rats nest of cables in the linen closet. So thanks very much, Marc!

4 November 2008

Andrew Pollock: [life/americania] On being a fly on the wall for the 2008 Presidential Election...

(or Taxation without Representation) Wow, it's finally over, and best and right man won. I'm very excited and happy with the result. It has been very interesting being able to observe the entire process from start to finish. All the primaries and caucuses, the protracted battle between Clinton and Obama in the Democratic primaries, the record breaking money Obama raised, the campaigning, the misinformation. It'll be very interesting to see what the next four years brings. It's an exciting time to be living in America. California is an interesting state. It has "ballot initiatives". Its constitution can (and has been) amended by essentially referendums whenever there's some other excuse for a vote. Anyone can propose a ballot initiative with sufficient backing by petition. Wikipedia has a good writeup of all of California's propositions. Probably the most controversial one this time around is Proposition 8, which seeks to essentially reverse the same-sex marriage right that the Californian Superior Court ruled on earlier this year. This concept of ballot initiatives seems to trickle all the way down to the city level, where they're called Measures. San Francisco has some ridiculous number of them this time around. They use letters, and I think they go all the way to V. There's one to rename a sewage treatment plant after George W Bush, there's one to decriminalise prostitution. A co-worker who lives in San Francisco brought the official voter guide book to work with her today. It's about the size of a phone book and about 1.5 centimetres thick. I don't see how it's possible to make an informed decision on everything you're expected to vote on, when there's that much reading. The observation I've made is that Americans seem to have an inherent distrust of their governments, so that's why so many bits of it are directly elected by the people. Judges are voted for, county sheriffs are voted for. You vote for your school board. It seems like very few positions of any power are appointed by someone. Coming from Australia, where it's really the opposite, I'm not sure what I think is better. I think I like the simplicity of the Australian system. You vote for someone, and you essentially delegate power to and place trust in them.

2 November 2008

Andrew Pollock: [tech] Graphing hard drive temperatures with Cacti

These add-on scripts make it very easy, and need their Googlejuice boosted, so people don't find the stuff on the forums first.

15 October 2008

Andrew Pollock: [life] Recount

For part of the 32 hours I spent inside a plane crossing the Atlantic, I watched Recount. I wanted Sarah to see it as well, so we got it with NetFlix and watched it tonight. I have no idea how factually accurate the movie is, but I'll assume all of the bits that were on the public record were vaguely correct. I'll assume the chad factor with the ballots was correct. The movie portrayed the US electoral system as a complete and utter shambles. The thing I found most striking was that the recounts keep having deadlines that weren't met, and the whole recount got discarded as a result. The process seemed incredibly flawed. It got me wondering how the Australian vote counting goes, given it's completely manual. I might have to volunteer as a scrutineer when we wind up back in Canberra. I highly recommend watching this movie if you can get your hands on it.

Andrew Pollock: [life] What are the odds?

I got a voicemail message at home from UPS for a Christopher Pollock. I've previously received some mail for him as well, so I went searching, and it turns out that he lives elsewhere in my apartment complex. Not long after we moved to the US, we were picking up a pizza from Pizza Hut, and someone else was also picking up a pizza for "Pollock". It seems my last name is more common than I thought.

7 October 2008

Andrew Pollock: [debian] manpages.debian.net

Neil:
$ host -t txt manpages.debian.net
manpages.debian.net descriptive text "Javier Pen~a <jfs@debian.org>"
manpages.debian.net descriptive text "PGP D6 91 BB 89 88 7A F7  A0 BA E4 27 FD 7A 6A FE DA"
manpages.debian.net descriptive text "PGP 86AA DB04 D2F5 CC55  3A4D 940F B1A9 DD82 DC81 4B09"

28 September 2008

Andrew Pollock: [debian] No Debian miniconf at linux.conf.au 2009?

I'm wading through my email and saw a recent announcement about the miniconfs that have been accepted for linux.conf.au 2009, and Debian was conspicuous in its absence. That's a bit of a shame.

11 September 2008

Andrew Pollock: [life] Woot! Vacation!

We're heading off on a vacation, the first real "put our feet up" kind of vacation since our belated honeymoon a couple of years ago. Our ultimate destination is the Seychelles, a tiny set of islands off the east coast of Africa, near Madagascar. Sarah's aunty and uncle live here. Her uncle's the deputy commissioner for the United Nations Indian Ocean Tuna Commission. Getting there is pretty heinous. We're flying to Houston, then to Dubai, then to the Seychelles. Originally we were leaving tomorrow, but Sarah noticed that we only had an hour to transfer in Houston, and when she checked with the airline, they agreed (despite them booking the entire trip in the first place). So now we've changed to a flight today, with a night in a hotel in Dubai. Emirates only fly to the Seychelles a couple of times a week, so we really don't want to miss the Dubai-Seychelles leg. The flight from Houston to Dubai is 15 hours. That's worse than San Francisco to Sydney. Not looking forward to sitting on a plane for that long. Flying on September 11 is an interesting experience so far. It seems that the airlines are "randomly selecting" all passengers who aren't US citizens for secondary inspections at the security checkpoints. I was vaguely aware, but had largely forgotten, that if they print SSSS in the bottom corner of your bording pass, then you've been randomly selected. The TSA guy was very apologetic, as he proceeded to completely dismantle our carry-on luggage. The other fun aspect is that hurricane Ike is busy making its way towards Houston. It's not supposed to make landfall until Saturday, but since they've already evacuated some cities south of Houston, I'm really hoping it doesn't bugger up our flights. We're in the Seychelles for 10 days, and then we're going to spend 3 days in Dubai on the way back. It'll be during Ramadan, which is apparently an unpopular time for Westerners, so all of the hotels are nice and cheap. It looks like it's going to be pretty hot as well.

5 September 2008

Andrew Pollock: [tech/security] Sudden fit of coding

I saw that the inimitable Steve Kemp has cranked out an RBL for hosts that do brute force SSH attacks within seconds of thinking about doing it. As I have a passing interest in such things, and discovered that his sample submission client is really more geared towards people using iptables with the LOG target (and I use the ULOG target), I cranked out this moderately flexible Python client for logs written by ulogd this evening. If you use Netfilter rules like mine, you can use my script after /var/log/ulog/syslogemu.log gets rotated with:
$ ./report_iptables_ulog.py --log /var/log/ulog/syslogemu.log.1 --prefix SSH_brute_force

4 September 2008

Andrew Pollock: [life] One year later

It's hard to believe, but it's a year ago today since the worst day of my life. In so many ways, it feels like so much longer, yet the memories still haunt me.

31 August 2008

Andrew Pollock: [life] Sprained ankle

I was playing racquet ball with Kendall yesterday, and I was running backwards, towards the front wall to try and get behind the ball, and my right ankle rolled underneath me as I was putting my right foot down. There was a really nasty internal crunching sound, and it hurt like hell, so I thought that maybe I'd broken it. I was able to walk home from the Club, so I figured it wasn't broken, but the swelling was pretty bad. Several hours later at Urgent Care, they confirmed with an x-ray that it wasn't broken, so it's now strapped up and in an ankle brace. I have to keep off it for 10 days. I seem to have pretty bad ankles in terms of rolling. I quite often stop myself from stepping down on my foot when the ankle's rolled inwards slightly. Back in May I rolled my left ankle a bit, just crossing the street, and it's still sore.

Next.

Previous.