The chocolate ration is being increased to 25 grammes per week.

Category Archives: software

Uber may be the best taxi replacement, but…

They have absolutely no clue about customer service or how to take payments for their service.

I decided to use them to get to and from the airport for a recent vacation. I got an estimate of what it would cost ($100), and got a virtual credit card from Citi for the rides and signed up on the website.

The rides were a convenient and quick way to get to and from the airport, but I didn’t predict the cost well. The ride home went put me over the $100 limit I had set on the virtual CC. They emailed me to fix this, so I immediately went to the website (following the link in their own email).

I couldn’t add a new CC on their website. I kept getting a generic “an error has occurred.”  I contacted support, and after exchanging email with four different people that didn’t read my original email or the previous emails their own support people sent me, I finally got someone that admitted the problem was their end and they were “looking into it.”

I waited 3 days and tried again. Emailed them. Got a response from someone that started the process all over again, ignoring all the history in the support ticket, with them telling me I must have used a prepaid card, or something, and to.. blah blah blah.

So, today, I had the idea, I’ll add a new payment method via the app. I did that. There appears to be no way to pay my outstanding balance via the app, so I went to their website, where it still tells me I have an outstanding balance, but the new payment methods are nowhere to be seen. So, I can’t pay the balance and I can’t use the service because I have an outstanding balance.

So, I added another CC in the app, to see if it was a one-time glitch. Nope, same deal.

Then, I get an alert from my CC company that two charges were just made on the two cards I added above, one charge for $0.88 and the other for $1.50. Note, this is not a temporary charge. I don’t get emails for those. This is an actual charge.

It is pretty incredible that a company with a $62.5B valuation (the value at their last funding), can’t even do something as simple as adding a credit card to my account!  And their customer support style (no continuity between emails to them) means you have to start from scratch with each person.

At this point, I don’t know if I’ll ever be able to use the service again.

CentOS 7 USB kickstart installation: HOWTO

I believe in repeatable processes, and keeping with that philosophy, I wanted to script the installation of CentOS 7 on a new server I was building.  I’ve used kickstart files booting over the network, but many hours invested in this and I couldn’t get my Gigabyte Z87X-UD5H to boot from my PXE server, which I had used successfully before.  So, the next best thing seemed to have the kickstart file on a USB drive, but the iterative nature of the task wasn’t well suited for this.  A friend reminded me that you can load the kickstart file via HTTP, so that seemed to be the best remaining option.

I found a post from the kickstart mailing list which described most of what I wanted to do.  However, many hours into the task it was clear there were serious typos and mistakes in the recipe.  In #3, the second directory to make is CentOS-7-KS-iso not CentOS-7-iso. In #4, there’s no reason to use compression in the local copy. And, in #8, the the dd if= argument has a typo (CSB instead of KS).

But the mother of all mistakes is in #7. Turns out the volume id of the installer must match the isolinux/isolinux.cfg file used to boot the installer. And since there were no instructions to change the latter file, this meant anyone using these instructions was destined to get this error when booting from the USB drive:

Warning: Could not boot
Warning: /dev/root does not exist

Googling for this error was not that helpful, since most of the replies had wrong or misleading information, some in places that are usually pretty reliable.  I don’t remember where I saw it, but I found a post that said the error was from mismatched volume identifiers. Yep, once I changed genisoimage to use the expected volume id, I was happily executing my kickstart file and installing CentOS 7.

I made a script to create the USB installer. I hope it helps someone else.

Plex just screwed over its entire Roku user base

Plex was a great piece of software. I’ve used it for years. I’ve ranted and raved about it to many people, both online and IRL. I run the client on a Roku 2 and 3, in two different rooms in my house. I run the Plex Media Server in a Docker container on CentOS 6.7. Until Friday night, August 28th, 2015, it worked like a charm.

Apps on the Roku automatically update. So, when I sat down with a hot plate of food Friday night, after a long hard day at work, I expected to turn on my TV and select something fun to watch on my Roku. When I selected the Plex app, however, I saw was a message asking me to go to a URL and type in a PIN.

