Archive for August 4th, 2009

Quick SSH Remote Key Setup For Passwordless Login

No Comments »

Lots of different ways of creating keys and sending them to remote machines so you can login. This is just a quick reference for me and how I do it.

If you haven’t already done so, you need to create keys for your local machine:

ssh-keygen -t dsa

Next, store that key in the remote machine’s authorized_keys file:

cat ~/.ssh/id_dsa.pub | ssh remote-machine 'sh -c "cat - >>~/.ssh/authorized_keys2"'

Now you can just use passwordless login to those machine that you ssh into the most (if it is setup, it is by default for me).


Uninstalling a Python setup.py style project

No Comments »

If you are like me and like to install the newest versions of software and not just settle for the ones available from a package manager, you may have some trouble if you get to a point where you want to uninstall it if that project uses python’s setuptools or disttools for installation.

Using setup.py is wonderful for installing but there is no uninstall option available…pretty sad. I saw that there were options for creating an RPM or Windows installer package from the source but no way to create a .deb for Debian/Ubuntu. So, if you are using an RPM based distro then all you will need is the bdist_rpm command and then install the resulting RPM file.

If you are running Debian or Ubuntu then just do this:

python setup.py bdist_rpm
cd dist
sudo alien -d -c {your_package}.rpm # Make sure you don't use the src RPM
sudo dpkg -i {your_package}.deb

That’s it, now you have installed the package. I haven’t tested this extensively so I don’t know if there are problems because the setup.py file isn’t run with the install parameter so some things may not be configured right, but it should work for the most part.

Also, I have not had much luck with it but you may also want to try out stdeb http://github.com/astraw/stdeb/tree/master