Posts Categorized: Dev Ops

How To Force SSL With Apache

On the Internet, all traffic in the 21st century shall be encrypted. That’s easy to do with Apache. Follow these instructions to force all traffic to the SSL pipe. Rewrite Engine On RewriteCond %{HTTPS} Off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L] Now any request that isn’t on https is redirected to https. This solution is port, host,… Read more »

How to Tell Which Line You’re on with ‘vi’

I don’t use vi enough to be proficient with it. I use it nearly daily, but only in the most basic way possible. Whenever I have to do anything beyond ‘:q,’ ‘:wq,’ or ‘:q!’ I have to google it. I needed to know which line I was on in vi. :=. That tells me which… Read more »

How-To: Git Merge

I create a lot of Git branches. Every change I do is a branch. That means I perform a lot of Git merges. Here’s how I do it. Read about my Git workflow here. Assume there’s a dev branch called ‘Fingerboard’ that I need to merge into ‘master.’ The Fingerboard branch has been committed to… Read more »

The Perfect Git Workflow

I have concocted the world’s most perfect Git workflow. Here it is. Spoiler, it’s actually not perfect, but it works for me. In Git, there’s the concept of a master branch. Master is merely the first branch Git creates. Git might as well called it “Pippy Pee Pee Diarrheastein Poopypants Esquire.” But Git didn’t do… Read more »

Linux Find Directories Consuming The Most Data

If you want to find out which directories on your Linux box that is gobbling up all of your disk space, use this command. du -h <dir> | grep ‘[0-9\.]\+G’ If you want to check the current directory, don’t include a

Create SVN Branch with Copy Command

I create SVN branches all the time. If I get a few tickets to work on, I create a SVN branch and work there. Once the changes are done and tested, I roll the changes into trunk. Here’s how to SVN branch. svn copy https://mysvnrepositoryserver.com/dept/IS/MyProjectNameGoesHere/trunk \ https://mysvnrepositoryserver.com/dept/IS/MyProjectNameGoesHere/branches/NomeOfBranch \ -m “Creating branch for some reason.”

How to Configure Mac Postfix to Use Gmail for SMTP Relay

If you’re like me and you do your development work on a Mac, you’ll want to configure Postfix to send you email messages. It’s pretty easy to do. vi /etc/postfix/main.cf Edit main.cf and add the following to the end of the file. relayhost=smtp.gmail.com:587 smtp_sasl_auth_enable=yes smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd smtp_sasl_security_options=noanonymous smtp_sasl_mechanism_filter=plain smtp_use_tls=yes smtp_tls_security_level=encrypt tls_random_source=dev:/dev/urandom The key one is the… Read more »

How to Install Redis on Ubuntu

If you’re running Ubuntu, there’s a good chance the version of Redis available in the repo is pretty old. Here’s how you can install the latest version of Redis on your Ubuntu or Debian box – these instructions should work on any Linux server. On Debian or Ubuntu, make sure you have the ability to… Read more »

Synch two directories with rsync

If you’ve ever thought, “What’s the easiest why to quickly synch two remote directories?” If I were going to sync up two remote directories I would do this. rsync -avz user@gdemolished.com:~/Maildir/ . If I ran this command in a directory called Maildir.backup, all of the contents of the remote Maildir would be in there. If… Read more »