Hold it right there. Friday night.  Hot food on the table. You want me to do what? Are you kidding me?  I’m already pissed off to start this process.

A new version of the Plex app had installed itself since the previous night when I used it. So, I grab my phone and typed in the URL.  Oh, it wants me to login.  Well, I probably have an account, but I never use it, because I never need to before. So I fumble around for a while and start the password reset procedure.  But, my food is getting cold, so 15 minutes in I bail and switch to the Amazon Instant Video app to watch something while I eat.

When I finish eating I’m just too pissed off to enjoy watching anything.  So, I recover the password on my long forgotten account and type in the PIN.  The Plex app wakes up and tells me No Supported Servers Found. OK, I know what the problem is, my Plex Media Server can’t broadcast to the local network.  So, I’ll just manually enter the server into the Plex Roku app. But there isn’t a way to do that.

A trip to the computer and to the Plex forums. Yeah, I’m not the only one on this Friday night that’s wasting time messing around with Plex instead of enjoying some videos. There are a lot of people really pissed off about bugs in the new app, ones that I can’t experience because I can’t even use the new app.

They key piece of information I glean from the forums, however, is there is a new Roku app called Plex Classic. Here’s the procedure:

  1. Go to this URL: https://owner.roku.com/add/plexclassic.
  2. On your Roku check for updates (or wait up to 24 hours).
  3. Setup all your Plex options again. For me, that was enter the server address manually.  And tweak a bunch of UI things, like turning off background music, etc.

All told, with 2 Roku devices, from start to finish, I spent about 1.5 hours.  On Friday night.  When I wanted to be relaxing.

Ironically, earlier this week, I saw a thread on reddit where a Plex user asked: is the Premium subscription worth it?  There were many replies and almost every single one said that it was worth it, for a variety of reasons.  Some for features.  Some to support development of an excellent product.  The lifetime subscription used to be $75.  It’s now $150.  I was seriously considering throwing down $150 for a lifetime subscription.  I won’t be doing that now.  All the good will they built up had me on the precipice of donating to them.  And look what they did.

Let’s recount the fuckups by the people that made the decisions at Plex:

  1. Requiring login in a product update (to a product I purchased, by the way).
  2. No manual server entry.
  3. Deploying on a Friday, which for many working people means they’ll first see it on a Friday night when they sit down to relax.
  4. Replacing a functional app with a completely new and untested one.  What plex.tv should have done is to make a new app and advertise that app in the old app.  That would have allowed people to update on their own schedule and to give feedback while not perturbing their current setup.

And, even if people only ever saw #1 above, I still consider that a screwing over.  It alone would force people to spend time doing something unnecessary when they likely didn’t want to do it.

UPDATE: a commenter suggest the free and open source emby.

New Mac Pro or Hackintosh? That is the question.

The new Mac Pro is really nice.  It’s also very expensive.  The base model is $3,000.  More expensive than previous generations of the Mac Pro, because it’s not equivalent to previous generations in expandability and if you require that expandability you will need to spend significantly more.  As a result, I’m leaning toward build a Hackintosh (running Mac OS X on non-Apple hardware).

First, my requirements:

  • SSD RAID 1 (mirroring) for the OS
  • RAID 5 for extra storage (music, photos, videos, backups, etc) using regular spinning disks — must hold at least 4 disks, more would be nice
  • Mac OS X 10.9

Aside from the new Mac Pro not meeting the first requirement, as it has a single SSD.  That means buying an external enclosure that supports RAID 5 (Mac OS X itself does not support software RAID 5, only 0, 1 and 10).  Because I don’t believe USB for this situation is sufficient, it has to be Thunderbolt, which the new Mac Pro has.  Here are the options (this is a good summary of all the hardware available):

The Promise is actually sold by Apple, but it’s a really crappy choice because 1) it has 4 slots and 2) the max size of the disks is 2TB.  The Drobo I’m not thrilled about because it comes with their own RAID and it’s basically a huge software layer between me and my disks.  For people that don’t want to do full-partition encryption and other stuff, it’s probably fine.  Also, I found a lot of people on Amazon complaining about Drobo’s support and quality.  That leaves the Areca.  Indeed, it looks like a very nice unit and it has excellent reviews and seems to offer very good performance.

