Friday, March 29, 2013

No-IP Automatic Update Bash Script for Mac OS X

I'll finish this article with background info, but I had a problem with No-IP because AT&T never updated my public IP address through U-Verse.  So the No-IP DNS Update Client (DUC) never submitted an update record, and thus my No-IP host expired.

Enter a quick solution using Unix shell script and cron to schedule.  Thanks to AntonioCS's GitHub post, he provided a good bash script, but did not work on the Mac.  So, with a small modification, we are golden!

First problem, is the script doesn't do an update if the IP address doesn't change.  So, I force a change, like this, to a dummy IP address:


#!/bin/bash

# No-IP uses emails as passwords, so make sure that you encode the @ as %40
USERNAME=--account name--
PASSWORD=--my password--
HOST=--my host name--
LOGFILE=logdir/noip.log
STOREDIPFILE=configdir/current_ip
USERAGENT="Simple Bash No-IP Updater/0.4 antoniocs@gmail.com"

if [ ! -e $STOREDIPFILE ]; then 
touch $STOREDIPFILE
fi

NEWIP=1.1.1.1
STOREDIP=$(cat $STOREDIPFILE)
RESULT=$(curl -o "$LOGFILE" -s --user-agent "$USERAGENT" "https://$USERNAME:$PASSWORD@dynupdate.no-ip.com/nic/update?hostname=$HOST&myip=$NEWIP")

LOGLINE="[$(date +"%Y-%m-%d %H:%M:%S")] $RESULT"
echo $NEWIP > $STOREDIPFILE

echo $LOGLINE >> $LOGFILE

exit 0


Then, I use the No-IP DUC for Mac.  I suppose I could get rid of the GUI, and use the modified AntonioCS script that gathers the current IP address instead, but this suffices nicely, and keeps a GUI up so I can always easily monitor the No-IP status.  If we want, we can do something similar to get the real IP:


#!/bin/bash

# No-IP uses emails as passwords, so make sure that you encode the @ as %40
USERNAME=--account name--
PASSWORD=--my password--
HOST=--my host name--
LOGFILE=logdir/noip.log
STOREDIPFILE=configdir/current_ip
USERAGENT="Simple Bash No-IP Updater/0.4 antoniocs@gmail.com"

if [ ! -e $STOREDIPFILE ]; then 
touch $STOREDIPFILE
fi

