How to add ICMP Echo Request to AWS Security Group from the CLI

The answer to this question is: you need to use –ip-permissions. There does not seem to be any other way to do it. Here is an example (all one line!):

aws ec2 authorize-security-group-ingress --group-id sg-000000000000000 --ip-permissions IpProtocol=icmp,FromPort='8',ToPort=-1,IpRanges=[{CidrIp=0.0.0.0/0}]

The icmp echo request is designated as type 8, code N/A. It was not obvious that in order to set code=N/A you must set ToPort to -1. Figuring this out took way longer than it should have taken.

Posted in AWS, cli | Comments Off on How to add ICMP Echo Request to AWS Security Group from the CLI

How to fix STOP: 0x0000007B blue screen when moving virtualbox machine to another computer

My old pc died, and so I pulled the hard drive and copied my virtualbox machine disks onto my new computer. Since the new computer used a new version of virtualbox I couldn’t seem to get the old machine images to work without creating new virtual machines and attaching the disks.

Unfortunately, this caused my virtual machines to blue screen with 0x0000007B error.

I found that this can be caused by the wrong type of virtual disk adapter. VirtualBox defaults to SATA. But that isn’t what my old windows XP virtual machine wanted. I switched to IDE and it worked!

Posted in Microsoft, Virtualbox, vmware, windows | Comments Off on How to fix STOP: 0x0000007B blue screen when moving virtualbox machine to another computer

pip is broken with AttributeError: ‘module’ object has no attribute ‘SSL_ST_INIT’

This error is quite frustrating, and it has been occurring to me when I try to move old django sites to a new server. It is frustrating because once this happens, your pip is broken and you can’t do anything with your environment. It happens when there is an old openssl package installed in your site packages and you do a pip install requirements.txt

I found a quick way to fix it though. Simply delete the old openssl package from your site-packages. In my case it was


rm -r -f /Users/me/.virtualenvs/myenv/lib/python2.7/site-packages/OpenSSL/

It may be a little scary, but this has worked for me every time. This immediately fixed my problem and pip was back to normal.

Edit 10/12/2018: This problem can also manifest with this error.

AttributeError: 'module' object has no attribute 'add_metaclass'

The solution is the same.

Posted in Linux, Mac OS X, python, SSL | Comments Off on pip is broken with AttributeError: ‘module’ object has no attribute ‘SSL_ST_INIT’

Generate a certificate request but keep your old key with openssl

Until today, I didn’t know you could do this. I always just did a cert request and generated a new key. Sometimes it is handy to keep your old key, and here is how you do it.


openssl req -new -key yourdomain.com.key -out yourdomain.com.csr

This works well. I used it to change the name of an existing certificate without rekeying it, which made the process simpler.

Posted in Linux, SSL | Comments Off on Generate a certificate request but keep your old key with openssl

OSError: [Errno 1] Operation not permitted: Extras/lib/python/six-1.4.1-py2.7.egg-info’

After upgrading some things using homebrew, this error started coming up on a coworker’s machine when he tried to pip install virtualenvwrapper.

This error was coming up right before the operation not permitted:

Installing collected packages: six
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:

The solution we found was to ignore the installed six version:

pip install virtualenvwrapper --upgrade --ignore-installed six

I’m not sure how, but this did the trick. I learned about the --ignore-installed option here.
https://github.com/pypa/pip/issues/3165

Posted in Mac OS X, python | Comments Off on OSError: [Errno 1] Operation not permitted: Extras/lib/python/six-1.4.1-py2.7.egg-info’