That puts the price of the Mac Pro at $4,420 (without disks, tax, shipping, etc).  I want to point out, previous generations cost about the same and you did not have to spend more money to get expandability for 3.5″ disks.

Let’s look at the alternative, a Hackintosh.  There’s a fantastic community over at tonymacx86.com which has all the information you need to build a Hackintosh.  Here’s what I’ve come up with:

CPU: Intel Core i7-4770K Quad-Core Processor 3.5 GHZ 8 MB Cache
  ($337.98 @ Amazon) 
CPU Cooler: Noctua NH-U14S 55.0 CFM CPU Cooler  ($69.99 @ Amazon) 
Motherboard: Gigabyte GA-Z87X-UD5H Z87 LGA 1150 ATX Motherboard
  ($219.99 @ Amazon) 
Memory: 2x G.Skill Ripjaws X Series 16GB (2 x 8GB) DDR3-1866 Memory  ($139.50 @ Newegg) 
Storage: 2x Samsung 840 Pro Series 2.5" 128GB SATA 6Gbps SSD
 ($121.99 @ Amazon) 
Video Card: EVGA GeForce GTX760 2GB GDDR5 256bit Graphics Card
  ($249.99 @ Newegg) 
Case: Fractal Design Define R4 (Black Pearl) ATX Mid Tower Case  ($111.98 @ Newegg) 
Power Supply: Corsair 760 Watt ATX Modular Power Supply AX760
  ($159.99 @ Amazon) 
Other: HighPoint RocketRAID 2720SGL 8x PCI-E 2.0 x8 SAS/SATA RAID Card
Other: 2x HighPoint Internal Mini-SAS to 4SATA ($15.00)
Other: StarTech.com USB 3.0 Adapter
Other: HDE USB 2.0 Adapter
Total: $1,852

Some notes on the parts:

  • The HighPoint RocketRAID 2720SGL works fine with Mac OS X, but this hardware isn’t very good for SSDs.  The SSDs would go directly on the motherboard and run software RAID 1, which Mac OS X does fine.
  • The case supports 2 2.5″ disks and 8 3.5″ disks.  Plenty for my needs.
  • Xeon motherboards (socket 2011) aren’t as well supported, and sleep doesn’t work, which  is pretty important to me.

So, it comes down to a Mac Pro for $4,220 or a Hackintosh for $1,852?  Here are the pros for each:

Pros for Mac Pro:

  • Mac OS X compatibility
  • Xeon processor
  • Thunderbolt 2 for expansion (though I have no immediate need for it, other than the RAID)

Pros for Hackintosh:

  • Price
  • +18GB of RAM
  • 2x SSD RAID 1 for the OS boot drive

I’m pretty convinced the tonymacx86.com forums will help with any upgrades of Mac OS X.  When a new version of Mac OS X comes out, upgrade guides are published pretty quickly.  I would like ECC RAM, but this isn’t a deal killer, by any means.  Not having Thunderbolt isn’t, either.  For Xeon vs i7, it really comes down to Adobe Lightroom performance.  I think the extra 18GB of RAM will beat out the bigger cache on the Xeon.

So, it really comes down to the price, and are the pros for the Mac Pro really worth $2,568?  I really don’t think so.

I really like the new Mac Pro design, but I think Apple really made a huge mistake not insuring low-cost expansion units for regular, spinning disks.  All the previous Mac Pros had room for extra disks at the price of the base unit.  There is, essentially, a $1,500 tax to purchase the new Mac Pro.  That tax goes up to $2,500 if you need 6 disks instead of 4.

I curse the day I bought an Xbox 360 (not for the reasons you think, either)

It’s not because my son plays too much, or the content is too violent, or anything like that.  It’s that I have to deal with this incredibly frustrating system Microsoft has created.  The latest saga:

