Locate Ubuntu or Debian Server Version

Finding the version name and number of Ubuntu can be quite difficult, particularly if you’re running the server distrobution. In order to get the version name and number type the following into the teminal:

lsb_release -a

This should return:

Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick

To get the kernel version and build you can also run:

cat /proc/version

outputting something like:

Linux version 2.6.35-30-generic (buildd@vernadsky) (gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) ) #56-Ubuntu SMP Mon Jul 11 20:00:22 UTC 201

Posted in guides, Technical | Tagged , | Leave a comment

Fixing Slow SquirrelMail

Fixing slow SquirrelMail version 1.4.15.

If you’ve got a large inbox and you’re using SquirrelMail to view it, you may notice page loading times are poor using the default configuration. There is a simple fix that will allow SquirrelMail to load emails using multiple threads and server sorting which means that the performance will improve significantly when accessing your email via a web browser.

 

Edit your config/config.php file:

nano /etc/squirrelmail/config.php

 

find the lines:

$allow_thread_sort = false;
$allow_server_sort = false;

and change them to:

$allow_thread_sort = true;
$allow_server_sort = true;

You need to restart your web server (assuming apache):

/etc/init.d/apache2 restart

And then login to your web mail page. With any luck you’ll have noticed a significant performance boost. For further performance tuning information see the SquirrelMail website guide at: http://www.squirrelmail.org/docs/admin/admin-6.html

Posted in guides, Technical | Tagged , , , | Leave a comment

A Quick Review: Courier vs Dovecot

In the open source email world there seem to be two main competitors: Courier-MTA and Dovecot. These programs would sit on the email server and store messages for accounts that are destined for your domain. In a recent review of the email systems used where I work it’s been questioned as to whether Courier should still be used.

Slow to load in Squirrel mail

Squirrel mail is a popular open source webmail client written in PHP. It isn’t the prettiest web mail client on down the road but it is the most widely compatible. When inboxes are loaded with large amounts of emails in them, Squirrel mail takes a small ice age to load. This seems to be because Courier doesn’t index the maildir where the mail is stored, so every time you open up the webmail client it has to reaload the entire inbox.

 

Ongoing Auto responder problems

Problems with our auto responders have been getting progressively worse in Courier. It seems that due to the load of the system (partly down to the first Courier fault I mentioned: lack of indexing) doesn’t always manage to process the request to send an auto responder.

 

Dovecot

Dovecot is supposedly much faster than Courier due to the indexing it provides. Claims are that it is still not yet as feature rich as courier, but that it is certainly becoming more main stream. One big advantage of Dovecot is its sane use of configuration files, whereas Courier tends to spread them all over the system. Additionally Dovecot uses maildir format so is compatible with standard Courier installations.

 

Posted in Reviews, Technical | Leave a comment

VirtualBox 4 Headless Server

The following article highlights how to setup a machine in Virtual Box 4, allowing remote access via VDRP.

I assume that you have already installed VirtualBox 4 (or the latest version)  on your system. Virtualbox-OSE is not able to use features like USB host pass through and remote administration, so make sure you’ve installed the full version of VirtualBox from their website and installed it using: dpkg –install virtualbox-4.0_4.0.8-71778~Ubuntu~natty_i386.deb

http://www.virtualbox.org/wiki/Downloads

You MUST also install VirtualBox Oracle VM VirtualBox Extension Pack that can be found on the downloads page above

Create your first VM

VBoxManage createvm –name centos –register

This creates a VM named centos and registers it with the VBox manager

Setup Memory, Boot Device, etc
VBoxManage modifyvm centos –memory 256 –acpi on –boot1 dvd

You can modify the spec of your VM using the modifyvm flag. This sets it’s memory to 256MB, enables acpi and sets the boot device to the DVD drive

Create the VDI (Hard Drive)
sudo VBoxManage createvdi –filename “/var/vbox/centos.vdi” –size 5000

You may need to use sudo if you’re in Ubuntu. This command creates the hard drive for the machine in a directory you specify. You can also set it’s size in MegaBytes, this drive is 5GB

