Archive for the 'linux' Category

Creating Users on a Linux System

It’s been a while since I’ve had to do any basic sysadmin stuff on a Linux box… seeing as I had to google the answers to this I thought I’d better write them down!

useradd syntax

useradd [options] {username}

Useful options are:

-d
declare the users home directory
-m
force ‘useradd’ to create the home directory
-D
accept the system defaults for account settings

An alternative for ‘useradd’ though is ‘adduser’:

adduser {username}

This will then prompt you for all the information needed to set up the account.

making the user an administrator (with sudo)

As the root user…

visudo

Then underneath the entry for ‘root’ just add in an entry with the desired user name:

{username} ALL=(ALL) ALL

Add Git and SVN Branch to Bash Prompt

I’ve seen things like this posted on the net before but never really had a chance to play with the idea. But as I’m now using git and svn a lot more these days (fingers crossed i’ll be totally free of cvs soon!) I thought it was about time I pulled my finger out.

So here’s the end goal, in a normal directory, we just get a normal bash promt, but in a directory controlled by git or svn, we also get an addition telling us the source control tool in use and the current branch:

git_svn_bash_terminal

So, fire up yer terminal and add the following to your .profile, .bash_profile or .bashrc (whichever one you use):

parse_git_branch () {
	git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git::\1)#'
}
parse_svn_branch() {
	parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk -F / '{print " (svn::"$1 "/" $2 ")"}'
}
parse_svn_url() {
	svn info 2>/dev/null | sed -ne 's#^URL: ##p'
}
parse_svn_repository_root() {
	svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p'
}
 
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
 
export PS1="$BLACK[ \u@$RED\h $GREEN\w$RED_BOLD\$(parse_git_branch)\$(parse_svn_branch)$BLACK ] "

Simples. Now just open up a new terminal and move into a project directory using svn or git. :)

QGtkStyle Now Part of Qt

Looks like KDE apps just got a whole lot more appealing to Gnome users. I like a lot of KDE apps (Kate being a particularly cool editor when I’m on the Linux box), but I just never used to use them much as they looked too out of place with the rest of my Gnome desktop (yeah, I guess I’m a GUI snob…) - this will most likely change that!

>QGtkStyle made it’s way into the Qt snapshots this week, meaning it will become part of the Qt 4.5 release. Technical users can already compile and use it on their own desktop, but once Qt 4.5 is out it will simply replace Cleanlooks as the default application style Qt uses on GNOME desktops.

via

(0)

Install PostgreSQL on Ubuntu 8.04

Following up from my old guide to installing PostgreSQL (for Ubuntu 7.10), I thought i’d better do an update for the latest releases… :)

This quick walk-through are my notes for installing the PostgreSQL database server and the PgAdmin administration application on Ubuntu Linux, and also set up the server so it allows access to other PC’s on your network.

Before we move on, this guide was tested on the current release of Ubuntu Linux, (8.04 - Hardy Heron) and PostgreSQL 8.3, but it should also be applicable to older versions (of Ubuntu and PostgreSQL) and other Debian based distros.

Continue reading ‘Install PostgreSQL on Ubuntu 8.04’

Installing R/BioConductor on Ubuntu 8.04

The new version of Ubuntu is out, (as if you haven’t heard that by now), so that means a fresh install to play about with and working just the way I want! :D

One of the tools that I currently need (for the thesis work) is R and the BioConductor libraries. So here’s a quick run down on getting them up and installed on Hardy…

First up, run these commands in a terminal:

sudo apt-get install build-essential g77 gfortran
sudo apt-get install refblas3 refblas3-dev zlib1g-dev
sudo apt-get install r-base

This will then install the R base packages and some of the BioConductor packages, along with the gcc and fortran compilers and some other libraries that will be required for the next step.

sudo -s
R

Now at the R prompt, type the following…

source(“http://www.bioconductor.org/biocLite.R”)
biocLite()

Now sit back for a few minutes while your system configures BioConductor for you.

Installing VMware Tools on Ubuntu 8.04 (Hardy)

If you’re a VMware user and want to play around with the latest version of Ubuntu in a VM (like me), you’ll need to get the vmware-tools installed. Unfortunately, things are not quite as straight forward as the previous release of Ubuntu yet, but it was a pretty easy thanks to this great guide.

The latest version of Ubuntu (8.04 a.k.a. Ubuntu Hardy - the world’s most popular Linux distribution) came out yesterday on April 24th. I downloaded it right away to play with on VMware Fusion, my Mac virtualization tool of choice (though I’ve now been told this works in VMware Workstation and VMware Player on the PC too!). It worked pretty well out of the box, with even seamless mouse support working right away, but I needed, of course, to install VMware Tools too, as any good VMware user would do. From there, things turned sour, and I was bombarded with error messages …

read more

(0)

Unix Toolbox

Found this via a post on Digg. A very useful read if you want to get some more advanced things done in Unix.

>This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

full article

(0)

Bio-Linux - Bioinformatics Tools for Linux

Bio-Linux is a specialised Linux disro that provides both standard and cutting edge bioinformatics software tools on a Linux base.

I wrote a post on my old blog a little while back now detailing how to use the packages from Bio-Linux in Ubuntu Linux, but it got missed in the migration (sorry to all those who have been searching for it). Here’s a repost and update for Ubuntu 7.10…

Continue reading ‘Bio-Linux - Bioinformatics Tools for Linux’

Stephen Fry on the Eee PC

I really like the Eee PC - some people at work here have them, and if I could get it past the wife, i’d happily have one! ;)

Seems like the well spoken geek Stephen Fry is quite a fan too:

>I am writing this article on a kind of mini John the Baptist, a system that prepares the way of the software saviour whose coming will deliver the 90% of world computer users who suffer under Windows from the expensive, clumsy, costly, ugly, pricey toils of Microsoft.

>The Asus EEE PC perched on my knee combines GNU software with a Linux kernel powered by an Intel Celeron Mobile Processor to produce a very extraordinary little laptop. It weighs less than a kilogram, starts up from cold in about 12 seconds and shuts down in five. It has no internal hard disk and no CD drive. It offers 512MB of RAM, 4GB of storage and a seven-inch display; wireless, dial-out modem and ethernet adaptors are available for networking and internet connections, three USB ports, mini-jack sockets for headphones and microphone, a VGA out, an SD card slot and a built-in webcam. All for about £200 - less than the price of a show, dinner and taxi for two in London’s West End.

read more

(0)

SSH Shared-Key Setup - SSH Logins Without Passwords

SSH is a great tool for remotely accessing another machine, but entering your password every time you log into a remote box can be a pain if you would like to set-up some background scripts to connect to a server and do something (i.e. a backup script running as a cron job). Here’s how I set-up my Mac to be able to log into my server without the need for a password to be entered each time - the instructions should be good for any variant of Unix/Linux, but you need to take into account path names etc. on your machine.

Continue reading ‘SSH Shared-Key Setup - SSH Logins Without Passwords’