Alpha Hydrae

Coding on the edge of the web...

PostgreSQL With Peer Authentication

PostgreSQL has always been my favorite SQL database, especially compared to MySQL which I’ve always found a pain to configure for my uses. Peer authentication allows to map OS user names to database user names for local connections. It can be used for password-less database access in a multi-user environment.

This guide shows how to install PostgreSQL and configure peer authentication on Fedora.

Summoning Is Complete

I’m a lazy developer and an even lazier sysadmin. This is my history search function.

1
2
3
4
5
6
7
8
9
summon () {
  if (( $# >= 1 )); then
    history 0|grep -e "$*"
  else
    history 0
  fi
}

alias smn="summon"

smn gets you the whole history; smn curl finds all curl commands.

Git: How to Commit Often and Still Push

I usually like to rewrite my commit history since I commit a lot. It makes it look more organized. But I also want to push my “dirty commits” to a server so I don’t have to worry about my laptop burning; it’s a cheap backup.

Git doesn’t normally let you rebase commits that have already been pushed. It’s because rewriting a public branch is nothing but a good way to make enemies. But I still want to do both: push for backup and then rewrite history.

Set Up Your Own Git Server

In addition to GitHub, I like having a private copy of my repositories on one of my own servers. It serves both as a secondary backup, and also to play with pushed commits as I’ll explain in a future post. The idea is to set up a server that can be accessed through SSH in the same way as GitHub, with a remote that looks like git@myserver.com:myrepo.git, and with public key authentication.

Testing With Capybara, Selenium and RSpec

This is a quick-and-dirty tutorial to set up automated browser tests with the following tools:

  • RSpec is a Ruby behavior-driven development framework.
  • Capybara is an acceptance test framework that simulates how a real user would interact with your web app.
  • Selenium Webdriver automates browsers like Firefox.

Since browser tests are generally isolated from the rest of your project, the language of the web app is irrelevant. I wrote this guide after setting up a test suite for a Node.js web app.

Logwatch: How to Add a Service

I use logwatch to monitor disk usage and the everyday break-in attempts on my Fedora and Ubuntu servers. It sends me a daily report by mail. Since I also received separate mails from by backup scripts, I wanted to see if I could include everything into the logwatch report so that I would only have one mail to read per server.

It’s Alive!

A marker for the first post in the old Wordpress blog, for old time’s sake.