My son wanted to purchase some DLC (DownLoadable Content).  In this case it was an add-on for Assassin’s Creed III.  We have several profiles on our Xbox.  One for me, the credit card holding adult, and one for my son.  So, to purchase the DLC we used my profile.  During the purchase, my son was smart enough to verify that the purchase, once made, could be used by any profile on the Xbox.  He scrolled through the description and pointed it out to me.  It said it there in black and white.  I was satisfied, too.  So, we make the purchase as me, then he switched to his profile and started the game.  The purchased DLC was not there.  We fiddled with it for an hour.  My son was obsessed with it, and two hours after that I found he was still trying to get it to work.  So, I lost 1 hour and he lost 3 hours.  FUCK UP #1.

Today, I’m staring at this email from Microsoft where they confirmed the purchase of “400 Microsoft Points” (the currency with which you make purchases on an Xbox).  I’m thinking, “I really want a refund” so I go searching on xbox.com for some sort of link to call them.  I go to xbox.com and click on “Support.”  I finally find “Contact us” and click on that, and I see “Step 1: What type of issue are you having?”  I click on “Billing and memberships” and I don’t see a Step 2 or anything.  I fiddle for a while and then it dawns on me: I’ll bet their website is broken with Chrome.  So, I switch to IE and yeah, I see a Step 2.  FUCK UP #2.

I choose “Chat” for Step 2.  I wait a while and the chat starts.  I’ll spare you the details, but 20 minutes later I’m no closer to getting my refund than when I started.  FUCK UP #3.

The above is just one of many interactions I’ve had with my Xbox.  It’s not the worst nor is it the most time consuming.  It is merely the latest.

I will never buy another gaming console from Microsoft.  Ever.  I value my time and my serenity too much.

UPDATE 8/29/13: so, I sign into my xbox.com account today and I see I have a message.  I click on the letter icon and I see “You can read this message on your Xbox 360.” WTF? Really? Two words Microsoft: user experience. You are killing me.

The reason  I went to xbox.com was because of this: I received an email that I need to convert my current “Xbox Live Gold Family Pack” to something else.  You would think that once I sign into my account on xbox.com I could find a place to do that.  Well, after 10 minutes of clicking around in “My Account” I can’t find anything that references this issue.  Again, WTF Microsoft?!  I’ll just finish by asking this simple question: what would Apple do?  I’ll bet they’d fucking nail this.

Google doesn’t really care about the horrible bugs that cause you pain

In the earlier days of using Google wares, I feel they were responsive to feedback and would fix serious problems in their services or products.  These days, not so much.  Witness the Nexus 4.  Their flagship Android phone, the Nexus 4 should get the best Google has to offer.  So, why would they allow serious software defects to mar the experience of owning a Nexus 4?

Notifications over Wi-Fi don’t work when the phone goes to sleep!  This is a horrible, horrible bug.  It means you won’t get notified of emails or texts when your phone is sleeping.  Which is most of the time, as we all know.  This bug is been around since the N4 came out.  Still unresolved, though this issue is marked “Closed” and “Status: FutureRelease,” the latter of which presumably means it will be fixed in the future.

Bluetooth often stops working and requires the phone to be rebooted to fix it!  Bluetooth is an essential feature for many, and having to reboot your phone (which takes minutes!) is not a viable workaround.

Originally reported on 1/3/2013, these are just two of the bugs on the N4.  However, they are both serious enough to warrant an immediate Android update.  Android 4.2.2 was released since Google was made aware of these bugs, and they were not fixed in that release.  Android 4.3 was released yesterday, so we’ll see if Google has decided to fix these major defects, or not.

These are not the only serious defects that Google is ignoring.  Another example is my Chromebook: for nearly a month Google Docs didn’t work on the thing.  Then, one day, it magically started working again.  A Chromebook without Google Docs is pretty useless.  Can you imagine Microsoft breaking Office for a month?  Can you imagine the cries for the heads of Microsoft executives you’d hear on the internet?  I found other users in my same boat, but I saw little else.

These issues all illustrate my point that Google doesn’t  care about you or your user experience.  You are a product to Google, you are not the customer.  I don’t know who said this, but it bears repeating: if you aren’t paying for a service, then you are the product not the customer.

I’ll end with this: I have a Galaxy Nexus and I was waiting to upgrade to the next Nexus device.  At this point, I’m not sure I want to stay with the Nexus line.  There are many benefits, but the drawbacks are getting dramatically worse with each new Nexus device.