NEWIP=$(curl http://icanhazip.com/)
STOREDIP=$(cat $STOREDIPFILE)

if [ "$NEWIP" != "$STOREDIP" ]; then
RESULT=$(curl -o "$LOGFILE" -s --user-agent "$USERAGENT" "https://$USERNAME:$PASSWORD@dynupdate.no-ip.com/nic/update?hostname=$HOST&myip=$NEWIP")

LOGLINE="[$(date +"%Y-%m-%d %H:%M:%S")] $RESULT"
echo $NEWIP > $STOREDIPFILE
else
LOGLINE="[$(date +"%Y-%m-%d %H:%M:%S")] No IP change"
fi

echo $LOGLINE >> $LOGFILE

exit 0


Background

No-IP is a Dynamic DNS updater (or DDNS).  The reason I need such a thing is to access my home network from the Internet.  Because my Internet Provider (AT&T or whoever) assigns me an address that may change, I can't simply go to that address when I am traveling.  DDNS gives me a host name where I can pick an Internet domain, and go to it just like any other web site.  If the IP address changes, it is detected and updated by the DUC.  Some routers support certain DDNS providers, but No-IP is both free and has no limits on usage, whereas others may limit you to an account that expires unless you "touch" it periodically, an annoyance.

Conversations with Siri #8

Obviously Siri is not familiar with the works of Douglas Adams!

Wednesday, March 27, 2013

National Do Not Call: What You Can Do


Have you been bothered by robo-calls and scammers?  There is something you can do.  First, know the law and your rights.  The law simply states that telemarketing businesses (as of February 2008) are obligated to honor the National Do Not Call Registry.

Second, regardless of whether or not you registered your phone with the National Registry, if they use a machine to call you, you can still file a complaint.  I strongly feel that no one deserves to be called by a machine.  It's enough that we are spammed on our text and e-mails; now we get spam calls from robots?  Do your part, the more complaints the government gets, the more they can prosecute violators, and the better the law works.

(Image courtesy of blogs.lawyers.com)

Tuesday, March 19, 2013

Otter Box's Fall From Grace

When I got my first iPhone, the 3G, I wanted to find a case that protected it completely, and had a belt clip.  What I ended up with turned out to be the absolute best-rated case on the market, the Otterbox Defender.  When I bought a new iPhone, I took the case off and gave it to my son for his 3GS, my 3G was in mint condition through drops, spills, splashes, etc.
Furthermore, the case was still entirely usable - even though the earbud port cover fell off shortly after that, it still works.
So when we bought our iPhone 4 and 4S's, there was no question - Otterbox.  We have 3 of the Defender series cases.  First I bought mine, but my wife bought one that supposedly reduced emissions, and my daughter bought the Reflex because it splits in half easily so she can dock with her alarm clock.  So much for the Pongo case, it broke (and was replaced by the company) 3 times within 6 months, finally she got the Defender.  My daughter lost the bottom half of the Reflex case because, well, if she didn't have her head attached...
So they both ended up with the Defender.  Since mine was the oldest, it was the first to go.  Had to be replaced within 6 months.  The other 2, same story.
The way the Otterbox Defender cases are designed, you have a plastic shell that surrounds the phone, covering with clear plastic the accessible portions (screen, Apple logo, camera lens), and providing a mount for the rubber outer impact-resistant cover.  However, with the new 4/4S case, they must have changed the rubber material.  Certainly for the new form factor, it is more squarish and thus less rounded, providing a thinner material all around.  But after a few months of very normal use, the rubber stretched and didn't fit snugly any more.  The charger, earphone, and silent switch port covers were very difficult to close, and hung as annoying flaps.  The portion covering the home button jutted out, getting caught on everything, and allowing all kinds of dust and dirt underneath.  My daughter's cover even had the thin portions of the rubber tear off.
Otterbox does have phenomenal customer service, and replaced the cases with no questions asked (other than purchase date, location, dated photos of the device, etc.).  However, after the 1 year warranty has expired on the case, I have spent $50 on a case that is getting worse week by week, and won't be replaced anymore.

So I advise against the Otterbox, at least for the iPhones.  From what I have seen, Griffin has a case that is durable, and the iPad cases that I have seen from them are definitely superior.

Thursday, March 14, 2013

Mobile Device Options and the Baby in the Oven


Long time followers of my blog have probably read posts extolling the virtues of Linux and Unix-based computing (like the Mac), and many know how much of a huge Apple fan I have become in just a few short years. I still believe the best marriage of hardware, OS, and software in a mix of laptop, desktop, phone, tablet, and set top boxes is Apple. However, Canonical, the makers of Ubuntu Linux, have recently announced the pending release of Ubuntu 13.04 LTS (2013 April) which will include mobile platform support. Now for many reasons I still think Apple has them way beat, but this I think will be a contender, and may well knock Android down more than it impacts Apple's market share. Let's look at why I think so.
  • Innovative redesign of touch screen use
    • Ubuntu has brilliantly defined an environment for full-screen edge-to-edge mobile applications.  While the rest of the interface may or may not be as coherent, elegant, and performance-based as iOS, this alone is a giant leap forward.
    • Not a single mobile OS makes it easy for applications to take full edge-to-edge screen use, until now.  Screen real estate may be more valuable than Manhattan real estate!
  • Synergy
    • With Apple, the synergy of phone, tablet, and PC are well known (here I use the generic meaning of PC, not the "non-Apple" definition).  Everything works great together.
    • Apple now has perhaps 3 well-known Operating Systems in production use.  These are Mac OS X, iOS, and Apple TV OS.  Although the roots of the other 2 are OS X, they are separate and distinct builds, with their own libraries.  If you build an app for one, it works only on that one.  Right now, developers can only release apps for the first 2 in general, but there are rumors that Apple may open up the App Store for developers to Apple TV apps.
    • However, with Ubuntu, they only have one desktop OS.  Ubuntu.  The mobile touch-based interface represents the OS adapting to the hardware it detects, such that if you hook a keyboard, mouse, and screen to your phone - it will morph to the Gnome desktop.  Same OS. This means a total synergy of all platforms, and applications!!
    • Now, imagine someone makes a set-top-box ala Roku/Apple TV/Google TV, and imagine that it implements Ubuntu - with its vast array of apps for download.  Wow.  Wow!
  • Apple Ecosphere vs. Ubuntu Ecosphere vs. Android Messosphere
    • With Apple, everything works together, seamlessly.
    • With Android, it is a total mess.  Do you buy apps from the Market, or Amazon?  Or Nook, or just download them (ala the wild wild west) willy nilly and throw whatever virus-ridden app you want on your precious device?  What about the pricing structure - or lack of?  How does one market their app - certainly not effectively through new media.  How does an app developer make money off their app, and make a viable business model?
    • Ubuntu has had the Software Centre from the beginning.  Just like the Mac App Store or iTunes App Store, it is a central place from which to discover, purchase, download, and install apps onto your device.  The key kicker here:  There is only one OS!!  This means that an app developed for Ubuntu - only has to work on Ubuntu, to work on any device - phone, tablet, or PC.  WOW!  This is revolutionary, and a monumental achievement - if it works well.
      • Why this won't bite into Apple's market:
        • First, Apple lovers are pretty hard-core die-hards.
        • Second, the biggest advantage that Apple has here, is that an app for the iPad is not simply an iPhone app sized up.  It is totally redesigned UI (User Interface for those non-geeks) for the larger screen experience.  Unless Ubuntu has provided some pretty sophisticated libraries, AND app developers have made proper use of those libraries, you will end up with an Android-like result - apps that are merely sized bigger.
        • As a programmer for over 38 years, let me advise you as a non-programmer: when you design an app, it is very important to build in from the beginning a coherent and consistent way to deal with interaction.  That is to say, that the desktop paradigm of moving a mouse pointer around, does not translate perfectly into the mobile touch-screen environment.  Further, when you move across hardware devices from one manufacturer to another, or from one device type to another (think phone vs. tablet), the underlying hardware drivers and components may make your app crash or behave unexpectedly.  Therefore, Apple spent a lot of time, money, and effort to redesign the OS X to make iOS, so that they would have a platform that specifically targets from-the-ground-up designs specifically for mobile small-screen devices, optimizing the interactions.  And iOS has built-in the ability to detect, are you running on an iPhone/iPod, or iPad, or whatever new device they come up with in the future?
      • Why this will bite into Android's market:
        • Ubuntu runs on Android-compatible hardware
        • Ubuntu runs Android Java-based apps
        • I don't believe Android users are as loyal to Android as Apple users are to i-devices
        • Frankly, the reason Apple has sprung from a mediocre smallish company to the hands-down largest market cap in the world is not just product, but product reliability, and product support.  Did I just say "support?"  I meant to say "SUPPORT!"  Apple could open up a standalone business just doing training of other businesses in how to run a support center.  You think Apple customers are loyal only because of the products?  I don't stick with AT&T Wireless only because of the cellular coverage - believe me!  All those Samsung customers can evaporate as easily and quickly as they were acquired, if something else comes along.
        • Another huge fragmentation in the Android-sphere is the fact that, according to many studies, the vast majority of Android users are running on older, outdated versions of the Operating System.  In contrast, when Apple released iOS 6 with the iPhone 5 last September, within a month they had tens of millions of downloads.  The majority of iOS 6-capable devices run iOS 6.  With Ubuntu, they also have large market penetration of updates, especially LTS (Long-Term-Support) releases.  The unified OS means they only have one OS to maintain, and I would anticipate it to be much more stable (eventually), perhaps even across hardware platforms.
Agree?  Disagree?  Post your comments!

Help Stop CISPA IMMEDIATELY!


I don't know if you were aware of the campaign to stop the federal legislation called CISPA, but I am making a desperate appeal to sign this campaign.  This legislation in the name of cyber security, will give the Federal government the ability to perpetrate undue invasion of privacy, by allowing them to peruse your encrypted online data without a search warrant.  Do you want them looking into your Google Drive documents?  Your DropBox files?  Your social networking personal and private data?  This will do all that, without due process or probable cause, all Constitutionally-protected rights!

Stand up for your rights now, contact your representatives, and sign the petition, PLEASE!

Tuesday, March 12, 2013

A Letter to Seagate Support

(Check back as this conversation is updated)

Remember my rant about hard drive capacity?  My company recently bought a "750GB" Seagate hard drive, but when I installed it, it was only 698GB.  I had also bought a 2TB Western Digital MyBook Live drive, which, strangely enough, on comuputers reports as a total capacity of - 2TB.  Hmm.  What is going on here?

So I opened a support case with Seagate, and this is the response, which I was totally expecting:


Dear Jay Imerman:


Thank you for contacting Seagate Support.


I understand that the drive's capacity appears to be less than advertised.

This is due to a translation from a decimal number system to the binary number system that the operating system uses.


Here are two Knowledge Base articles that explain this thoroughly:





Please let me know if I can explain anything further.


For additional assistance, feel free to contact us at: www.seagate.com/about/contact-us/technical-support/




Regards,



Shawn

Seagate Support



My response?  I'll bet you 1 GigaDollars it falls on deaf ears.




Shawn,


Thank you for your reply.  I have been a computer expert and professional for over 25 years.  In that time, I have deployed hardware and software in small to large multinational organizations, written and implemented software to manage and manipulate data, and have dealt with many aspects of modern computing.  I have never seen a byte defined as anything other than 8 bits (aka binary digits, or a single on/off represented by 1 and 0).  One Kilobyte has always been, and is defined in every Operating System throughout the planet, as 1024 Bytes because computers compute in binary.  1 MB is 1024 KB, or 1,048,576 Bytes.  Therefore, 1GB is, by definition, 1,073,741,824 Bytes.


Are you telling me that you can arbitrarily redefine a mile, and sell me a string that is 3 miles long, and say no, 1 mile is 100 feet, and 1 foot is 100 inches?  So you give me 10,000 inches, when I am buying 63,360?  Sorry, it doesn't work like that.  If you look at the first link you provided, you indicate a column "Binary Value in Decimal" and "Decimal Equivalent."  I don't know what math you took, don't mean to be rude, but 1024 is not equal to 1000.  (The "In Decimal" is the key, it is decimal - in Binary it is 10000000000, which is 1024 Decimal.  So you can't just try to sell me on the fact that 1024=1000.)


