rem

.co

Git: Moving a Repository to a New Server

| Comments

The quick, easy and complete way:

  1. Clone the repo you want to move or skip this step if you already have one set up:

     git clone git@oldreposerver:repo/name <insert dir>
     cd <insert dir>
    
  2. Make sure your repo has all the latest news from its current origin:

     git fetch --all 
    
  3. Add the new origin as a temporary remote whilst keeping the old one for now:

Fixing ‘Error Opening Terminal: Screen-256color.’

| Comments

If you’re using tmux or screen as a wrapper for your terminal sessions (such as when using the Text Triumvirate), chances are that you are presented with the following error when you invoke a command that uses 256 color mode (such as multitail or htop):

Error opening terminal: screen-256color.

I don’t know if this is the recommended solution, but it’s a pretty quick fix and seems to work on multiple distributions:

1
2
cd /usr/share/terminfo/
cp x/xterm-256color s/screen-256color

OnApp: Using PHP to Launch a VNC Connection

| Comments

If you’re an OnApp user you probably know you can make a VNC connection to your VM’s using the Control Panel. This uses a java applet in your browser as the VNC client.

Wouldn’t it be nice to use your own VNC client (like Remotix) instead?

In fact, you can, but OnApp spawns a VNC server on a (somewhat) random port and a new random VNC password for each sessions which you’ll have to figure out before setting up your connection.

According to the OnApp Helpdesk you can use these calls to get the required information:

1
2
GET /virtual_machines/:virtual_machine_id/console.xml
GET /virtual_machines/:virtual_machine_id/console.json

As I’m lazy I didn’t want to do this manually every time, so I devised a little PHP script that can aid in finding the right information:

SELinux: Allowing SSH Public Key Authentication

| Comments

The issue

I experienced a seemingly weird issue with a freshly installed CentOS server today.

SSH Public key authentication was correctly set up; The sshd_config was properly configured and a ~/.ssh/authorized_keys was present with the correct rights and verified correct contents (as the file was yanked from another, working, server with scp).

All attempts to connect to the machine using key authentication silently failed however.

Ubuntu: Automatically Selecting a Fast Mirror

| Comments

Letting Ubuntu pick the apt-get mirror closest to you is pretty easy.

Just add these mirror directives to the top of /etc/apt/sources.list and you’re good to go:

1
2
3
4
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

Munin: Failing With Storable Error

| Comments

I suffered from a Munin version 2.0.10 installation that refused to update the majority of the graphs. Only the first two of a long list were being updated, the rest all ‘hung’ at the same moment.

After a little investigating, the problem surfaced:

1
2
3
$ su - munin --shell=/bin/bash munin-cron
File is not a perl storable at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/fd_retrieve.al) line 398, at /usr/lib64/perl5/vendor_perl/5.12.4/Munin/Master/Utils.pm line 362
File is not a perl storable at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/fd_retrieve.al) line 398, at /usr/lib64/perl5/vendor_perl/5.12.4/Munin/Master/Utils.pm line 362