UPDATE 7/26/2013: It appears at least the Wi-Fi bug is not fixed in the newly released 4.3.

UPDATE 7/28/2013: I’ve noticed this on my phone: search sometimes doesn’t search.  I get the feeling Google just doesn’t do much testing.

UPDATE 8/9/2013: The Bluetooth bug is fixed in 4.3.

Windows 8: Worst Windows EVER

Here’s my Windows 8 story.  It’s a sad tale, because it shows how far Microsoft has fallen.

The preview versions of Windows 8 were unbelievable, in the sense that I never thought they’d actually release it “as is.”  I thought for sure they would back off on the tablet user interface (UI) for all types of hardware.  They didn’t.  Windows 8, whether you run it on a headless server, tablet or desktop computer, has the same UI.  Windows 8 was definitely designed with tablets in mind, however.  The proof of this is that I once got an error message and it said to “swipe” the dialog away, or some such.  I don’t remember the exact message, but I do remember very vividly yelling at Windows that my computer was not a tablet.

Since I help run a software company, I felt someone needed to use Windows 8 so we could find potential problems with our software and the new operating system.  No one seemed keen to try it so I volunteered.  So, I chose to upgrade my Windows 7 desktop, the machine I spend 8+ hours a day using.  When I’m at home I use Windows Remote Desktop to remote into my work machine.  I use this machine a lot.

Everyone has talked about the Start Menu disappearing.  The truth is, this was monumentally stupid of Microsoft to do this.  I knew about Classic Shell, but I resolved to try and use Windows 8 as intended, thinking it was merely a learning curve I had to get over.  The truth is, on a desktop computer with a mouse,  my sole experience with Windows 8, everything took longer than it did before.  Many, many clicks it takes to find stuff.  Even trying to organize the “tiles” on the Start screen (or whatever they call that) doesn’t work.  Why?  Because the position of tiles on that screen changes and you can’t memorize a position for a given tile.  Astoundingly stupid.

Microsoft decided to force everyone to use a tablet UI, even non-tablet users.  Perhaps they wanted a single code base.  I don’t know the reason.  But it was completely stupid to do this.  The new UI might be perfectly good on a tablet, but it sucks on a desktop computer or server.  After a few months, I relented and installed Classic Shell.  My life got a lot better after that, since I was actually able to get work done at the rate I expected.

By the way, there were news reports that Microsoft was going to restore the Start Menu in Windows 8.1.  It turns out they are false.  They aren’t restoring the Start Menu, they are adding a Start button that takes you to the Start screen (or whatever they call it).  That is not at all what users asked for, Microsoft.

The above is the main reason Windows 8 is horrible.  However, there are many other reasons.  In no particular order:

  • Because there is no notification area, it’s impossible to at-a-glance see if you have notifications.  Like, for example, Windows Updates needing to be installed.  How does Microsoft solve this?  By taking over the entire screen and making you decide “install” or “cancel.”  There are problems with this approach:
    • Once dismissed, it doesn’t come back for weeks, sometimes.  Out of sight, out of mind.
    • Finding the updates takes a lot of clicking.  Without Classic Shell it would be even more.  This makes it even more likely users will not install them.
  • Yesterday I had 23 Windows Updates waiting to be installed.  I started the install and it was finished very quickly.  I rebooted and I was back in business.  A few minutes after I started working I got the familiar take-over-the-screen-because-you-have-updates thing.  Wait, I just installed them!  OK, must be a new one just came out.  Windows Defender or something.  I go into Windows Update and find there are 20 updates sitting there.  OK, I install and reboot.   This time I check immediately to see if there are any updates.  17 remaining.   It took me 5 install/reboot cycles to install all the Windows Updates, for a total of more than 30 minutes while I couldn’t work.  THANK YOU, Microsoft.   Oh, don’t think this is a new Windows Update feature.  I updated a Windows Server 2008 machine with 20 updates and it happened in a single install/reboot cycle.
  • Occasionally, I’ll be furiously typing and my left hand will slip and I type some sequence involving the Windows key.  My desktop is replaced with a blue screen, but not the start screen.  I get these giant icons in the middle of it.  Every time it happens it takes me minutes to recover (i.e., to get back to my desktop) and each time my blood pressure is double what it was before.
  • I had to change the association of jpg and png files because clicking on them goes into a similar now-you-see-the-blue-screen hell I just described.
  • About once a month, I run into this bug: the Z order gets messed up and the “show the desktop” item gets pegged at the top of the Z order.  The Z order is the order in which items appear to Alt Tab.  Switching to a window puts it at the top of the Z order.  You can switch between the top two items in the Z order by alternately doing Alt Tab. Infrequently used windows filter toward the bottom of the Z order.  You might not have heard of this, but your brain uses it every time you use Windows.    This is the way Windows users have been doing things for decades.  Well, the bug in question causes Alt Tab to minimize all applications and show the desktop.  That’s right, you’re furiously working away and Alt Tab to get to that other window and BAM! you’re looking at your empty desktop.  The only fix I’ve found is to close all  windows and log out.
  • After upgrading my Windows 7 to Windows 8 I had the first BSOD that I can remember.  I uninstalled a bunch of software (including my anti-virus program) and it never happened again.

