Tag Archives: Linux

Use Vagrant to Manage an OEL6 Virtual Machine

Vagrant is a tool that you can use to set up, configure, and access a VM through the command line. This is a life changer. I love it. In this post I’ll walk through setting up an OEL6 virtual machine, installing a non-ancient version of Python, and configuring the port forwarding so that you can use it for backend web development. (The port forwarding is not obvious on RHEL/OEL.)

Continue reading

Handle EADDRINUSE Error in Node

When a node application crashes unexpectedly, you might get a EADDRINUSE, Address already in use error when you try to restart it. This means that the port you’re using is already being used by the crashed application. What you need to do is fun the PID of that process, and then kill it. There’s more than one way to skin that cat, but I like to use netstat. N.B. You’ll need to run this as sudo for it to work.

Continue reading

Using tmux

I found this great tutorial on tmux by Daniel Miessler that was designed to take you from “wtf tmux” to “omg tmux” with extreme haste. I’m reproducing parts of that blog post here because I find myself googling it at least three times a day. (Because it’s that useful.) Briefly, tmux is a utility that allows you to connect to a remote server, start a job, and then log off without quitting your job. When you log back in from another location, you can access that job again through tmux. The screen utility also does this, but not as well. For instance, if you have a really long username, then you might not be able to start screen, because edge cases.

Continue reading

Two Quick Nim Scripts

Today I Googled something like “julia lang compiled” for the umpteenth time in several months, and then I remembered that Nimrod existed, except it’s Nim these days, and it might make it to version 1.0 any week now. I decided to look around a bit, and I discovered that the documentation seems to have improved, and the language has gotten more fleshed out. I decided to try two small things I’ve been doing a lot of lately, SSH-ing and HTTP-getting and posting, and see what they look like in Nim.

Continue reading

Making and Changing into a Directory

This function, added to your shell profile, will allow you to create directories and cd into them in one fell swoop, without you having to type mkdir, and then cd ALL DAY. After looking around online, I like the name mkcd for this utility, because md makes me think of markdown.

For some reason, I couldn’t get this to work as a one-liner in my .zshrc file, but the listing below worked fine.

function mkcd () {
  mkdir -p $1
  cd $1

Note that the -p flag allows you to create a directory several directories deep at one go, without having to descend into them one at a time.