Fixing Backupninja: Or how I learned to stop worrying and build from source

I’m tired. So I’m going to make this as short and clear-cut as possible: backupninja is a pretty nice backup program for linux which supports rdiff-backup, rsync, and duplicity. backupninja exists as version 1.0.1 for the latest stable ubuntu and debian packages. There exists a bug in this version of backupninja which disables it from rsyncing. This is a critical bug which disables you from using any host.

Continue reading ↦

Pass-through SSL with HAProxy

As I’ve started to containerize, certain webapps of mine utilize SSL for secure communication. Hence, I usually combine everything the resulting webapp needs to serve the app using SSL, including certificates and keys. HAProxy provides the ability to pass-through SSL via using tcp proxy mode. This is awesome, except you can forget about serving multiple domains/vhosts in this basic configuration. However, SNI to the rescue! From the HAProxy blog, there is indeed a way for HAProxy to inspect the SSL negotiation and find the hostname, sent via the client through SNI:

Continue reading ↦

autofs in docker containers

Today I started writing up a backupninja container for work. This container needs to be able to: Login into some of our prod boxes Store backup data on an NFS share The logical choice for handling the back-end was to use autofs because of its ability to handle mounts that may drop out for whatever reason, and since we really need our storage available, doing a plain mount is just not going to cut it.

Continue reading ↦

Welcome to Ghost: A New Chapter

I’ve decided its time to make life easier. With markdown entering my work environment last year, I’ve become pretty confident that it is as viable a text markup solution as any other formatting solution out there. And of course, the logical choice is Ghost :) Frankly, I love this. It’s simple, elegant, and forward. Right now, a lot of the older posts will look garbled. Unfortunately, formatting of code blocks didn’t carry over well using the Ghost Wordpress plugin.

Continue reading ↦

Disclaimer, Terms, and Privacy

scriptthe.net (hereinafter “weblog,” “blog” or “site”) is meant to be an open place, offered free of charge, which furthers the learning experience of all interested parties. Mario Loria (hereinafter “me,” “my,” “I” or “owner”) hopes you understand that by continuing to use this blog after the effective date of January 1st, 2015, you agree to be bound by the revised terms documented below. Information The information in this weblog is provided “AS IS” with no warranties, and confers no rights.

Continue reading ↦

Command Redirection >&-

Bet you don’t know what >&- does? According to Jeff @ stackoverflow: /your/first/command >&- 2>&- Be careful to note the order: >&- closes stdout, which is what you want to do; &>- redirects stdout and stderr to a file named - (hyphen), which is not what what you want to do. It’ll look the same at first, but the latter creates a stray file in your working directory. It’s easy to remember: >&2 redirects stdout to descriptor 2 (stderr), >&3 redirects stdout to descriptor 3, and >&- redirects stdout to a dead end (i.

Continue reading ↦

Difference between ENTRYPOINT and CMD in Dockerfiles

A lot of people don’t get the difference to this and I think creack over at stackoverflow did a great job explaining this: Docker has a default entrypoint which is /bin/sh -c but does not have a default command. The command is run via the entrypoint. i.e., the actual thing that gets executed is /bin/sh -c bash. This allowed docker to implement RUN quickly by relying on the shell’s parser.

Continue reading ↦

Customizing your zsh prompt via themes

This post intends to give a great start to customizing your prompt, that thing you’re looking at all day whilst cruising the depths of linux ;P If you use oh-my-zsh or any one of the other frameworks, it’s quite easy to not care and just chose one of the provided themes. Below I’ll talk about some cool projects and sources of content for managing themes in your prompt. Antigen It’s even easier to dynamically switch themes using antigen, an open-source project which manages grabbing plugins and themes from github.

Continue reading ↦

Easily add aliases on the fly

Recently, I’ve done a lot of work on my dotfiles. One thing that always bothers me is the sheer amount of aliases I have laying around everywhere. Kinda frustrating. Additionally, I have a set of scripts I in my env which I’d really like to automatically set aliases to easily. A commonly accepted idea is to separate all your aliases out into something like an .aliasrc file. This is definitely very helpful.

Continue reading ↦

Changing your iTerm2 window title

For zsh, I decided I wanted to simply add a line to my zshrc file to set the window title for iTerm2 to $(hostname) of the box I was currently logged in to: echo -ne "\e]1;${(hostname)}\a" Yes, its that easy:) Looking a little further into the superuser question. it appears theres another way that works for both bash and zsh and, by the author’s note: This way you can immediately see what host you’re connected to in what window, and the window title for each tab shows user & CWD.

Continue reading ↦