I know there are more annoyances, so I’ll probably come back to this post and update it when I remember new items.

All of this adds up to one thing: in the run up to releasing Windows 8, Microsoft didn’t give a shit about their users and foisted this new UI upon us for reasons that had nothing to do with our desires or productivity.

There are some things I like about Windows 8.  Alt Tab, when it works, shows you the window you would switch to if you were to let go of the keyboard chord.  Also, the Remote Desktop server in Windows 8 doesn’t have the bug that XP and 7 had that totally used to screw me over about once a month: for no apparent reason, RDP would go into “slow” mode, as if my internet connection (which is definitely fine) had slowed to a crawl.  The only known fix for this was to log out and log in again, then reconnect with the RDP client.  Because it was in a slow mode, this sometimes took a long time. I have not seen this bug since switching to Windows 8.

Couldn’t I just have this one bug fix and new feature added to Windows 7?  I’d be a huge Windows and Microsoft booster, if that had happened.  As it is, for my home system, I’m considering switching from Windows to Mac OS X next year.  I never thought I’d utter those words, but I really can’t see upgrading to Windows 8 or any successor.

I have finally switched away from Quicken, after almost 20 years–I’m now on MoneyDance

UPDATE 1/5/2013: the picture at the right is of a mailer I received yesterday in the mail.  ATTENTION VALUED CUSTOMERS indeed!

The last 10 years being an Intuit customer has been a test of patience, to put it mildly.  Intuit decided to start forcing people to upgrade every 3 years by turning off downloading transactions from your bank.  I don’t mind paying for upgrades, but when the upgrades are buggy as hell and have no other purpose than change itself, then I really hate paying for an upgrade.  Every release of Quicken changed the UI so that it took weeks or months to get used to the new version.  Being a software developer myself, I love paying for something that I like to use and has value.  Quicken stopped having both of those properties a long time ago.

Yesterday I got the dreaded Quicken dialog that reminded me that in April 2013 I would not be able to download transactions from my banks.  I immediately started looking for alternatives.  Three years ago I looked seriously at GNU Cash.  I just couldn’t make the jump.  The application has a different accounting style than I’m used to and the import of my Quicken data didn’t go well.

While looking through the Amazon.com pages on Quicken 2013 I saw many unhappy people and references to something called MoneyDance.  So, I downloaded the demo and easily imported my Quicken accounts/data.  A quick check of the balances between Quicken and MoneyDance seemed to indicate the import worked well.  The UI of MoneyDance is very clean and the application was snappy as hell.  I had gotten used to the lag in Quicken.  Of course, the main thing I needed to get working was downloading transactions from my banks, so I set out to do that.  I got everything to work except Schwab and ShareBuilder.  I’ve sent a query to Schwab, since it seems I need to enable Direct Connect on my accounts, and posted on the support forum for MoneyDance about ShareBuilder.

