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’:
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…
Then underneath the entry for ‘root’ just add in an entry with the desired user name:
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:

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.
This is good news!
>The BBC has created a version of the iPlayer that works with both Mac and Linux computers.
>The two systems, which have been able to stream BBC programmes via the iPlayer for a year, will now be able to handle downloads.
>The BBC, working with Adobe, has developed the new version, known as BBC iPlayer Desktop.
Head on over to the labs to check it out.
via BBC News
(1)
Finally…
>”As recently as 2007, Linux users waited six months for Flash 9 to arrive. Now, with Microsoft pushing its Silverlight alternative, Adobe is touting the universality of its Flash format, which has penetrated ‘98 percent of Internet-enabled desktops,’ it claims. And, it today released Flash 10 for Linux concurrently with other platforms. Welcome to the future.”
via
(0)
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)
It’s got friggin’ Unity for Linux!!! This looks good…
>The VMWare team has just released the second beta for VMWare Fusion 2.0, the company’s popular virtualization program for the Mac.
>The new beta adds a TON of new features, as the video above demonstrates. I got a chance to talk to VMWare today about the new beta and it is HOT. I’ll be posting a more in-depth overview tomorrow, but until then, here are some of the highlights:
>* __Unity 2.0__ - The newest version of Fusion is really focused on better Windows-Mac integration. You can now launch Windows programs from the dock or access Mac programs from within your virtual machine. You can also link folders like Documents, Pictures and Music on your virtual machine with those folders on your Mac.
>* __Multiple Snapshots__ VMWare has worked really hard to bring a Time Machine-like ease to backing up and protecting your virtual machine. You can now designate how often you want to take full system snapshots of your VM, whether once an hour, once a day or once a week, and how many copies you want to keep.
>* __Better Video and Graphics Graphics__ and shading support has been improved for Macs that have higher-end graphics cards, and even integrated Macs can now play 1080p HD video in virtual machines with considerably less CPU overhead.
>* __Support for more client OSs__, including Leopard Server You can now run Leopard Server as a VM in OS X 10.4 and 10.5, even on client machines (virtualizing Mac OS X client is blocked by Apple’s license terms). Support for the latest version of Ubuntu (Hardy Heron) is also available right out of the box with Unity integration. Power users can now designate up to four virtual CPUs per virtual machine, which is great for anyone wanting to take an XServe or Mac Pro to the next level.
>VMWare Fusion 2.0 beta 2 is available for Intel Macs running OS X 10.4 or OS X 10.5. New users can try the beta for free and the upgrade path (including future betas and the full version of Fusion 2.0) is free for all existing Fusion 1.0 customers.
via TUAW
(0)
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’
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!
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.
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)
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)
Recent Comments