I have also found some awesome suggestions for tools for xfce at their wiki.
Table of Contents
- Screen Resolution
- Console Font
- Set line numbers to always appear in vi
- Change command prompt to include colour
- Some additional aliases
- cp with a wget style progress bar
- Lightweight xfce4 gui
- phpMyAdmin for the mysql db
- phpPgAdmin for the PostgreSQL db
- Install Oracle JDK 6
- Webmin
- Screen resolution. This is simply done by editing the /etc/defaults/grub file like so
- Console Font Still trying to find a permanent solution to this - The closest I have come is here but this setting gets lost after a reboot.
- Set line numbers to always appear in vi In you home directory create a file called .vimrc and add the following line to it
- Change command prompt to include colour I use this in case I login as root or if I have su'ed to root so I won't forget who I am running as at the moment. If I am running as root I want my user to appear in bright red otherwise in bright green. I also want the directories to be displayed after the username in dull green and if I am root in dull red.
- Some additional aliases I have some other aliases that I make use of also that I add to the end of my .bashrc file
- cp with a wget style progress bar When I am copying files I like to see the speed and progress of the copy. To do this I create a file in my home dir called cppv which look as follows
- Lightweight xfce4 gui
- Install the Xfce desktop environment (a GUI for using the server) :
- Install the Gnome Display Manager (which includes a GUI login manager) :
- If you find you have some icons missing try this to fix the problem. Also check under
"Applications Menu->Settings->Appearance" under the icon tab and make sure you are using an icon theme. - I change the font of my terminal to use "Monospace" size 10
"Edit->Preferences->Appearance" - I want my terminal window to use more real estate so I edit the "~/.config/Terminal/terminalrc" file and change the MiscDefaultGeometry setting to look as follows.
- OPTIONAL: Install the Synaptic package manager (a GUI for installing software) :
- OPTIONAL: Install the Update manager (a GUI for updating software) :
- OPTIONAL: Install the Gnome System Tools (which includes a GUI for user administration) :
- Now reboot the server, so that you can login to the Xfce GUI environment :
- phpMyAdmin for the mysql db
- phpPgAdmin for the PostgreSQL db
- Install Oracle JDK 6
- Webmin
sudo vi /etc/defaults/grub |
find the line that says GRUB_CMDLINE_LINUX="" and change it to look as follows
GRUB_CMDLINE_LINUX="vga=773" |
save the file and REMEMBER to run
sudo update-grub |
This will give you a console resolution of 1024x768
You can chose other resolutions based on the following table
--- Depth --
Colors | bits | 640x480 | 800×600 | 1024×768 | 1152×864 | 1280×1024 | 1600×1200 |
256 | 8 | vga=769 | vga=771 | vga=773 | vga=353 | vga=775 | vga=796 |
32000 | ? | vga=784 | vga=787 | vga=790 | vga= ? | vga=793 | vga= ? |
65000 | 16 | vga=785 | vga=788 | vga=791 | vga=355 | vga=794 | vga=798 |
16.7M | 24 | vga=786 | vga=789 | vga=792 | vga=795 | vga=799 | vga= ? |
All you need do then is reboot and you should see your server with the new resolution.
set number |
Save the file and the next time you open vi each line will automatically be numbered.
For my normal user (The green one) I edit my .bashrc file in my HOME dir
vi ~/.bashrc |
and add the following at the end of it.
# Set prompt: " username@hostname/directory/tree $ " (with colors) export PS1="\[\e[32;1m\]\u\[\e[0m\]\[\e[32m\]@\h\[\e[36m\]\w \[\e[33m\]\$ \[\e[0m\]" |
For the root user I add the following to the end of roots .bashrc
# Set prompt: " username@hostname/directory/tree $ " (with colors) export PS1="\[\e[31;1m\]\u\[\e[0m\]\[\e[31m\]@\h\[\e[31m\]\w \[\e[33m\]\$ \[\e[0m\]" |
alias ver="cat /etc/lsb-release" alias free="free -m" alias update="sudo apt-get update" alias install="sudo apt-get install" alias upgrade="sudo apt-get upgrade" alias remove="sudo apt-get remove" |
#!/bin/bash set -e if [ $# -lt 2 ]; then echo "cppv - copy files with progress bar and rate limiting ability" echo "Usage: cppv source_file[s] destination_file_or_directory" echo "No other non-positional command line arguments can be given" echo "Always recurses like find" echo "You can change copying speed limit on the fly with \"pv -R\" if you find out pv's PID" echo "Use FIND_OPTS, PV_OPTS, CPIO_O_OPTS, CPIO_I_OPTS to override arguments to the pipeline parts" echo "Examples:" echo " cppv a b # Copy file a to b. Just calls \"pv a > b\"" echo " cppv a d/ # Copy file a to d/a. Calls \"find a | cpio -o | pv | (cd d && cpio -i)\"" echo " cppv *{01..26}*.mkv /mnt/usb/ # Copy all matching files to /mnt/usb/." echo " cppv dir1 dir2 # duplicate dir1" echo " PV_OPTS=\"-L 1M\" cppv . /tmp/ # Limit copying rate to 1M" echo " cppv /home/vi/bin /tmp/ # Warning: Copy /home/vi/bin to /tmp/home/vi/bin" exit 1 fi; true ${CPIO_O_OPTS:="-H newc -0o"} true ${CPIO_I_OPTS:="-0diu --no-absolute-filenames"} true ${FIND_OPTS:="-depth -print0"} ARGS=( "$@" ); DEST="${ARGS[$#-1]}" unset ARGS[$#-1]; if [[ ( "${1:0:1}" == "-" && ! -e "$1" ) || ( "${DEST:0:1}" == "-" && ! -e "$DEST" ) ]]; then echo "There should not be any command line options. Only file names." >&2 exit 1; fi DIRMODE=0 if [[ $# > 2 || "${DEST:${#DEST}-1:1}" == "/" || -d $DEST ]]; then DIRMODE=1 elif [[ -d "$1" && ! -d "$2" ]]; then DIRMODE=1 mkdir "$DEST"; DEST=`readlink -f "$DEST"`; cd "$1"; ARGS=(".") fi if [ $DIRMODE == 0 ]; then pv "$1" > "$2" && exit 0; fi; if [ ! -d "$DEST" ]; then echo Not a directory: "$DEST" >&2 exit 1 fi if [ "${1:0:1}" == "/" ]; then echo "Warning: it will do a bit different thing than usual cp" >&2 echo " For example, copying $1 to $DEST$1, not to $DEST/`basename $1`" >&2 fi SIZE=`du -sb "${ARGS[@]}" | perl -ne '/^(\d+)/ and $q+=$1; END{print $q}'` find "${ARGS[@]}" $FIND_OPTS | cpio $CPIO_O_OPTS | pv -s $SIZE $PV_OPTS | (cd "$DEST" && cpio $CPIO_I_OPTS) |
I also create a static link in the /usr/bin dir to this file so I don't have to keep adding the path before the command. The command to create a static link looks like so:
sudo ln -s ~/cppv /usr/bin/cppv |
From the CLI terminal, we will install a few software packages to make our life easy
sudo apt-get install xfce4 xfce4-terminal xauth xorg |
sudo apt-get install gdm |
Alternately (what I prefer to do is) install lightdm
sudo apt-get install lightdm-gtk-greeter |
sudo apt-get install tango-icon-theme tango-icon-theme-extras gnome-icon-theme |
MiscDefaultGeometry=100x40 |
sudo apt-get install synaptic |
sudo apt-get install update-manager |
sudo apt-get install gnome-system-tools |
sudo shutdown -r now |
Select the xfce-session, the username and enter the password
The Xfce desktop environment will be displayed with the menu panel on top and a few icons on the desktop screen
If I have installed mysql I normally install phpMyAdmin to make manipulation and admin of the database easier. This is easily done by following the setup found here. But basically you need to run the following with some configuration.
sudo apt-get install libapache2-mod-auth-mysql phpmyadmin |
If I have installed PostgreSQL I normally install phpPgAdmin to make manipulation and admin of the database easier.
The following instructions will get PostgreSQL accessible from a remote server on your lan
If PostgreSQL is not installed already:
sudo apt-get install postgresql |
Log into PostgreSQL and create an account and a database for the user:
sudo -u postgres psql template1 psql> create user acme with createdb password 'abcd'; psql> create database acme with owner=acme; psql> \q |
Leave out the createdb option in the CREATE USER statement if you do not want to grant the user the privilege to create databases.
By default PostgreSQL server does not accept remote connections. To enable remote connections (which is necessary for servers like CS3 but not for servers like CSNS), modify /etc/postgresql/9.1/main/postgresql.conf so:
listen_addresses = '*' |
And modify /etc/postgresql/9.1/main/pg_hba.conf so that:
host all all 0.0.0.0/0 md5 host all all ::0/0 md5 |
To install phpPgAdmin:
sudo apt-get install phppgadmin |
By default phpPgAdmin only allows local access. To allow remote access, edit /etc/phppgadmin/apache.conf so that
#deny from all #allow from 127.0.0.0/255.0.0.0 ::1/128 allow from all |
Then restart Apache2. After that phpPgAdmin can be accessed at http://host/phpmyadmin/ .
NOTE:I was looking for the quickest way to manage PostgreSQL I was not testing the security of the admin tool.
I followed this link to install the Oracle JDK6 onto my Ubuntu Server.
I also add the following to my .bashrc
# Java environment variables export JAVA_HOME=/usr/lib/jvm/java-6-oracle export PATH=$PATH:$JAVA_HOME/bin |
I can't believe I didn't remember to talk about installing Webmin. Firstly you'll need to have some dependancies installed. You can do this by running the following from the command line.
apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python |
Official instructions can be found here, but basically there are 2 ways to install webmin.
1. Via APT
As root edit /etc/apt/sources.list and add the following lines
deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib |
You will then need to install the GPG key which you can do using the following as rootcommand
wget http://www.webmin.com/jcameron-key.asc && sudo apt-key add jcameron-key.asc |
sudo apt-get update sudo apt-get install webmin |
2. Manually Download the latest webmin archive.
wget http://www.webmin.com/download/deb/webmin-current.deb |
Install webmin with following command:
sudo dpkg --install webmin-current |
You can connect to webmin by pointing your browser to:
http://server-host-ip-address:10000/ |