Setup an IDE controller
VBoxManage storagectl centos –name “IDE Controller” –add ide

It’s also necessary to configure the VM with a storage controller, in this case I’ve called it IDE Controller and set the type to IDE

Set the VM to use the new VDI

VBoxManage modifyvm centos –hda “/var/vbox/centos.vdi”

We now need to add the hard drive to the VM. It’s important that you have setup the IDE controller before you do this as it will throw up errors without one. Make sure you get the path to your VDI correct and that it has the correct permissions to allow Virtual Box to read, write and execute.

Setup a DVD drive
VBoxManage storageattach centos –storagectl “IDE Controller” –port 1 –device 0 –type dvddrive –medium /home/user/iso/CentOS-5.6-i386-netinstall.iso

Setup the VM to use the IDE controller on a different port with the type DVD Drive and use an iso image… you can also specify a disc drive, but for my setup there will be a number of ISO’s for people to select and install.

 

Enable Virtual Remote Desktop Environment (VRDE)
VBoxManage modifyvm centos –vrde on

Simply enables the VRDE to run.

 

Start the Headless VM
VBoxHeadless –startvm centos -e “TCP/Ports=3389″

This starts the VM in headless mode with VRDE listening on port 3389.
Connect using MSTSC
You can now connect to the machine using MSTSC on Windows or rdesktop on Linux. To connect you need to use the VM HOST’s IP address, not the VM’s IP address.

Posted in guides, Uncategorized | Tagged , , , | Leave a comment

View Email Headers in Outlook 2007

Outlook 2007 does a good job in hiding the detailed email header information. It’s still accessible, but not by simply viewing the source of the email. Instead you need to go to “message options” which is found under the small arrow at the bottom right of the “options” section of the message ribbon. from there you will find a box at the bottom containing “internet headers”  - they’re impossible to read in the box, so you’ll have to copy and paste them into notepad to review.



Posted in guides | Leave a comment

Setting email quota in Courier-MTA

If you’re receiving errors along the lines of:
456 Address temporarily unavailable.
Or
maildrop: maildir over quota.
Or
status: deferred

It’s likely that the mail box in question has run out of storage space. In my experience this is usually due to the user not sorting through their emails and deleting old ones, and in one case there was hundreds of megabits in the .Trash folder that had simply not been emptied.

In order to increase the mail directory’s quota for the user in question, you need to run the following command from inside the users directory:
maildirmake -q 500000000S,1000000C ./Maildir

this will allow 500MB of Storage to be used, or 1000000 Correspondents (or emails) to be stored on their mail directory, whichever comes first.

After running this command you’ll need to restart the mta
/etc/init.d courier-mta restart

and make sure that the cache of problem email addresses is cleared:
courier clear all

Posted in guides, Technical | Tagged , | Leave a comment

TC4400 Tablet Stylus Not Aligned in Photoshop CS5

This is a weird one! I have Photoshop CS5 on my tablet PC and had been using it quite happily, but some time after updating Windows 7 to SP1 the sylus became misaligned only in photoshop. This meant that using windows, the stylus was aligned and working properly, but when using photoshop it appeared out of alignment upto about 3 inches away!

After browsing the internet for weeks, I couldn’t find a workable solution. These are the steps I took to finally get back stylus alignment in Photoshop on the HP TC4400:

  1. uninstall photoshop, including the preferences
  2. open device manager (start > devmgmt.msc )
  3. under human interface devices, remove anything that looks like it could be the Wacom touchscreen driver
  4. reboot the computer
  5. it should detect new hardware and try to install the drivers automatically. If it does this you need to remove them again.
  6. Install the HP supplied drivers from their website (go to hp.co.uk and do a search for TC4400, select drivers and downloads and root out the wacom drives that HP supply)
  7. reboot the machine
  8. install photoshop
  9. this should now align again, but there will be no pressure sensitivity
  10. install the wacom drivers for Tablet PC devices from their website
  11. reboot the computer
  12. you should now have pressure sensitivity and stylus alignment in photoshop
