An adventure with email – 02 First steps with Mutt

March 4th, 2012

So the first step is to get Mutt working. First I SSH’s to my VPS using putty. From here I followed the instructions on MuttGuide/Setup which told me to try:

mutt -v

But I got a :

bash: mutt: command not found

Now the mutt guide tries to lead you into thinking that you need start downloading things but I know that Ubuntu is pretty good at being to install things with apt-get so I just guessed at the following:

sudo apt-get install mutt

Bingo! Worked at treat! I’m now the proud owner of a working copy of Mutt 1.5.20 (2009-06-14). So what next? Launch mutt I suppose.

So the first thing it asked me after typing mutt was

/home/daniel/Mail does not exit. Create it? ([yes]/no):

And I said no because I wasn’t sure if I wanted it or not. And …

Wow! 7000+ emails waiting for me. That was a bit of a shock, but it actually makes sense because I have some automated jobs running on the server telling me about updates and my WordPress installation is configured to send emails to me at my domain. And because my account at this server is me at this domain the emails get sent locally. Yet another reason to take ownership of my emails. It turns out my email has been split across two locations all this time.

An adventure with email – 01 Introduction

March 4th, 2012

Email facinates me, we all use it everyday but I doubt many of us give it a second thought as to how it actually works. For a few different reasons but mainly out of pure curiosity I’ve been thinking I’d like to get more hands on and set up my own email system. My current situation is I have two main email addresses, one for work which is Microsoft Exchange based and completely outside of my control and a personal account which is at the domain I own, freshnewpage.com. The email mailbox is currently managed by my ISP and comes free with my webhosting package. This is the one I’m interested in exploring. At home I can use Thunderbird and connect to my email using IMAP but when I’m out and about or at work and I want to check my personal email I’m forced to use the webmail interface provided by my hosting service which, is ok, but not great.  Also email is currently the biggest attachment I have to my current web hosting provider. If I could become independant of them for managing my email then I would be free to switch providers.

So what can I do? Well one option is to go down the Gmail route; certainly an easy option. You can hook up an existing email address and work with Gmail. And I know that Google is a massive company and Gmail is a great interface etc. but my email is still completely outside of my control if I do that. Added to which Google parses your email and you get advertising thrown at you in the interface. The most important reason though is that I’m not going learn anything by just letting Google manage everything for me.

What I’d really like to get to at the end of all of this is to be running my own mail server on my VPS and also hosting my own webmail service. Now I know from initial investigations that there are quite a few pieces to this puzzle and there is going to be alot of configuration involved so I’m not going to try and do it all at once. Also I’m going to have to fit working on this project around the rest of my life, hence the idea of documenting my progress on this blog. Now what I do have already is my VPS which I have SSH access to. Something I remember my proffessors at University doing was viewing their email with a command line application. So my first challenge I’m setting myself is to learn Mutt . With this at least I’ll always have a means of checking my email so long as I can SSH to my host.

NVIDIA GeForce4 420 Go on Ubuntu 8.04 (Hardy Heron)

April 26th, 2008

Preamble

This is a guide to installing NVIDIA drivers for a GeForce4 420 Go graphics card on Ubuntu. This guide was tested on a Toshiba Satellite Pro 2100 running Ubuntu 8.04 but should work for other laptops with GeForce4 420 Go graphics cards and other versions of Ubuntu.

Introduction

On a laptop with a GeForce4 420 Go, Ubuntu will recognise there is an NVIDIA card and offer to install the restricted driver. Installing this driver will cause two problems.

  1. On rebooting the screen will be blank
  2. This is because the driver is causing the graphics card to output on the VGA port rather than to the laptop screen.

  3. The correct resolution is not available once driver is working.
  4. This is because the EDID data being supplied to the driver is not correct.

Requirements

  • laptop with a GeForce4 420 Go graphics card.
  • Ubuntu (assumed to be a clean install)
  • the correct maximum resolution of your display (e.g. 1024×768)

Installation

The first stage is to check the correct repositories are enabled.

  • Go to: “System -> Administration -> Software Sources”
  • Under the “Ubuntu Software” tab ensure the first three boxes are ticked (main, universe and restricted).

Next the restricted NVIDIA driver must be enabled.

  • Go to: “System -> Administration -> Hardware Drivers”
  • Tick the box next to “NVIDIA accelerated graphics driver”.
  • Close the window and confirm the changes.

You should be informed that a restart of the computer is required before the changes will take effect. Do this now. Do not be alarmed if the computer has a blank screen after the restart; this is expected.

Now we will change the “xorg.conf” file to tell the driver to output to the laptop screen rather than the VGA port.

  • Press “Ctrl + Alt + F1″ to open a terminal.
  • Login
  • As root, open “/etc/X11/xorg.conf” for editing.
    sudo vim /etc/X11/xorg.conf
    (you can use the editor you are most comfortable with in place of “vim” e.g. nano)
  • Find the “Device” section (look for the line Section "Device") and insert as the last line of that section (before the EndSection)
    Option "UseDisplayDevice" "DFP-0"
  • Now save and close the file.
  • Restart the X server by typing
  • $ sudo /etc/init.d/gdm restart

You should now see the login window but it will likely be at the wrong resolution. First check that the desired resolution really is not available. For example on the Toshiba Laptop the screen resolution should be 1024×768.

  • Go to: “System -> Preferences -> Screen Resolution” and see if the correct resolution is available.

If the correct resolution is available then select it and everything should now be working. If the correct resolution is not available then you have encountered the EDID problem. This requires some additional packages to fix. First we must install “nvidia-settings, ghex and read-edid”

  • Open a terminal “Applications -> Accessories -> Terminal”
  • Run:
  • $ sudo apt-get install nvidia-settings ghex read-edid

We now need to obtain the EDID data.

  • Go to: “System -> Administration -> NVIDIA X Server Setting”
  • From the left hand list choose: “DFP-0 – (Nvidia Default Flat Panel)”
  • Click the “Aquire EDID” button.
  • Save “edid.bin” to the desktop. (click “Desktop” then click “OK”)
  • Close “NVIDIA X Server Settings” window.

Now we need to check the EDID data.

  • In the terminal change directory to the Desktop (or where the EDID data was saved to).
  • $ cd ~/Desktop

  • Check the resolution mode in the EDID data.
  • $ parse-edid edid.bin | grep "Mode "

The output should look something like this:
parse-edid: parse-edid version 1.4.1
parse-edid: EDID checksum passed.
Mode "969x768" # vfreq 60.004Hz, hfreq 48.363kHz

Here you can see that the EDID data has an incorrect resolution of “969×768″. The resolution is stored in the EDID file as a hexadecimal value. We need to correct the value. To do this we have to edit “ebid.bin” with a hexadecimal editor. We will keep the terminal window open while we do this.

  • Go to: “Applications  -> Programming -> Hex Editor”
  • Click: “File -> Open -> Desktop -> edid.bin -> Open”

You should now be looking at the “ebid.bin” in hexadecimal format. The data is represented as pairs of hexadecimal characters. Each pair correspodes to one byte. Notice that there are 17 bytes in a row. The bytes are indexed from zero so the last byte on the first line is the sixteenth byte.

We need to change the horizontal resolution. This is slightly confusingly split across two bytes. When converted to a hexadecimal value,  the first digit of the value is stored in the first charater of the 58th byte and the last two digits of the value are stored in the 56th byte. In our example the resolution in the EDID file is 969. We can use the calculator to convert this to hexadecimal.

  • Go to:  “Applications -> Accessories -> Calculator -> View -> Scientific”
  • Click “Dec” to put the calculator into decimal mode.
  • Then enter the number “969″
  • Click “Hex” to convert the number to hexadecimal.

You should get the answer 3C9 (hex). The 56th and 58th bytes are show on the forth line of the hex editor. This is the forth line from my file with the releveant characters in bold:

01 01 01 64 19 C9 77 31 00 26 30 4F 88 36 00 42 FF

Notice how the value is written with the last two digits then the first digit.

In my example the desired resolution is 1024. Converted to hexadecimal this is 400 (hex). Hence the 56th byte of my EDID file should be “00″ and the first character of the 58th byte should be “4″. The new line in the file is:

01 01 01 64 19 00 77 41 00 26 30 4F 88 36 00 42 FF

Save the file and re-run parse-edid. (You can go to the terminal and press the up arrow and enter). The output should now look like this:
parse-edid: parse-edid version 1.4.1
parse-edid: EDID checksum failed - data is corrupt. Continuing anyway.
Mode "1024x768" # vfreq 57.645Hz, hfreq 46.462kHz

Don’t worry about the fact the checksum failed. This is not important. We now need to copy the “edid.bin” in to the X configuration directory and set it to override the real EDID data.

  • Copy the “edid.bin” to /etc/X11/
  • $ sudo cp edid.bin /etc/X11/

  • Edit “xorg.conf” to override EDID.
  • $ vim /etc/X11/xorg.conf

  • In the “Screen” section, insert the line:
  • Option "CustomEDID" "DFP-0:/etc/X11/edid.bin"

  • Save the file and restart the computer.

The computer should now start at the correct resolution with the NVIDIA driver enabled.

References

The following references were used when compiling this guide.

Hello!

April 22nd, 2008

Just testing things out here. I’m setting up the blog for the Fresh New Page website. Some more interesting entries should appear soon.