Posted on: September 29th, 2011 Pushing to two git remote origins from one repository

Let’s assume that you are using github for version control of some projects you want to make public. But you also want to push your repository to a second repository, maybe a private one you one on a VPS or something similar – just for backup reasons or in case you want to leave github someday.

This is easily achievable by just adding another remote, pushing to it and creating an alias for convenience. Let’s assume we want to name our secondary origin “backup”:

First create the folder and do an initial pull from github of your own repository:

dan@bart ~ $ mkdir XML-to-text-Tomboy
dan@bart ~ $ cd XML-to-text-Tomboy
dan@bart ~ $ git clone git@github.com:danakim/XML-to-text-Tomboy.git ./

Now let’s add the second remote origin and do an initial push to it:

dan@bart ~/XML-to-text-Tomboy $ git remote add backup user@server:/path/to/git/XML-to-text-Tomboy.git
dan@bart ~/XML-to-text-Tomboy $ git push backup master:master

And finally add an “all” alias for both remotes to make sure it’s easy to push to both of them every time:

dan@bart ~/XML-to-text-Tomboy vi .git/config

Add the following entry:

[remote "all"]
url = git@github.com:danakim/XML-to-text-Tomboy.git
url = user@server:/path/to/git/XML-to-text-Tomboy.git

Now every time you commit you can just run

dan@bart ~/XML-to-text-Tomboy $ git push all

Hope some of you have found this useful!

Posted on: September 20th, 2011 KVM guest not responding to virsh commands

I use KVM (Kernel Virtual Machine) to run tens of virtual machines for a development environment. What makes life easier when it comes to managing all these machines is the “virsh” tool. It’s a script that runs on the host and lets you easily control your VMs: start, shutdown, destroy, change configurations etc.

But recently one of the VMs I was running was not responding to any of the commands I was sending through virsh. I was trying to run “virsh shutdown ” but the guest kept on running. The fix to this problem was quite easy: the ACPI deamon needs to be running on the guest / VM to be able to receive commands from virsh. For some reason that particular guest didn’t have ACPId running or installed. So just use your package manager of choice and install and start ACPI on the guest and everything should be fine!