Brad Lucas

Programming, Clojure and other interests

Cleaning Global Installs With Pip

August 1, 2017

I moved to Python3 and looked back and realized I had a ton of things installed globally for Python2. With this realization I wanted to clean everything out.

Here is one method

$ pip freeze > requirements.txt
$ pip uninstall -y -r requirements.txt

Continue reading →

Get Ip Address Of Ec2 Instance

July 31, 2017

A quick command to figure out what your IP address is.

$ curl checkip.amazonaws.com

Continue reading →

Amazon Linux Ami

July 30, 2017

  • Based on CentOS/Redhat and you can use Redhat/Centos repositories
  • Has better integration and has EC2 management tools pre-installed
  • There may be issues at times due to dependency issues
  • One potential issue is you can't run Amazon Linux outside of EC2
  • Local/developer builds may be on their own RHEL/Centos but there may be slight differences

Continue reading →

Rename Group Of File Extensions In Git

July 29, 2017

For this example, I had a collection of text files with embedded mode lines to setup the mode for org-mode. I wanted to do away with the mode line and rename them from txt files to org files.

Build the GLOB before hand and verify with ls. For example ls *.txt would have the GLOB value in the example replaced with *.txt.

The git mv renames the files.

for i in $(find . -iname "GLOB"); do
    git mv "$i" "$(echo $i | rev | cut -d '.' -f 2- | rev).org";
done

Continue reading →

Upgrade To Java 1.8 On Ec2

July 28, 2017

Update to Java 1.8 on EC2

  • sudo yum install java-1.8.0- sudo yum remove java-1.7.0-openjdk

Continue reading →