billing

AWS S3 Glacier Deep Archive - Difficulty deleting files with accents

A few days ago, my personal AWS account's billing alert fired, and delivered me an email saying I'd already exceeded my personal comfort threshold—in the second week of the month!

AWS billing alert email

Knowing that I had just rearranged my entire backup plan because I wanted to change the structure of my archives both locally and in my S3 Glacier Deep Archive mirror on AWS, I suspected something didn't get moved or deleted within my backup S3 bucket.

And I was right.

But I wanted to write this up for two reasons:

Mobile Phone SMS Spam Can be Expensive

I recently started receiving spam (unsolicited) text messages on my iPhone. I first received one on New Year's Eve, at 8:31 p.m., and then again at 5:00 a.m. a few days later (nice wakeup call... thanks).

These messages were all from some company named 'GagaCell', which didn't turn up many good search results (most were about Lady Gaga, and I'm pretty sure she doesn't harass people with text messages—just her music and lack of style.

GagaCell IQ Spam Text Message

After some online research, I discovered that many people, even after sending STOP to these shortcodes, end up with monthly charges on their cell phone bills. Since I watch my bill pretty closely, I noticed that, all the sudden, I was getting a $9.99 subscription from 'BULLROARE', a content provider I'd never heard of, from short code 31850 (The subscription name was 'IQ32CALL8668611606').

PHP: Calculating Monthly/Yearly Billing Dates - Same day next month

On a recent project, I needed to generate the timestamp for the 'same day, next month' for billing purposes. This can be tough in some circumstances, like when a user signs up on the 31st of August. What happens in September, when there are 30 days? If I were to simply try something like strtotime('+1 month'), I would get back the first day of October rather than September 30th. Same problem happens when someone hits February (oh my! only 28 days there... sometimes 29).

After looking through a bunch of different forums, Stack Overflow, etc., and finding that most people simply pro-rated the current month and billed people on the 1st (which is a valid option), I decided to write my own function that calculates the same day, next month, and simply gives the last day of the next month if the next month doesn't have as many days as this month.

It's pretty much self-documenting. It could probably be reworked to be a little faster, but I had to do this pretty quickly, and it's pretty robust imo: