Project Idea: Face detection in Gallery2
This past weekend my little sister and I were going through the Facebook profiles of various cousins, and I noticed something about Facebook’s photo support that I somehow missed before: it automatically detects the presence of faces in each photo, and allows users to tag each face with the identity of its owner. Already-tagged faces have the owner’s name superimposed over the image.
That’s an awesome feature, and reminds me of the stuff Riya was working on a few years back (although FB doesn’t do facial recognition (yet, anyway), so you still have to tag everyone yourself). I was immediately jealous that my photo hosting software of choice, Gallery, didn’t have this feature.
I investigated this a bit, and I found that Intel’s OpenCV library includes open-source face detection code. Using Intel’s sample face detect app, I found it to be both quick (~150ms per photo) and accurate. I wonder how much work would be required to create a Gallery module that used opencv to detect faces in photos, and provided an AJAX UI for tagging the photos. It would certainly be cool.
Assault Weapons, and various other propaganda
Lately the Democratic presidential candidates are making a great deal of noise about their commitment to renew the “Assault Weapons Ban”, for either the children or police officers depending upon the venue. On the Republican side, candidates Romney and Guiliani are having trouble with the conservative base for, among other things, past support for state and federal bans on “assault weapons”. Few things anger informed gun owners more than “assault weapons” foolishness, and I suspect any intellectually honest person with all the facts, regardless of their position on civilian gun ownership, can agree that the gun-control lobby and their allies in the media have pulled off quite a feat of propaganda with the invention of the “assault weapons” language.
To understand what this debate is about, you must first understand what it’s NOT about. As with most industries, the small arms industry has its own nomenclature; terms of art that have specific meaning beyond the superficial definition of the words. One of these terms of art is “assault rifle“.
The term “assault rifle” has its origins in the Nazi small arms program of World War II, when a powerful new rifle, the Sturmgewehr 44, or STG-44 for short, was introduced. The word sturmgewehr literally means “storm rifle”, though the term “assault rifle” more accurately captures its meaning. The STG-44 was the genesis of a new category of small arms, characterized by all of the following properties:
- Chambered in an ‘intermediate’ caliber, meaning a bullet more powerful than a handgun, but less powerful than the battle rifles of the time, which were chambered for calibers like .30-06 and .30-30
- Fired from the shoulder (as opposed to fired from the hand like a handgun)
- Capable of selective fire. This is a vitally important characteristic of assault rifles. It means the operator can fire the rifle in either semi-automatic mode (that is, one shot for every trigger pull), or automatic mode (rapid fire as long as the trigger is held down). Though technically not a “machine gun” by the gun industry definition of the term, the assault rifle definitely fits the popular conception of a machine gun as a weapon capable of fully-automatic fire
- Fires ammunition stored in a large, detachable magazine. Usually an assault rifle magazine stores between 20 and 40 rounds, with 30 being the most common
- Fires from a locked breech. This is a detail of the gun’s implementation and not relevant to my argument
- Having a barrel length of 20″ or less. This is also not relevant to my argument
Because assault rifles are literally by definition automatic weapons (so-called “machine guns”, though in the gun industry a ‘machine gun’ is another term of art), they have been tightly regulated in America by the National Firearms Act of 1934 and the Gun Control Act of 1968. Any civilian seeking to own a “machine gun” must submit fingerprints to the FBI, get the ‘permission’ of a local law enforcement officer, undergo a background check by the ATF, pay a $200 tax, and receive a special stamp. Due to a law passed in 1986, any “machine guns” made after 1986 cannot be owned by civilians under any circumstances, leaving only those made before 1986. While there are thousands of “machine guns” legally in civilian hands, they make expensive pets, both due to the huge amount of ammo one burns through on full auto, and due to the extremely high prices commanded by pre-86 autos. To my knowledge, no legal owner of a machine gun has ever used his/her automatic weapons in a violent crime, and why would they? It would be a waste of an expensive weapon, and one very clearly tied to its owner.
Having explained what an “assault rifle” is, perhaps you’re thinking “they should be banned; nobody needs a machine gun!”. This is what you’re supposed to think. The “assault weapons ban” has literally nothing to do with assault rifles, though the proponents of the ban would have you think otherwise. The term “assault weapon” is not a gun industry term of art, but a legal term created by the 1994 crime bill and related state laws. Under the legal definition of “assault weapon”, an assault rifle is in fact NOT an assault weapon, because an assault rifle is capable of fully automatic fire and thus already subject to extensive regulation under the National Firearms Act.
If an “assault weapon” isn’t an “assault rifle”, then what is it and why should it be banned? To answer that question requires some history.
The 80′s and 90′s saw a number of high-profile shootings in which one or more gunmen used either already-illegal fully-automatic AK-47s (true “assault rifles”, and already illegal in the US), or legal semi-automatic versions of the AK-47 and similar rifles (not “assault rifles” and not “machine guns”). Politicians, sensing a need to Do Something, began to demonize rifles like the AK-47 and M-16. Senator Dianne Feinstein famously brandished an AK-47 in a news conference with her finger on the trigger, the bolt closed, and the muzzle covering the media (of course, “it wasn’t loaded”, so it’s alright). The argument, then as now, was “you don’t need a machine gun” and “why does anyone need to fire 30 bullets at a time?”.
All of this led to the 1994 crime bill, which included a ten year ban on “assault weapons” manufactured after the effective date of the law. An “assault weapon” was defined thusly:
Any semi-automatic rifle with a detachable magazine (meaning the “clip” where the bullets go is removable and can be replaced with a loaded magazine very quickly) and two or more of the following features:
- Folding or telescoping stock
- Conspicuous pistol grip
- Bayonet mount
- Flash suppressor, or threaded barrel designed to accommodate one
- Grenade launcher (more precisely, a muzzle device which enables the launching or firing of rifle grenades)
If you’re a thinking person, you might be asking yourself why a bayonet mount or a telescoping stock or a flash suppressor would make a gun more dangerous than it otherwise would be. You’re not alone. This language was written to ban “scary” guns like legal semi-automatic versions of the AK-47 and M-16 without banning them by name (which would be easily skirted by naming them something else).
What the gun ban crowd didn’t realize (likely due to their collective ignorance where guns are concerned) is that most of these features aren’t important to the function of the gun. Thus, the manufacturers of “assault weapons” simply removed the bayonet mount, replaced the flash suppressor with a muzzle brake, replaced telescoping stocks with fixed stocks that just looked like telescoping stocks, and voila!, the gun was no longer an “assault weapon”.
To make sure you understand how absurd this all was, here are some pictures of “assault rifles” (tightly regulated since 1934), “assault weapons” (banned from 1994 to 2004, but legal now (yay!)), and rifles that look like “assault weapons” but aren’t (never banned by federal law):
First, here is a true “assault rifle”, a Colt M4 capable of both semi-automatic and fully-automatic fire. Many American and Coalition forces in Iraq and Afghanistan are equipped with M4s. These have been tightly regulated in the US since 1934, cannot be owned by civilians at all unless manufactured prior to 1986, and have never been the subject of any “assault weapons” ban:

Now, here is an “assault weapon” banned by the federal Assault Weapons Ban until it expired in 2004, and still banned under a number of states’ assault weapons bans. It is similar to the Colt M4 above, but with a hugely important difference: it’s not capable of fully-automatic fire:

Here is a rifle made by Bushmaster after the ban on “assault weapons” was enacted. The rifle is subtly different from the banned rifle above, in that is does not have a bayonet mount, a flash hider, or a collapsible stock, and therefore was legal to own while the assault weapons ban was in effect:

Next up is another Bushmaster rifle, made in response to California’s state assault weapons ban, which is even stricter than the federal ban. In addition to the cosmetic changes made to the rifle above, the below rifle does not accept detachable AR-15 magazines; it’s loaded with 10 rounds, and after those are gone the gun itself must be reloaded:

For comparison, here is a Ruger Mini-14, which has never been banned under any enacted assault weapons ban legislation:

Each of these rifles fires the same ammunition, 5.56x45mm NATO, the same ammunition used by American and most NATO militaries. Each of them can fire one round with every trigger pull (though the full-auto Colt M4 also has a fully-automatic mode like a “machine gun”). Each of them are accurate to hundreds of meters in the right hands. Each of them can be fired between 10 and 30 times between reloads. Each of them could easily kill a man or large animal with the right shot placement.
What, then, is the difference? Can you even tell them apart by looking at them? Why is one tightly regulated since 1934, another banned for ten years between 1994 and 2004, and others never banned at all? With the exception of the fully-automatic Colt M4, the answer is simply cosmetic features. That’s the fraud of the AWB. Some politicians collaborated with some anti-gun lobbyists to ban “scary” looking guns, counting on the ignorance of the masses to confuse “machine guns” like the Colt M4 (again, virtually impossible for civilians to obtain) with semi-automatic rifles with some or all of the same “scary” cosmetic features.
So, when you hear the likes of Pelosi and Clinton fretting aloud at all the police and children that are being killed now that the assault weapons ban has expired, and how we really need to re-enact it, ask yourself how many children and policemen are really being killed by bayonet lugs and flash hiders. Better yet, ask the DoJ. They were hard-pressed to find any evidence that so-called “assault weapons” were the favorite of evildoers that the anti-gun lobby claimed, nor was there any evidence suggesting the ban on the weapons had any effect on violent crime.
You don’t have to take my word for it. Listen to Rep. Carolyn McCarthy explain why “barrel shrouds” are banned in her proposed assault weapons ban, HR 1022:
In case you’re wondering, a “barrel shroud” is not, in fact, a “shoulder thing that goes up”. Who actually wrote HR 1022, anyway?
Maybe you don’t think civilians should own machine guns. I happen to disagree with you, but don’t be tricked by dishonest politicians into believing assault weapons bans have anything to do with automatic weapons, weapons of “unusual lethality” (thanks Mitt!), weapons “designed to be spray-fired from the hip and are designed to maximize death and injury from a very rapid rate of fire” (thanks Brady), or anything other than the unholy alliance of Do Something political theatrics and the anti-gun agenda.
To test your newfound knowledge, read this CNN article and count the false/misleading statements.
Photo credits:
Image of fully automatic Colt M4 taken from Colt Law Enforcement web site.
Image of semi-automatic “assault weapon” originally posted by cgv69 to AR-15.com M4 picture thread
Images of post-ban and top-loading Bushmasters taken from Bushmaster web site.
Image of Mini-14 taken from Wikipedia Mini-14 article
UPDATE: For you more visual learners, this YouTube video is worth watching.
The Cyberspace That Might Have Been
I’ve commented before on the vision of the near-future I grew up with, reading Wired, Bruce Sterling, William Gibson, Neil Stephenson, et al. In my teenage years, I looked eagerly forward to the near future, when the vision of a Utopian cyberspace would become a reality, whether the institutions of the old century liked it or not. Of course, living as I do in the near-future, I know better. I know governments and the other powerful institutions of the last century are still here, and they control the cyberspace where the Utopia was supposed to be built.
Today I ran across another reminder of the starry-eyed idealism that ruled the geek class in the early-to-mid 90s. The Declaration of Independence of Cyberspace (don’t laugh!) was written by John Perry Barlow, one of the founders of the Electronic Frontier Foundation in Davos in 1996. At that point I was just getting used to in-home dial-up PPP Internet access, had not yet started my professional career, and the world seemed ripe for the coming of the third age of man; the Information Age.
It was going to be great. We’d have ubiquitous cryptography, so everyone would create and abandon digital identities to suit their needs with no chance of eavesdropping or surveillance. Governments and corporations would flail about, trying to restrict and control and regulate the flow of information, only to find that the borderless, formless world of cyberspace defied their antiquated legal regimes. There would be anonymous, private electronic cash upon which would be built a new economy, more varied and wonderful and free than any the world had ever seen. The anachronism of the nation-state would be relegated to the comparatively mundane task of managing meatspace, leaving the boundless creative genius of humanity to evolve and grow in the perfect liberty of cyberspace.
That, anyway, was the idea. I remember when the Communications Decency Act (CDA) was passed, I was living in Nebraska and barely had any access to the Internet. One of Nebraska’s senators was a co-sponsor of the bill, and I clearly recall regarding the law and the foolish gerontocrats who voted for it with pity more than contempt. What fools they must be, to think they can control the content of the Internet, “for the children” or for any reason. Didn’t they know that the new frontier defied regulation, censorship, oversight, and control? No matter; they’d soon find out as they fumbled about trying to enforce that which they could control.
The future, as we now know, didn’t turn out that way. Yes, there’s Google democratizing consumption of information, blogs democratizing the production of information, and YouTube democratizing video entertainment. It’s great that we have the powerful Information Age tools we do, but it’s a far cry from what it was supposed to be. I can’t receive, store, and spend money without surrendering my privacy to a bank required by law to gather and retain minute details of my identity. I can’t publish offensive or damaging information without government harassment or a DMCA takedown notice. I can’t layer hidden, undetectable cryptographic networks atop Internet traffic to avoid surveillance. I can’t buy or own property without registration and reporting. I certainly can’t take a commercial flight without submitting to searches and background checks by unaccountable government agents.
To be sure, alot of this utopian rhetoric was coming from crypto-anarchists and libertarians who latched on to cyberspace as their last best hope to realize their long-standing vision of a self-organizing ad-hoc society free of governments and corporations. Many of these people are now 9/11 truthers, Ron Paul supporters who chant “End the Fed” and hoarde gold for the coming economic collapse, and yes, some of them are even tax evaders and charlatans. Lover of liberty though I am, I’m no crypto-anarchist, I’m pretty sure 9/11 isn’t a Bush conspiracy, I think Ron Paul is a nut, and I pay my taxes (though not without considerable whining).
Nevertheless, I can’t help but feel pangs of regret when I run across old documents like the Hacker’s Manifesto and, yes, even the Declaration of Independence of Cyberspace. I wonder what might have been, or if we’ll ever really know. It’s almost enough to make me read old back issues of Wired. Almost.
Watched "Charlie Wilson's War"
My friend got a screener for Charlie Wilson’s War recently, and I watched it last night. I was expecting a great movie, and I got it. It’s hard to believe America came so close to abdicating Afghanistan to the Soviets; here I thought our modern political class was uniquely feckless and dysfunctional.
UPDATE: I had to add some of my favorite quotes from the movie. I don’t think any of them are spoilers:
- Gust Avrakotos: Can we just take a moment to reflect on all of the ways that you are a douche bag?
- Charlie Wilson: You know you’ve reached rock bottom when you’re told you have character flaws by a man who hanged his predecessor in a military coup.
- Joanne Herring: Why is Congress saying one thing and doing nothing?
Charlie Wilson: Well, tradition mostly.
- Charlie’s Angel #4: The Congressman has never been to rehab. They don’t serve whiskey at rehab.
- Charlie Wilson: You’re no James Bond.
Gust Avrakotos: You’re no Thomas Jefferson, either. Let’s call it even.
- Charlie Wilson: All my constituents really care about are their guns and low taxes. That means I get to vote yes a lot.
Yay! VA "Gun show loophole" bill goes down in flames
Thanks in no small part to the tireless efforts of the VCDL, Senator Marsh’s bill to close the freedom loophole failed to muster enough committee votes to go to the full Senate. The House bill has been defeated already. Timmy Kaine and friends will have to find some other way to abridge the freedoms of law-abiding Virginians (or at least wait until next year to try again).
Article describing the carnage here
As usual, my state Senator, Janet Howell, was on the wrong side of this issue. Fortunately for us law-abiding gun owners, Howell’s on the losing side as often as she’s on the wrong side!
"Allowing retailers to make money off of sick people is wrong."
Last week I got my annual influenza vaccine, as I have done for years. This year was different, though, in one significant way: the process was painless.
In past years, consistent with American medical orthodoxy, I made an appointment with my physician’s office (usually for around 3:45 AM), showed up ten minutes early, filled out some paperwork, waited at least thirty minutes past my appointment time, then was summoned into a room by the intern of the nurse’s assistant’s secretary, where I waited some more and was eventually administered the injection (or, in one year, the mist, because the Medical Community decided to ration the injection for old people, and ended up destroying thousands of unused doses). My insurance usually didn’t cover shots, so I then paid my $70 and left. The whole process usually took about two hours or so, taken out of the life of a highly productive member of society.
This year, however, I learned that my neighborhood Safeway was offering flu shots at the pharmacy on a walk-in basis on certain days and times throughout the flu season. After work I stopped by Safeway at around 8:30 PM, walked back to the pharmacy counter, asked for the flu shot, presented my $30, waited approximately two minutes, was given the shot, and left. Total time saved: one hour, fifty minutes. Total money saved: $40. Never setting foot in the godforsaken doctor’s office: priceless.
I’ve recently read that WalMart is trying to extend this awesome model to in-store limited-care clinics providing basic healthcare for the 80% cases, leaving the remaining 20% (cancer, Black Plague, etc) to The Physicians. CVS is getting in on the act too, and in Boston at least, is meeting some resistance from the perpetually-outraged mayor, Thomas Menino. Menino doesn’t write for The Onion, but as you will see, he should:
Limited service medical clinics run by merchants in for-profit corporations will seriously compromise quality of care and hygiene. Allowing retailers to make money off of sick people is wrong.
Try replacing ‘limited service medical clinics’ and ‘retailers’ with the word ‘hospitals’, which reflects the current status quo, and see if the absurdity of that statement becomes clear. There are plenty of private hospitals in Massachusetts, many in Boston, and yet Menino doesn’t seem the slightest bit concerned that these captors of the means of healthcare production are making money off of sick people. So what’s the difference? My guess is medical orthodoxy and a hefty financial stake in Old Economy healthcare.
Sadly, Menino isn’t alone in his distaste for capitalist solutions to healthcare problems. Much like environmentalists who are convinced that increased carbon emissions will destroy life as we know it and yet insist that nuclear power is not an acceptable solution, the medical establishment is very threatened by the potential availability of basic healthcare on a walk-in basis with–gasp–little or no supervision by our last remaining priestly class, The Medical Doctors. It appears the battle lines are being drawn:
It looks like full-scale war is on the way. Arguing that they could endanger patients, particularly children, some attendees at the AMA’s annual conference are demanding the group ask for a ban on retail clinics. Unless the AMA intervenes, “in five years, the chairs [at the AMA] meeting will be filled with representatives from Walgreens, Wal-Mart” and other retailers, one physician told the assembly. At minimum, speakers told the AMA assembly, the group should demand states and the federal government push for retail clinic regulations. If this talk is any indication, the AMA may soon be throwing its tremendous lobbying muscle behind retail clinic-related regulation. The thing is, when it comes to retail clinics the AMA isn’t the only one with clout. (I don’t think Wal-Mart, which plans to add 2,000 retail clinics to its stores in coming years, is going to take AMA opposition lying down.) On the other hand, physicians’ concerns–both competitive and clinical–aren’t going to go away, either. It will be interesting to see which side gives up ground first.
There you have it. The organization that represents The Medical Doctors is worried that this latest bit of capitalist foolishness will endanger patients, especially children. You care about children, don’t you? We need to ban these clinics, or at least regulate them so they suck as much as doctor’s offices. Otherwise, God and The Medical Doctors only know what will become of our precious children.
In all honesty, I don’t blame Big Medicine for being spooked. They have a pretty sweet deal, and this democratization of healthcare is the first real threat they’ve faced in my lifetime. After my experience at Safeway, I will do everything I can to get what little medical care I need from a walk-in clinic at CVS or WalMart. I don’t get sick enough to warrant medical attention very often, but even for me that decision represents a loss of at least a few hundred dollars of revenue for my doctor’s office. Multiply that out by a few million, then add in the much higher profit margins for parents of sick kids and the chronically ill, and you can see what all the fuss is about. What, you thought your friendly neighborhood medical practice was taking money from sick people for the good of mankind?
What’s shameful here is the extent to which Big Medicine is willing to go to preserve their monopoly. They go on and on about skyrocketing healthcare costs (btw, remind me again what determines how much you pay for healthcare? It can’t all be the evil drug companies’ fault…), lack of health insurance, and the suffering of the poor and the young, insisting the only solution is government-run (or at least government-funded) healthcare and its associated rationing and mediocrity, then turn around and do all they can to vilify the first real private-sector solution to rising healthcare costs to ever come to market. Not content with abusing their bizarrely religious hold over the American psyche, Big Med invokes the tired “for the children” rhetoric to undermine a capitalist effort to make it easier for children and their parents to get basic medical care cheaply and without taking a ton of time off of work. For shame.
For now, at least, the good news is you can decide for yourself. There are doctor’s offices aplenty, emergency rooms, the occasional free clinic, and walk-in clinics at WalMarts and CVSs around the country. Maybe your runny nose really is different. Maybe it’s serious enough that only A Doctor can tell you to go home and drink lots of fluids. Maybe the attention of your physician really is better spent swabbing your mouth for a strep. culture rather than caring for a patient with a truly serious medical condition. I’m pretty sure nothing I have is that serious, and God willing I’ll never need the unique talents of a Medical Doctor. Until I do, I’m sure as hell not going to hang around in a disease-incubating waiting room and fork over hundreds of dollars when I can walk in and out of CVS for a third of the price.
Citi Merchant Services and First Data Corp In the Law Enforcement Business
The online gun community is abuzz over the revelation that credit card transaction processor Citi Merchant Services will no longer process transactions for between firearms licensees, dealers, and manufacturers. If this were simply an overt act of gun hating (“we don’t want to facilitate civilian possession of deadly weapons” or some such) I’d shrug it off and make a note to never patronize Citi organizations. But it’s not. Here’s the reasoning:
We discussed with Mr. Crawford said termination due to the sale of firearms in a non-face-to-face environment. Keep in mind that a violation of the Gun Control Act occurs when a gun offered online is sold to an individual in another State; the act prohibits selling a handgun to a resident of another state. Shipping across state lines is also banned, yet guns for sale online reach people across the country. We at Citi Merchant Services are unable to monitor or track adherence to these Gun Control laws.
(Excerpted from scanned letter to CDNN here)
So, the argument is that selling guns online in which the seller and buyer are located in different states is a violation of the Gun Control Act of ’68 (which requires all interstate firearms transactions to go through a federally licensed firearms dealer in the buyer’s state), and since Citi can’t be sure its gun industry customers aren’t violating Federal law, it won’t process transactions anymore.
The first order absurdity of this claim is that established, licensed firearms dealers would sell guns online to buyers in other states and do so in violation of Federal law. The ATF is notorious for harassing and abusing gun dealers for minor paperwork errors, and I’ve never met a firearms dealer who wasn’t extremely preoccupied with dotting all the i’s and crossing the t’s. If anyone was making a practice of selling guns across state lines, online or off, in person or through the mail, that person is a fool and will eventually come to the attention of the ATF. If that person is a firearms dealer, distributor, or manufacturer, and is using credit cards to perform the illegal transactions, that person is demonstrably unfit to stand trial for reason of mental disease or defect.
Having said that, would it surprise you to learn that I have purchased a gun online? Yes, it’s true. There’s a seething den of scum and villany called GunBroker, where anyone (even CHILDREN!!) can go online, browse a huge selection of guns, and with a few clicks, order the gun of his choosing, no questions asked! Well, almost no questions. Except, “what’s the address of the federally-licensed firearms dealer in your state where we’ll ship the gun, and who will run a state and federal background check on you to verify you’re not prohibited from owning guns, and to make a record of the transaction for future use tracing the gun if it’s used in a crime, or confiscating it if they’re banned?”. Doh!
I could’ve lied and specified my own address though! Aha! They won’t know if I’m licensed or not! But wait! I have to fax a signed copy of my firearms license before they’ll ship? No problem, I’ll just print something up in Word. But…they’ll enter the license number in the ATF website set up for verifying firearms licenses, and know that mine is bogus. Hmm. It’s almost as though there’s no difference between buying a gun at a dealer and ordering one online…
But there’s a second-order absurdity here. Let’s assume for the sake of argument that there is a plague upon this country, a plague of black-market gun runners and corrupt firearms dealers, selling guns across state lines through the mail via a web site, with nothing more than an address and a credit card. Thousands of instances of federal firearms law violations each day, amounting to centuries upon centuries of mandatory federal prison time. And all of these transactions are running through merchant accounts with Citi Merchant Services. What, then, is the ‘risk’ posed to Citi, which they claim to be ‘managing’ by refusing to process these transactions?
As far as I know, there is no criminal or civil liability accrued to Citi, unless of course employees or agents of the company were complicit in the activities. Does Citi decline to process transactions for porn sites, legal brothels, legal medical marijuana dispensaries, adult book stores, strip clubs, abortion clinics, bars, or tobacco shops? What if a porn site lets a child view its content, or a brothel serves a minor, or a marijuana dispensary violates federal drug laws, or an adult book store sells offensive merchandise, or a strip club offends the community, or an abortion clinic performs abortions, or a bar serves a drunk driver, or a tobacco shop contributes to lung cancer? Each of these seem more likely than federal firearms licensees blatantly violating the law and using credit card transactions to do it, yet I doubt Citi has a problem with these clients.
What’s the difference? Why are some potentially law-breaking clients OK and others not, especially if Citi’s liability is zero in all cases? My guess, and the guess of the rest of the gun community, is good ol’ fashioned gun hating, wrapped up in some seriously strained legal reasoning and corporate Newspeak. It’s certainly the prerogative of Citi management to refuse to serve its customers based on a distaste for the business they’re in, and I would hate to live in a world where governments could force Citi’s managers to act against their conscience, but for hiding their decision in a thin veneer of legalistic reasoning, I call bullshit.
"From My Cold, Dead Hands", nmap edition
Last summer I wrote about the German ban on hacking tools and how similar (and similarly stupid) it was to gun bans.
Now comes news the UK are criminalizing hacking tools. Frankly, I’m amazed it took them so long; I’ve come to expect British leadership in the field of subjugation and benign tyranny.
Anyway, the writing is on the wall for the Internet. All the starry-eyed visionaries of the early- and mid-nineties (myself included), looking eagerly forward to a world in cyberspace free of government meddling, censorship, and ignorant laws, where information was free and plentiful, very clearly underestimated the will and ability of governments to seek out and eliminate ‘harmful’ freedoms (for a painful look back at our naive idealism, read the Hacker Manifesto).
The party’s over now. China and the Arab nations are censoring the shit out of the ‘net, Australia isn’t far behind, we have the DMCA in the States, bans on hacking tools in Germany and the UK, prison time for failure to disclose encryption keys to British police, and honestly, how long until a ban on crypto and censorship circumvention tools? You think all the regulation of ‘hate speech’ in Canada, the EU, and the UN, won’t require extensive control over Internet traffic to enforce? What about ‘child pornography’ and ‘terrorism’? Or ‘campaign finance reform’? In the 21st century, governments and powerful groups continue to fight to control speech and behaviors they dislike; the difference is, we have the Internet now, which makes the Internet a huge target.
It’s clearly past time for some serious work on real Internet privacy and anti-censorship tools, against both government intrusions and corporate IT dictators. Sure, there are projects like Freenet and Tor and Psiphon, all exploring various solutions to the problem of anonymous/private communication, but there’s a problem: none of them are particularly subtle about it, which means once any of them reaches critical mass, the censorious regimes of the world, and the software companies that enable their censorship, will block the services at best, or track and punish the services’ users at worst.
What I would like to see from the community is a suite of tools for anonymous, secure, and hidden communication channels, over both the public IP networks and private, ac-hoc point-to-point links. Tools utilizing covert channels, traffic analysis countermeasures, and run-of-the-mill SSL to hide secure traffic in otherwise-innocent traffic.
I’m not sure why this isn’t an issue receiving more attention from the technology community. Perhaps government oversight of the Internet isn’t bad enough yet. Perhaps work is being done under the radar in small groups running private darknets. Perhaps there are projects operating in the open that I just don’t know about yet. But something needs to be done, before it’s too late.
More on SMS Chat
After I posted about my proof of concept SMS chat idea, I started thinking about integrating with the phone’s address book to automatically alias phone numbers to names, and then I remembered that BitPim was able to pull out the complete phonebook from my K1M.
I started poking around, and BitPim is an open-source app written in Python, plus is supports a protocol log which dumps all commands send to and received from a phone, which makes it really handy for reverse-engineering phone protocols.
What’s more, since there’s a Python impl for OS2008, if I write the SMS chat app in Python, I can use the BitPim code as my comms layer (albeit with the damnable GPL license terms). Sweet.
Proof of Concept: Bluetooth SMS Chat
As soon as I got my Nokia N810 Internet Tablet, I set up the WLAN and configured the built-in chat application to use my Google Apps for Domains GTalk accounts. Chatting on the slide-out keyboard from the comfort of a TV chair or couch was immediately sweet, and the automatic conversation archiving still allows me to go back and look at transcripts.
The problem is this doesn’t work when I’m out of range of an access point. Sure, I spend the bulk of my life within range of my home and office access points, but sometimes I’m traveling or out and about. I could of course use my Motorola K1M as a teathered EVDO device, but I’m not willing to pay VZW $60/mo for the privilege, nor am I willing to fraudulently use the EVDO without paying for it by manually modifying the Mobile IP profile. So, where does that leave me?
There’s only one phone service I can use without limit, and that’s SMS messaging. As it happens, the main app I want to use on the move is…chatting! So why can’t I use the N810 chat functionality with my K1M phone to chat via SMS? Indeed.
With the idea in mind, I set about looking for software to do what I want. I found gnokii, which supposedly supported all the necessary SMS functions (list, send, receive, register for receive notifications), but I couldn’t get it to run on the N810′s OS2008 to save my life. A few other SMS toolkits like SMSlib and Gammu weren’t any better.
Next I figured I could write something myself, at least as a proof of concept. So I started inquiring as to how one does SMS over Bluetooth. After much googling and gnashing of teeth, I determined that, in most cases, one connects to the phone over a serial link (USB, Bluetooth, or RS-232; the physical details don’t matter), and sends–get this–AT commands.
Unless you’re at least my age, you don’t know what AT commands are. Back in the dark ages, before broadband, we used devices called ‘modems’ to connect to other computers over regular phone lines. Modems were God-forsaken devices trying in vain to link the 1950s phone technology to the coming 21st century. One controlled a modem by sending ‘AT’ commands, so-called because each command began with ‘AT’. For example, ‘ATDT’ means ‘dial with DTMF’, ‘ATH’ means ‘hangup’, etc. Apparently, some European cell phone back in the 80′s used AT commands for its automation interface, and everyone ever sense has gone the same way.
Once I realized I was dealing with the AT commandset, I still needed to figure out what AT commands I needed. To start with, I took a guess that the COM port that appears on my laptop when I plug my K1M into the USB port (only because I installed the Motorola USB drivers; don’t expect shit like this to be plug-and-play) is the serial link suitable for using AT commands. To test the theory I plugged in my phone, fired up HyperTerminal, configured it to connect to the raw serial port used by my phone, and typed ‘ATZ’, which resets the state of the AT command processor. Lo! and behold, I got the ‘OK’ response back, confirming I was talking to an AT-aware device.
Once I had that working, it was time to figure out what exact AT commands to use. By chance I ran across gammu, a bit of Czech open source that supposedly exposes most of the data functions of different types of phones, in the form of a command line. After some fucking about I came up with a gammurc file that worked with my phone, gave it the COM port I found earlier, and had it do some commands like listing folders and such. The cool think about Gammu is it can generate a logfile of all the stuff it sends to and receives from the COM port, which is a great way for me to figure out what commands do what.
I was able to do a gammu text getsmsfolders successfully, but then I did gammu text getsms 1 1 and was nailed with Function not implemented. Help required.. Doh!
Getting desperate, I went to the Motorola developer’s site. I poked around their tech docs, and stumbled across a PDF document called “G24 AT Commands Developer Guide”. The G24 is a cellular card for use embedding cellular technology into electronic devices, but my hope was Motorola developers don’t reinvent the wheel (especially the AT commandset wheel) with every cellular device, and thus that the AT commands for the G24 resemble those for the K1M.
I skimmed the document, testing out various commands in HyperTerm. Some of them worked on my K1M, and others didn’t, then I got to the ‘SMS’ section of the document and hit paydirt. The document walked through the whole process of listing messages, choosing folders, writing messages, sending them, and deleting them. Yes!
You can get the details for yourself by downloading the G24 AT guide (motodev accounts are free), but here’s a sample (note this is a transcript from my test session; not all the commands are relevant to sending SMS):
AT+MODE=2
OK
+MBAN: Copyright 2000-2004 Motorola, Inc.
AT+CGMI
+CGMI: “Motorola CE, Copyright 2000″
OK
AT+CGMM
+CGMM: “CDMA800″,”CDMA1900″,”MODEL=K1mm”
OK
AT+CGMR
+CGMR: “24.0_00.26.0F”
AT+CPBS=?
+CPBS: (“ME”,”MT”,”ON”,”DC”,”MC”,”RC”,”AD”,”QD”)
OK
AT+CPMS=?
+CPMS: (“MT”,”IM”,”OM”,”DM”),(“OM”,”DM”),(“IM”)
OK
AT+CPMS=”IM”
+CPMS: 0,179
OK
AT+CMGF=1
OK
AT+CMGL=”ALL”
OK
AT+CPMS=”MT”
+CPMS: 4,179
AT+CMGW=”xxxxxxxxxx” <—– This is the destination number for the SMS
Fear is the mind killer <—– This is the text of the message, terminated by a Control-Z character
+CMGW: 121
OK
Pretty sweet! There’s also docs for call control, changing the character set, and GPRS stuff.
So, I had the basic AT commands needed to list, read, and send SMS messages. That’s great, but I was only able to do it with a USB connection to the phone, on a Windows machine with special Motorola drivers. I want it over Bluetooth, on my N810.
As a first step, I thought I’d try Bluetooth under Linux, which is basically what the N810 environment is. So I fired up thorby, my Ubuntu Feisty VM, and plugged in my Linksys USBBT100 USB Bluetooth adapter. Linux detected it right away, and I paired it with my phone in the usual way. Using these instructions, I setup a /etc/bluetooth/rmcomm.conf file mapping the DUN profile of my phone to /dev/rfcomm0. Since my phone doesn’t support the Bluetooth Serial Port Profile (SPP), I figured the only other profile that might allow me to issue AT commands is Dial-up networking, since after all it is semantically a dial-up modem device.
Once I had /dev/rfcomm0 mapped, I installed gtkterm, which is a GTK+ terminal program along the lines of HyperTerm. I pointed it at /dev/rfcomm0, 115200 bps, 8-N-1, and issued ATZ. Once again, I got back OK, and I was in!
I then issued more or less the same commands as above, and was able to send another SMS message, this time over Bluetooth!
So, at this point I now know that I can, in theory, use my N810 as a sort of SMS client via a Bluetooth connection to my K1M. I only today got the Maemo 4.0 development environment working, so I’m a bit behind the curve on building apps for the N810, but my first instinct is to try to get gnokii working, since it already has a bunch of shit in it to support a wide range of phones, and there’s really no reason to reinvent the wheel. However, if gnokii gives me any pushback, I’ll just roll my own and worry about supporting other phones if my prototype works to my satisfaction.
I must say, this little N810 has been just the thing to get me back to hacking on embedded devices; I forgot how rewarding it can be to slog through a jungle of underdocumented proprietary voodoo, and come out the other side with a neat solution.