SSL vs TLS vs STARTTLS - What's what with email encryption?

TLS is a successor to SSL. SSL was developed in 1995 and while dealing with security issues went through 3 versions before someone wrote a similar but new protocol to try to address some of the issues inherent in SSL. This new protocol was TLS. You should be using TLS.…

How to delete whitespace around cursor in Emacs

I often get into a spot where I have a bunch of whitespace and newlines separating a couple of closed parentheses. (defun fib (n) (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2)) ))) Lets assume your cursor is anywhere between the end of line 4 and…

On Common Knowledge of Pi

Eric Ihli 2018 Funding for this study was provided by Ezmonic. AbstractPi is a constant that not only surrounds us but continues to surprise us with unexpected appearances. For all of Pi's ubiquitousness, how much does the average person really know about it? This study aims to shed light on…

Words vs Music and Minimal-loss Encoding for Communication

Robert Greenberg has some amazing lectures on music from The Great Courses. Even if the subject matter (classical music) doesn't interest you, he's an excellent lecturer and his enthusiasm is infectious. Regardless of topic, he's entertaining. Something from the beginning of Lecture 2 of "How to Listen to and Understand…

Python Web Scraping Best Practices

I've been scraping the web a lot as part of my quest to find the best scratch-off lottery ticket. I want to share some of the practices that I've discovered. I'll do so by posting the code itself in a style of "literate programming". (It's actually just heavily commented code.…

Tmux Config

# C-b is "back 1 char" in emacs # Unbind it as the Tmux prefix to not conflict with emacs unbind-key C-b set-option -g prefix C-] # If we change our .tmux.conf and want to reload it quickly bind r source-file ~/.tmux.conf # Use vim movement keys for moving between…

Analyzing California State Scratchers

Let's figure out the expected loss of playing scratchers. California publishes all of the information we need to determine this at their website http://www.calottery.com/play/scratchers-games/top-prizes-remaining From there, for each game, we can see: Price of a ticket Value of each prize Odds of winning each…

Using Graphviz DOT for UML

Graphviz DOT, UML, and VIM Prerequisites Graphviz WM Graphviz Vim Plugin (Optional) Grip Github Markdown Previewer (Optional) Add UML Diagrams to your Github README with Graphviz Install the prereqs. If you would rather use some other editor, you can always compile from the command line with dot -Tpng uml.dot…

Hosting a Node.js process on a non-default port on AWS Elastic Beanstalk

Two things happen that make it difficult to run a Node.js process on a non-default port. First, Elastic Beanstalk uses load balancers. When a request hits your EB DNS (your-app.elasticbeanstalk.com) the load balancer directs the traffic to the least utilized instance (assuming you have multiple ec2 instances…