More NFA Fun Data by state

Inspired by this post, NFA Fun Data by state, and feeling that Utah was underrepresented, I crunched some per-capita numbers using the census estimated populations for 2014. Here are the top states for each section (per 10,000 people):

Top state for Machine Guns: Connecticut at 74 per 10k people
Top state for Silencers: Utah at 171 per 10k people
Top state for Destructive Devices: Wyoming at 2,022 per 10k people (D.C. is #2 at 583)
Top state for Short Barreled Rifle: New Hampshire at 21 per 10k people
Top state for Short Barreled Shotguns: Alaska at 16.9 per 10k people (D.C. a close 2nd place at 16.6)
Top state for Any Other Weapons: Wyoming at 5 per 10k people
Top state for FFLs: Wyoming at 15.3 per 10k people (Montana a close 2nd place at 15.2)

20151031_110945Utah made the list!
I must admit that I was initially surprised to see D.C near the top of the lists, but I suspect that it is due to Law Enforcement Agencies. It is interesting to note that D.C. only has 25 FFLs. Also, I have no idea why there are so many destructive devices per person in Wyoming.

Original data source ATF’s Firearms commerce in the USA
My formatted data is here and here

Run a shell script with setuid

Linux has protections in place to prevent you from running shell scripts with root permissions that have the setuid bit set.
But there’s a way to work around that. (yay! but also be careful!)
You’ll need to create a binary with setuid on it…. Here’s how to create the binary:

Create the your C file (somefile.c)

#include 
#include 
#include 
#include 
int main()
{
   setuid( 0 );
   system( "/yourpath/to/yourscript.bash" );
   return 0;
}

Compile it:
gcc somefile.c -o somefile

Set permissions on it:
chown root:root somefile
chmod 4755 somefile

Error/Fix: Error: Invalid Private Key with Amazon ELB

When setting up an Amazon Elastic Load Balancer (ELB) with SSL:

Error: “Error: Invalid Private Key” when attempting to upload your keyfile to Amazon EC2

Fix:

Convert the key to a format that ELB likes with the command:

openssl rsa -in somekeyfile.key -outform PEM

edit: I got this message today “Error: Unable to parse certificate.” when I was adding a new SSL certificate for a loadbalancer. It turned out to be my key. The command above fixed it.

AWS customer service

I must admit I’m a bit surprised. This morning, I tweeted about a DNS issues I was seeing on some EC2 instances (which turned out to be a Godaddy problem)
Amazon responded to my tweet by opening up a support case:
Hello,
I am sorry to hear that you are having issues with DNS Services, Can you please let us know what issues you are seeing so we can resolve this for you.
Best regards,
Amazon Web Services

I must admit, I’m surprised and impressed. Good job AWS!

Raspberry Pi case made from cardboard, cardstock, paper or plastic

A few months ago I designed a case for my Raspberry Pi that I could cut out of cardstock with a Silhouette Cameo.

img_3670

(this case is cut out of an overhead projector slide)

It was inspired by the Punnet case.  Except I wanted something that didn’t require glue to assemble and was a little more compact.

img_3664

Punnet case (bottom), rev1 (middle), current design (top)

The Silhouette file is downloadable from my raspberry-pi-case github project.

pi-layout

I’d like to change the vent in the top to be a raspberry, but haven’t had the time to make that change yet.