Posted in guides, Laptops, Technical | Tagged , , , , | Leave a comment

Change Printer Tray Macro in MS Word

This subroutine sets the printer tray in MS word. Adapting it, you could adjust the macro to print certain documents from certain trays, or certain pages of one document using different trays.

Sub Tray1()

‘ Tray1 Macro
‘ Print the first page of a document from a specific paper tray

With ActiveDocument.PageSetup
‘this link would set the paper size, but isn’t always necissary.
‘ .PaperSize = wdPaperA4

‘The first tray on my printer is 259, but 260 is also typical
.FirstPageTray = 259

‘print the document with the first page from tray 1 and the second page from tray 2
ActiveDocument.PrintOut
End With

End Sub

Posted in guides | Tagged , , | Leave a comment

Problem With Previous OpenLdap Installation (Ubuntu 10.04)

If you’re recieving errors after trying to setup the rather troublesome OpenLDAP server on Ubuntu 10.04 or 10.10 the following command might help you get back to the start!

sudo apt-get purge slapd

You can then reinstall slapd:

sudo apt-get install slapd

I was recieving the following errors after my attempt to setup OpenLDAP using the ubuntu wiki documentation.

/tmp/slapd.config.90451: 1337: cannot open /etc/ldap/schema/core.schema: No such file
/tmp/slapd.config.90451: 1337: cannot open /etc/ldap/schema/cosine.schema: No such file
/tmp/slapd.config.90451: 1337: cannot open /etc/ldap/schema/nis.schema: No such file
/tmp/slapd.config.90451: 1337: cannot open /etc/ldap/schema/inetorgperson.schema: No such file

When you set it up you no longer use slapd.conf or ldap.conf, it’s done in a different way. See the 10.04 specific documentation for setting up newer distrobutions of Ubuntu with OpenLDAP.

Posted in Technical | Tagged , , | Leave a comment

Simple Single Interface Squid Proxy

This is a brief introduction to Squid proxy that covers Setting up Squid on Ubuntu/Debian with a single network card, and routing traffic through it. I use this for testing websites remotely before putting them live, but it would also be possible to setup a similar box to monitor network traffic.

Before you begin you should have a computer setup with Ubuntu/Debian. I am using Ubuntu 10.04 LTS for my proxy. The rest of these instructions will assume that this is installed and configured on your network as you want it. Also note that Debian users should su to root instead of typing sudo.

1. Get squid

First thing’s first, we need to get squid. This can be achieved by typing the following into  the terminal:

sudo apt-get install squid

This will download squid from the repositories and set it up on your machine.

2. Setup Squid

This is easy if you know what you’re doing. The squid config file is in the /etc/squid/ directory, so open it up in a text editor:

sudo nano /etc/squid/squid.conf

Now we need to add the lines to allow access to your network. If you’re in nano you can use

Ctrl+w and type acl all src all

Since I’m setting this up as a remote server I have to allow my IP address for work to be able to access the proxy. Here’s the lines I added:

acl remotenet src 123.123.123.123 #Work’s external IP address

If you don’t know your external IP address go to: sirnet.co.uk/ip.php

further down the script there’s a line that reads http_access allow localnet, under this line add:

http_access allow remotenet #allow connections to this proxy server from “remotenet”

Understanding this process

ACL is an access control list, which you’re assigning IP addresses to. in the above two lines you’ve allowed the IP address 123.123.123.123 access to the proxy server. You can continue adding IP addresses to the remotenet group my copying and pasting the first line you entered but with different IP addresses.

At the end to the file you’ll also need to add the following line of code:

visible_hostname someProxyServerName

Exit and save the squid.conf file by pressing Ctrl+x and pressing Y when asked if you want to save changes, followed by enter to overwrite the file.

restart squid: sudo service squid restart

3. Setting  Up Your Web Browser

You should now be able to access your server by setting the proxy details up in your browser as the following:

Proxy: your squid IP address/DNS name

Port: 3128

Posted in guides | Tagged , | Leave a comment