IEEE is the governing body for international standards, and you can easily see this standard conforms to what I have laid out above.   http://en.wikipedia.org/wiki/JEDEC_memory_standards


Your drive says it is 750GB, and there is not a single operating system on this planet for computers that will report it as 750GB?  That means Seagate cheated us out of 52GB by listing the drive as 750GB capacity.  I would suggest that you list JEDEC capacity, if you want to list it as a 750GB drive, then also on the box and in literature and web listings, also list the JEDEC capacity according to IEEE 100 standards so consumers can accurately compare.


I recently purchased a Western Digital 2TB MyBook Live drive, which reports 1.998 TB of space on OS X, Windows 7, and Ubuntu Linux.  There is a small overhead of formatting for the file system, this is understood, and the full drive capacity does say 2TB.  This is an industry standard, that has been accepted universally in all countries since the beginning of electronic computer storage.


Since we are missing 6.9% of the storage it says on your literature, you should reimburse my company 6.9% of the purchase price.  We bought it from CDW for $132.99, so a refund of $9.18 sounds reasonable.



Best Regards,




Jay Imerman


Dear Jay,


Thank you for contacting Seagate Support.


Here is another helpful link to help explain the difference between Decimal and Binary. Seagate, as well as all hard drive manufacturers, sell drive capacities based on their decimal value.

Also if you check section 4.3 in the following wiki, you will find useful information regarding how IEC binary prefixes are not used by hard drive manufacturers. Instead SI prefixs are used to state the capacity.
For additional assistance, feel free to contact us at: www.seagate.com/about/contact-us/technical-support/
Regards,
Jason
Seagate Support
 


Thank you, that clearly explains the history and how this huge discrepancy came about.  However, my original issue remains.  If you are selling say gasoline by the ounce, you would never in a million years list:

Gasoline 300 oz $15

And expect people to think you are selling it by volume.  Obviously oz means weight, while "fl oz" means volume.   Both are ounce (in my analogy for GB and GB for Gigabytes and Gibibytes).  The ridiculousness of it all is highlighted by my spell checker, which has never heard of the term "Gibibyte" before.

The fact that you have to put these FAQ pages out there means it is confusing and, I do declare, deliberately or not, misleading.

When I buy a hard drive, I expect the label on the box to match what I see in my window in the OS.  I think that is fair and reasonable.  We wouldn't be having this conversation if your drive had said "698GB JEDEC standard" or even "698 Gibibytes" or "750 GB - IEEE 1541-2002 standard".  That is totally clear, kind of like "gram," "Kg," "L", "dL" as opposed to "ounces" and "fluid ounces."

Western Digital doesn't try to deceive its customers in this way, no matter if you use the auspices of the SI standard to justify perpetrating the misunderstanding.

Best Regards,
Jay Imerman


 
Dear Jay,


Thank you for contacting Seagate Support.

I completely understand your confusion. I am glad that I was able to provide clarification on the issue. I appreciate the feedback and I will forward this suggestion to the appropriate department.
For additional assistance, feel free to contact us at: www.seagate.com/about/contact-us/technical-support/
Regards,
Jason
Seagate Support
 

Thanks so much!  You can send the refund to:


--ADDRESS DELETED--

Best Regards,
Jay Imerman
Dear Jay:


Thank you for contacting Seagate Support.


Unfortunately we will not be able to send you a refund. We can however replace the drive for you. 


For additional assistance, feel free to contact us at: www.seagate.com/about/contact-us/technical-support/ 

Regards,

John

Seagate Support



Thanks for your reply, John.


Well, the drive is working fine, but the issue I have is with capacity.  Would a replacement fix that problem, and give me a reported capacity in the OS as 750GB (meaning Gibibytes not Gigabytes)?


Best Regards,



Jay Imerman

_________________________________________________________

What followed was several more e-mails - oh, how shall I say it?  Have you ever written a program that does something, and loops back waiting for a condition that never happens?  It is called an endless loop.  One e-mail says "I don't think you were sent the link explaining Binary to Decimal conversion" at which I reply yes, but that doesn't solve the problem, followed by "this guy's blog explains the discrepancy" - each answered by a different person, none of whom were ever involved in the conversation more than once.  I have this picture in my head of a large tech support team, passing this one around, and the handful of other pain-in-the-ass e-mails they get from people like me, waiting for us to give up.  Well, guess I've proven my point - but at least I bothered them a bit.



Now, here's something interesting.  Tuesday June 18 is now more than 3 months after the issue was closed out., I get this:

From: CEB Customer Surveys [mailto:CEBCustomerSurveys@executiveboard.com]
Sent: Tuesday, June 18, 2013 9:49
To: Jay Imerman
Subject: Seagate - Request for Customer Feedback

Seagate and the CEB, an independent research company, invite you to participate in a customer service survey designed to gauge your opinions on how to provide excellent customer service.

Seagate is participating in the survey because we would like to know how our customers feel about these topics and find out what is important to them in terms of customer service.  By completing this survey you can help us shape our future service offerings.

This survey will take approximately five to ten minutes to complete.  Your responses will only be used to analyze your opinions about different customer service offerings, so please be as candid and direct as possible.

Click here to access the survey:

[-- link removed --]


Thank you in advance for your participation!