Overall, I really like MoneyDance.  The few things I’m getting used to:

  • The account list in the left sidebar is sorted alphabetically.  I prefer that list in an ordered I specify.  I can rename the accounts to begin with “1-“, “2-“, etc., but that’s a hack.  The MoneyDance people have registered this requested feature.  Hopefully they’ll implement it soon.
  • I find the register of MoneyDance often positions itself at the top rather than the bottom.  I can reverse the sorting, but I really want older transactions on top and newer ones on the bottom, like I’m used to, and I always want the visible portion of the window to be the bottom.  I need to ask about this one, and hopefully there’s a fix.
  • Quicken allowed setting up a group of online bank accounts all at the same time.  In MoneyDance, you have to do them one at a time.  Not a huge deal, but it would have been nice to do them in groups.

I get a really good feeling from the support forums, like they listen to their customers and respond quickly to issues.  The exact opposite of Intuit.  I also like the spartan look of the UI.  We’re talking accounting software here, no reason to make it more complex than it needs to be.  Simplicity is good, especially here.  They seem to release updates frequently, too, which is way better than Intuit.  Until the switch, I was dealing with serious bugs in Quicken 2010.  I’m so glad to be finally rid of Quicken!

Renaming photos with ExifTool

So, years ago I wrote a Lisp program to rename my photos to follow a specific convention (YYYYMMDD-HHMM-SSXX-CAM.EXT).  I use this because I can see at a glance what camera was used and when the photo was taken.  At this point I’m just too used to this to change.  The problem is that my program doesn’t deal with raw files, since they don’t have EXIF info but a camera-specific format.  ExifTool to the rescue.  It’s a Perl program and an amazing one at that.  Rather than fix my Lisp program to handle Canon raw files (the only ones I care about), I decided to switch to ExifTool.  It is really an amazing program.  Did I say that already?

The tricky bit was going to be getting the camera name part as an abbreviation.  The full name, Canon 5D Mark III, is readily available for use in file names, but I want something much shorter: 5D3.

The next issue was the “XX” part of the file name.  This was represented as a “sequence number”.  Say I take two photos in the same second of time (very  possible with my 5D, since I can take up to 7 photos a second).  I need that sequence number to distinguish like-named photos, otherwise they couldn’t coexist in the filesystem on my computer.  Canon has a “File Number” tag, which is something like “<folder>-<sequence>”.  <folder> is usually “100” and <sequence> is monotonically increasing for a given camera.  It’s basically a shutter count.  The problem is that non-Canon cameras don’t have File Number.  My Panasonic DMC-TS3 has a Sequence Number tag, however, which seems the same as I was using in my Lisp program.

I also want it to handle video files, which don’t share the same format with camera files, but ExifTool does handle this.

To put all this together, I need additions to ~/.ExifTool_config that create new tags, MyFileNumber and MyModel, that have the values I want, then it’s just a matter of calling ExifTool to do the renaming.

First, the ~/.ExifTool_config addition:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyModel => { # Abbreviate the model number for inclusion into filename
            Desire => {
	        0 => 'Model',
		# always exists, AFAIK:
	        1 => 'Make',
            ValueConv => q{
	    	my $name;
		$name = defined $val[0] ? "$val[0]" : "$val[1]";

		# H.264 videos have numeric Make
		# Numeric values are from:
                #   http://owl.phy.queensu.ca/~phil/exiftool/TagNames/H264.html
		if ($name =~ /^\d+$/) {
		    return "Pana-H264"  if $name ==  0x103;
		    return "Sony-H264"  if $name ==  0x108;
		    return "Canon-H264" if $name == 0x1011;
		    return "UNKNOWN-H264-VALUE:$name";

	        # Phones:
	        $name =~ s{Galaxy Nexus}{GN};

	    	# Canon:  ORDER IS IMPORTANT!
	        $name =~ s{Canon EOS 5D Mark III}{5D3};
	        $name =~ s{Canon EOS 5D Mark II}{5D2};
	        $name =~ s{Canon EOS 7D}{7D};

		# Panasonic, remove DMC- prefix, leave rest.
		$name =~ s{DMC-}{};

		return "$name";

        MyFileNumber => {
	    Desire => {
	    	# Canon.  Example: "100-3504".
	        0 => 'FileNumber',
		# Panasonic.  Usually 0.
		1 => 'SequenceNumber',
		# dummy value that must exist and is ignored.
		2 => 'Make',
	    ValueConv => q{
	    	if (defined $val[0]) {
		    # probably Canon, look for "100-" and remove it
		    my $fn = $val[0];
		    $fn =~ s{^100-}{};
		    return "-$fn";
		return "$val[1]" if defined($val[1]);
		return 0;
	    PrintConv => 'sprintf("%02s",$val)',

1;  #end

Then, I can call ExifTool to rename from my CF card like this:

exiftool -directory=d:/pictures/_TMP/_RAW/ -r -progress -v1 \
    -ext '*' --ext avi \
    --ext ctg --ext bdm --ext tid --ext tdt --ext mpl --ext cpi \
    -d %Y%m%d-%H%M-%S \
    '-filename<${DateTimeOriginal}${MyFileNumber}-${MyModel}.%e' \

This English version of that is: output to d:/pictures/_TMP/_RAW/ after recursively finding all files except ones that have certain extensions (avi, ctg, bdm, tid, tdt, mpl, cpi), using my date format specified, using a source directory G:/ (where my CF card is mounted in Windows), giving a progress as ExifTool does the work.

Again, I love ExifTool!

How to blacklist by caller id name in Asterisk/FreePBX

I use Asterisk (1.8.11-cert5)/FreePBX (2.10.0) for my home phone system.  For years I’ve been pestered by a specific company that is running a credit card rate reduction scam.  I’ve tried and tried to get off their list, to no avail.  I finally got sick of it, so I looked to Asterisk/FreePBX to see if I could blacklist the calls.  The problem is their number changes, but their caller id name does not.  (I’m not going to list it here, since I don’t want them to see this and decide to make their caller id name less regular.)

There’s a file, /etc/asterisk/extensions_override_freepbx.conf, that can be used to override definitions in /etc/asterisk/extensions_additional.conf.  In this latter file is the definition of app-blacklist-check:

include => app-blacklist-check-custom
exten => s,1,GotoIf($["${CALLERID(number)}" = "Unknown"]?check-blocked)
exten => s,n,GotoIf($["${CALLERID(number)}" = "Unavailable"]?check-blocked)
exten => s,n,GotoIf($["foo${CALLERID(number)}" = "foo"]?check-blocked:check)
exten => s,n(check-blocked),GotoIf($["${DB(blacklist/blocked)}" = "1"]?blacklisted)
exten => s,n(check),GotoIf($["${BLACKLIST()}"="1"]?blacklisted)
exten => s,n,Set(CALLED_BLACKLIST=1)
exten => s,n,Return()
exten => s,n(blacklisted),Answer
exten => s,n,Wait(1)
exten => s,n,Zapateller()
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup
;--== end of [app-blacklist-check] ==--;

This is the text we want to copy to /etc/asterisk/extensions_override_freepbx.conf, and make some minor additions:

include => app-blacklist-check-custom
;;;ADDED by me:
exten => s,1,GotoIf($["${CALLERID(name)}" = "FOO INC"]?blacklisted)
exten => s,n,GotoIf($["${CALLERID(name)}" = "WINNER"]?blacklisted)
;;;CHANGE: priority goes from `1' to `n':
exten => s,n,GotoIf($["${CALLERID(number)}" = "Unknown"]?check-blocked)
;;;..END additions
;; the rest should be the same as that in
;; the [app-blacklist-check] section in extensions_additional.conf

Lines 3 and 4 are the additions, and the block all calls from when the caller id matches “FOO INC” or “WINNER.”  The latter is an actual caller id that I get from time to time.

It would be nice if the UI in FreePBX allowed me to do this without resorting to editing system files, but it’s not that horrible of a hack.  I just need to make sure that when Asterisk or FreePBX is upgraded that I check the code in the file I copied from to make sure it didn’t change in ways that break my custom code.

EDIT 9/4/2012: the second GotoIf needs to have a priority of “n” not “1”.