All posts by cdstealer

Virginmedia Superhub (VMDG480)

So you've upgraded your virginmedia connection to 30Mbit+ and your wireless-N isn't quite living up to your expectations?  This is the issue I had.. the internet speed was great.. getting a constant ~3.6Mb/s but if I transferred any data over the wifi eg streaming or copying, the speed would be very very erratic to the point of being slower than 802.11bg.

I read a lot of forums (including Virginmedia's, see this thread or this thread) with lots of people experiencing the same thing (amongst plenty of other performance issues), so I decided to create this page as no-one had actually gave any concrete solution.

After a few days of trial and error I found the combination that worked for me:

Security Mode: WPA Auto

Channel: 64

802.11 mode: Up to 300 Mbps

802.11N Band: 5 Ghz

The downside of this is, if you have any 802.11bg devices, they will not be able to connect or even see the network.  You can overcome this by either purchasing 802.11N adaptors or a cheap access point/wireless router that supports the slower 802.11bg 2.4Ghz.  I had my trusty old Netgear DG624 to hand due to the upgrade :)

EDIT: Boooooo!  The wireless on the superhub is flaky at best.  The N speed is not constant.  I have to do a null change in the wireless settings to correct that, which only lasts until the router is rebooted, which will happen when the router drops the wireless network.  Streaming video is just a no go, even at N speed!!!  So for me, the wireless is throttled to 2.4Ghz 54Mbps :(

Other than the wireless, everything else is OK.  Internet connection is uninterrupted and at full speed and the internal wired network runs smoothly and is able to stream without an issue.  So I guess the above is a bit of a moot point.

EDIT (29/05/2012) YAY! \o/ Just had a new Superhub delivered and using kernel 3.4.0, I have stable and fast N connectivity. 20Mb(ytes)s throughput! Nice!
However, the router will kill the wifi if (for example) there is a lot of output going to stdout :(

Hardware Version 2.00
Software Version R36

EDIT (04/10/2012) GAH!  VM updated the firmware to R36 a few weeks back which seems to corrupt "large" downloads.  The work around is to put the hub in "modem mode" and use a separate router.  There are several threads about this on the VM forums.

Squid Cache Server

How to setup a Squid Proxy.

The /etc/squid/squid.conf File

The main Squid configuration file is squid.conf, and, like most Linux applications, Squid needs to be restarted for changes to the configuration file can take effect.
The config file is extensive and very well commented.  Here is an example.

the config

The Visible Host Name (optional)

Squid can fail to start if you don't give your server a hostname. You can set this with the visible_hostname parameter.

Logging Options

Be default, the time stamp in the log files are EPOCH.  To change this to a more human readable format, uncomment/add this line in the "log_format" section of /etc/squid/squid.conf.

logformat squid %tl %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt PORT_REQUEST = %>p

Access Control Lists

You can limit users' ability to browse the Internet with access control lists (ACLs). Each ACL line defines a particular type of activity, such as an access time or source network, they are then linked to an http_access statement that tells Squid whether or not to deny or allow traffic that matches the ACL.

Squid matches each Web access request it receives by checking the http_access list from top to bottom. If it finds a match, it enforces the allow or deny statement and stops reading further. You have to be careful not to place a deny statement in the list that blocks a similar allow statement below it. The final http_access statement denies everything, so it is best to place new http_access statements above it

Note: The very last http_access statement in the squid.conf file denies all access. You therefore have to add your specific permit statements above this line. In the chapter's examples, I've suggested that you place your statements at the top of the http_access list for the sake of manageability, but you can put them anywhere in the section above that last line.

Squid has a minimum required set of ACL statements in the ACCESS_CONTROL section of the squid.conf file. It is best to put new customized entries right after this list to make the file easier to read.

Restricting Web Access By Time

You can create access control lists with time parameters. For example, you can allow only business hour access from the home network, while always restricting access to host 192.168.1.23.

#
# Add this to the bottom of the ACL section of squid.conf
#
acl home_network src 192.168.1.0/24
acl business_hours time M T W H F 9:00-17:00
acl RestrictedHost src 192.168.1.23

#
# Add this at the top of the http_access section of squid.conf
#
http_access deny RestrictedHost
http_access allow home_network business_hours

Or, you can allow morning access only:

#
# Add this to the bottom of the ACL section of squid.conf
#
acl mornings time 08:00-12:00

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow mornings

Restricting Access to specific Web sites

Squid is also capable of reading files containing lists of web sites and/or domains for use in ACLs. In this example we create to lists in files named /usr/local/etc/allowed-sites.squid and /usr/local/etc/restricted-sites.squid.

# File: /usr/local/etc/allowed-sites.squid
www.openfree.org
linuxhomenetworking.com

# File: /usr/local/etc/restricted-sites.squid
www.porn.com
illegal.com

These can then be used to always block the restricted sites and permit the allowed sites during working hours. This can be illustrated by expanding our previous example slightly.

#
# Add this to the bottom of the ACL section of squid.conf
#
acl home_network src 192.168.1.0/24
acl business_hours time M T W H F 9:00-17:00
acl GoodSites dstdomain "/usr/local/etc/allowed-sites.squid"
acl BadSites  dstdomain "/usr/local/etc/restricted-sites.squid"

#
# Add this at the top of the http_access section of squid.conf
#
http_access deny BadSites
http_access allow home_network business_hours GoodSites

Restricting Web Access By IP Address

You can create an access control list that restricts Web access to users on certain networks. In this case, it's an ACL that defines a home network of 192.168.1.0.

#
# Add this to the bottom of the ACL section of squid.conf
#
acl home_network src 192.168.1.0/255.255.255.0

You also have to add a corresponding http_access statement that allows traffic that matches the ACL:

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow home_network

Password Authentication Using NCSA

You can configure Squid to prompt users for a username and password. Squid comes with a program called ncsa_auth that reads any NCSA-compliant encrypted password file. You can use the htpasswd program that comes installed with Apache to create your passwords. Here is how it's done:

1) Create the password file. The name of the password file should be /etc/squid/squid_passwd, and you need to make sure that it's universally readable.

[root@cdstealer tmp]# touch /etc/squid/squid_passwd
[root@cdstealer tmp]# chmod o+r /etc/squid/squid_passwd

2) Use the htpasswd program to add users to the password file. You can add users at anytime without having to restart Squid. In this case, you add a username called www:

[root@cdstealer tmp]# htpasswd /etc/squid/squid_passwd www
New password:
Re-type new password:
Adding password for user www
[root@cdstealer tmp]#

3) Find your ncsa_auth file using the locate command.

[root@cdstealer tmp]# locate ncsa_auth
/usr/lib/squid/ncsa_auth
[root@cdstealer tmp]#

4) Edit squid.conf; specifically, you need to define the authentication program in squid.conf, which is in this case ncsa_auth. Next, create an ACL named ncsa_users with the REQUIRED keyword that forces Squid to use the NCSA auth_param method you defined previously. Finally, create an http_access entry that allows traffic that matches the ncsa_users ACL entry. Here's a simple user authentication example; the order of the statements is important:

#
# Add this to the auth_param section of squid.conf
#
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

#
# Add this to the bottom of the ACL section of squid.conf
#
acl ncsa_users proxy_auth REQUIRED

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow ncsa_users

5) This requires password authentication and allows access only during business hours. Once again, the order of the statements is important:

#
# Add this to the auth_param section of squid.conf
#
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

#
# Add this to the bottom of the ACL section of squid.conf
#
acl ncsa_users proxy_auth REQUIRED
acl business_hours time M T W H F 9:00-17:00

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow ncsa_users business_hours

Remember to restart Squid for the changes to take effect.

Forcing Users To Use Your Squid Server

If you are using access controls on Squid, you may also want to configure your firewall to allow only HTTP Internet access to only the Squid server. This forces your users to browse the Web through the Squid proxy.

Making Your Squid Server Transparent To Users

It is possible to limit HTTP Internet access to only the Squid server without having to modify the browser settings on your client PCs. This called a transparent proxy configuration. It is usually achieved by configuring a firewall between the client PCs and the Internet to redirect all HTTP (TCP port 80) traffic to the Squid server on TCP port 3128, which is the Squid server's default TCP port.

Squid Transparent Proxy Configuration

Your first step will be to modify your squid.conf to create a transparent proxy. The procedure is different depending on your version of Squid.

Prior to version 2.6: In older versions of Squid, transparent proxy was achieved through the use of the httpd_accel options which were originally developed for http acceleration. In these cases, the configuration syntax would be as follows:

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

Version 2.6 and Beyond: Newer versions of Squid simply require you to add the word "transparent" to the default "http_port 3128" statement. In this example, Squid not only listens on TCP port 3128 for proxy connections, but will also do so in transparent mode.

http_port 3128 transparent

Configuring iptables to Support the Squid Transparent Proxy

Only the Squid server has access to the Internet on port 80 (HTTP), because all HTTP traffic, except that coming from the Squid server, is redirected.

If the Squid server and firewall are the same server, all HTTP traffic from the home network is redirected to the firewall itself on the Squid port of 3128 and then only the firewall itself is allowed to access the Internet on port 80.

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 \
        -j REDIRECT --to-port 3128
iptables -A INPUT -j ACCEPT -m state \
        --state NEW,ESTABLISHED,RELATED -i eth1 -p tcp \
        --dport 3128
iptables -A OUTPUT -j ACCEPT -m state \
        --state NEW,ESTABLISHED,RELATED -o eth0 -p tcp \
        --dport 80
iptables -A INPUT -j ACCEPT -m state \
        --state ESTABLISHED,RELATED -i eth0 -p tcp \
        --sport 80
iptables -A OUTPUT -j ACCEPT -m state \
        --state ESTABLISHED,RELATED -o eth1 -p tcp \
        --sport 80

Note: This example is specific to HTTP traffic. You won't be able to adapt this example to support HTTPS web browsing on TCP port 443, as that protocol specifically doesn't allow the insertion of a "man in the middle" server for security purposes. One solution is to add IP masquerading statements for port 443, or any other important traffic, immediately after the code snippet. This will allow non HTTP traffic to access the Internet without being cached by Squid.

If the Squid server and firewall are different servers, the statements are different. You need to set up iptables so that all connections to the Web, not originating from the Squid server, are actually converted into three connections; one from the Web browser client to the firewall and another from the firewall to the Squid server, which triggers the Squid server to make its own connection to the Web to service the request. The Squid server then gets the data and replies to the firewall which then relays this information to the Web browser client. The iptables program does all this using these NAT statements:

iptables -t nat -A PREROUTING -i eth1 -s ! 192.168.1.100 \
        -p tcp --dport 80 -j DNAT --to 192.168.1.100:3128
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.1.0/24 \
        -d 192.168.1.100 -j SNAT --to 192.168.1.1
iptables -A FORWARD -s 192.168.1.0/24 -d 192.168.1.100 \
        -i eth1 -o eth1 -m state
         --state NEW,ESTABLISHED,RELATED \
        -p tcp --dport 3128 -j ACCEPT
 iptables -A FORWARD -d 192.168.1.0/24 -s 192.168.1.100 \
        -i eth1 -o eth1 -m state --state ESTABLISHED,RELATED \
        -p tcp --sport 3128 -j ACCEPT

In the first statement all HTTP traffic from the home network except from the Squid server at IP address 192.168.1.100 is redirected to the Squid server on port 3128 using destination NAT. The second statement makes this redirected traffic also undergo source NAT to make it appear as if it is coming from the firewall itself. The FORWARD statements are used to ensure the traffic is allowed to flow to the Squid server after the NAT process is complete. The unusual feature is that the NAT all takes place on one interface; that of the home network (eth1).

You will additionally have to make sure your firewall has rules to allow your Squid server to access the Internet on HTTP TCP port 80.

Manually Configuring Web Browsers To Use Your Squid Server

If you don't have a firewall that supports redirection, then you need to configure your firewall to only accept HTTP Internet access from the Squid server, as well as configure your PC browser's proxy server settings manually to use the Squid server. The method you use depends on your browser.

For example, to make these changes using Internet Explorer

  1. Click on the "Tools" item on the menu bar of the browser.
  2. Click on "Internet Options"
  3. Click on "Connections"
  4. Click on "LAN Settings"
  5. Configure with the address and TCP port (3128 default) used by your Squid server.

Here's how to make the same changes using Mozilla or Firefox.

  1. Click on the "Edit" item on the browser's menu bar.
  2. Click on "Preferences"
  3. Click on "Advanced"
  4. Click on "Proxies"
  5. Configure with the address and TCP port (3128 default) used by your Squid server under "Manual Proxy Configuration"

Squid Disk Usage

Squid uses the /var/spool/squid directory to store its cache files. High usage squid servers need a large amount of disk space in the /var partition to get optimum performance.

Every webpage and image accessed via the Squid server is logged in the /var/log/squid/access.log file. This can get quite large on high usage servers. Fortunately, the logrotate program automatically purges this file.

Troubleshooting Squid

Squid logs both informational and error messages to files in the /var/log/squid/ directory. It is best to review these files first whenever you have difficulties.The squid.out file can be especially useful as it contains Squids' system errors.

Another source of errors could be unintended statements in the squid.conf file that cause no errors; mistakes in the configuration of hours of access and permitted networks that were forgotten to be added are just two possibilities.

Conclusion

Tools such as Squid are popular with many company mangers. By caching images and files on a server shared by all, Internet bandwidth charges can be reduced.

Squid's password authentication feature is well liked because it allows only authorized users to access the Internet as a means of reducing usage fees and distractions in the office. Unfortunately, an Internet access password is usually not viewed as a major security concern by most users who are often willing to share it with their colleagues. Although it is beyond the scope of this book, you should consider automatically tying the Squid password to the user's regular login password. This will make them think twice about giving their passwords away. Internet access is one thing, letting your friends have full access to your e-mail and computer files is quite another.

Taken from LinuxHomeNetworking

HTTPS/HTTP Virtual Hosts

 

Sometimes there is a need to have vitual hosts (vhosts,Name-based virtual hosts) wikipedia

To enable https vhosts, use this example in /etc/apache2/vhosts.d/00_default_ssl_vhost.conf:

NameVirtualHost *:443

<VirtualHost *:443>
 SSLEngine on
 SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
 SSLCertificateFile /path/to/your/cert.crt
 SSLCertificateKeyFile /path/to/your/cert.key

 ServerName vhost1.cdstealer.com
 SSLOptions StrictRequire
 SSLProtocol all -SSLv2

 DocumentRoot /path/to/your/htdocs/vhost
 <Directory /path/to/your/htdocs/vhost>
 SSLRequireSSL
 Order Deny,Allow
 Allow from All
 </Directory>

 <IfModule log_config_module>
 TransferLog /var/log/apache2/ssl_access_log
 </IfModule>

</VirtualHost>

To enable http vhosts, use this example in /etc/apache2/vhosts.d/00_default_vhost.conf:

NameVirtualHost *:80

<VirtualHost *:80>
 ServerName vhost1.cdstealer.com
 DocumentRoot /path/to/your/htdocs/vhost/
 <Directory /path/to/your/htdocs/vhost/>
 Allow from All
 </Directory>
 <IfModule mpm_peruser_module>
 ServerEnvironment apache apache
 </IfModule>
</VirtualHost>

However, doing this won't be enough.  Your DNS host will also need a CNAME  to point to your server.

gitorrent

Get giTorrent

Download gitorrent and unzip into you webroot.

For this I created a sub directory "gitorrent" and unpacked into there.

Configure:

GITORRENT:

Edit gitorrent/gihome/JSXAPPS/giTorrent/giTorrentConfig.xml and enter your details.

Security:

.HTACCESS:
For me, I do the following.  This just forces SSL:

SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "cdstealer.com"
ErrorDocument 403 https://cdstealer.com/error/403.html
AuthType Basic
AuthUserFile /path/to/my/htpasswd
AuthName "Please enter your username and password."
require valid-user

I believe if everything is correct and has been restarted ie apache & rtorrent, pointing your browser to https://<your_domain>/gitorrent/apps/giTorrent.html should start the GUI.  If you have no active torrents, clicking on the "settings" tab should display completed port settings etc.  This shows that everything is working.

Rtorrent Web GUI

Sometimes you just don't have ssh access to your server ;)  This is where web based applications come in really handy.  There are a few web frontends for rtorrent.  See here

I'm not going to go into detail on how to setup rtorrent or apache, only how to setup for the guis.

Install the apps:

Emerge rtorrent with xmlrpc enabled:
net-p2p/rtorrent-0.8.6-r1  USE="ipv6 xmlrpc -daemon -debug"

Emerge the scgi apache module:
www-apache/mod_scgi-1.13

Emerge xmlrpc
dev-java/xmlrpc-2.0.1  USE="-doc -examples -source -test"

Configure:

APACHE:
Add "-D SCGI" to APACHE2_OPTS in /etc/conf.d/apache2
Add "LoadModule scgi_module modules/mod_scgi.so" to /etc/apache2/httpd.conf
Add "SCGIMount /RPC2 127.0.0.1:5000" in the <VirtualHost _default_:443> of /etc/apache2/vhosts.d/00_default_ssl_vhost.conf (you can also this for non ssl if security is not an issue)

RTORRENT:
Add "scgi_port = localhost:5000" to your ~/.rtorrent.rc file

That should be the ground work for most frontends as rtorrent only uses XMLRPC.

Frontends (gentoo stylee)

GITORRENT

Roundcube Webmail

You will need to have mysql and apache installed and running!

Install it:

# emerge -av roundcubeThese are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild N ] dev-libs/libmcrypt-2.5.8-r1 1,304 kB

[ebuild N ] app-admin/php-toolkit-1.0.1 6 kB

[ebuild NS ] sys-devel/automake-1.10.3 [1.9.6-r3, 1.11.1] 0 kB

[ebuild N ] app-admin/webapp-config-1.50.16-r1 102 kB

[ebuild N ] media-libs/t1lib-5.1.2 USE="X -doc" 1,829 kB

[ebuild N ] net-libs/c-client-2007e USE="pam ssl -kolab" 2,725 kB

[ebuild N ] virtual/httpd-cgi-0 0 kB

[ebuild N ] app-text/aspell-0.60.6-r1 USE="nls -examples" LINGUAS="en -af -be -bg -br -ca -cs -cy -da -de -el -eo -es -et -fi -fo -fr -ga -gl -he -hr -is -it -la -lt -nl -no -pl -pt -pt_BR -ro -ru -sk -sl -sr -sv -uk -vi" 1,737 kB

[ebuild N ] app-dicts/aspell-en-6.0.0 179 kB

[ebuild N ] dev-lang/php-5.2.13 USE="apache2 berkdb bzip2 cli crypt ctype curl gd gdbm iconv imap ipv6 json mysql ncurses nls pcre posix readline reflection session sockets spell spl ssl truetype unicode xml xmlrpc xpm zip zlib -adabas -bcmath -birdstep -calendar -cdb -cgi -cjk -concurrentmodphp -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd-external -gmp -hash -inifile -interbase -iodbc (-java-external) -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -solid -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlwriter -xsl -yaz" 8,882 kB

[ebuild N ] dev-php/PEAR-PEAR-1.9.0 285 kB

[ebuild N ] virtual/httpd-php-5.2 0 kB

[ebuild N ] mail-client/roundcube-0.3.1 USE="mysql spell ssl -ldap -postgres -vhosts" 1,873 kB

Once installed, you will need setup the database:

Login to mysql as root and run the 3 commands below (make changes to username and password)

CREATE DATABASE roundcubemail DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost IDENTIFIED BY 'password';
\q;

Import the tables etc:

mysql -uroot -p roundcubemail < /var/www/localhost/htdocs/roundcube/SQL/mysql.initial.sql

Edit the files in /var/www/localhost/htdocs/roundcube/config/

db.inc.php = Database details.  username, password and DB... nuff said!

main.inc.php = email server details and security.
Go through this file with a fine tooth comb.. there are many very important options.

Or you can enable the $rcmail_config['enable_installer'] = true; option in main.inc.php.  SET TO FALSE WHEN FINISHED!!!!!

You may need to enable $rcmail_config['auto_create_user'] = TRUE; for the first time login to create the user.  SET TO FALSE WHEN FINISHED!!!!!

Thats more or less about it for the installation.

Gentoo Multiboot CD

I've not seen this anywhere on t'interweb so this is what I have done so far which seems to work.

Only for arch x86 & amd64.

Tools & Files.

Syslinux Version 3.86 at the time of writing this.

Grub (more commonly used)

Gentoo (amd64, x86) You'll need the iso files.
Stage3 and portage archives are optional, but handy to get the install started.

Prep.

Create a folder somewhere.  This will be the root of the DVD

ISOLINUX METHOD

Unpack the syslinux archive.

cd in the syslinux directory and run "make".

cd back into the root of the DVD directory.

mkdir -p boot/isolinux

cp syslinux/com32/menu/vesamenu.c32 boot/isolinux (needed for boot menu)
cp syslinux/core/isolinux.bin boot/isolinux (needed to boot)

create isolinux.cfg in boot/isolinux (needed for boot menu)
put a 640x480 png image in boot/isolinux (optional background

GRUB METHOD

mkdir -p boot/grub

cp /boot/grub/stage2.eltorito boot/grub (needed boot image)
cp /boot/grub/splash.xpm.gz boot/grub (optional background picture)

create menu.lst in boot/grub (needed for boot menu)

put the stage and portage archives in the root folder of your CD. (optional)

touch livecd in the root folder of your CD. (needed for livecd to load)

mount each iso and copy the gentoo.efimg and image.squashfs files into the root folder of your CD.  (contains the gentoo environment)
I found here that you will need to rename the files.  I just replaced "gentoo" & "image" with the arch.
ie x86.efimg & amd64.efimg etc
copy the gentoo.efimg.mountPoint directory into the root folder of your CD.  (contains the kernel and initrd)
Again replacing the "gentoo" with the arch.

Create the ISO.

cd outside of the root of your CD folder and run

ISOLINUX METHOD

mkisofs -N -V gentoo -b boot/isolinux/isolinux.bin -d -iso-level 4 -no-emul-boot -boot-load-size 4 -boot-info-table -o Gentoo.iso gentoo-multiboot

(the isolinux.bin is in your CD root.  the gentoo-multiboot is the name of the root of your CD

GRUB METHOD

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o Gentoo.iso gentoo-multiboot

Testing.

I have qemu installed but any VM will do.

qemu -k en-gb -enable-kvm -m 1024 -cpu qemu32 -cdrom gentoo.iso -boot d

note: Add "-vnc :0.0" if qemu is on a remote server.  The just vnc to it :)

The new build

Well I thought it was about time to upgrade the MythTV box.  Poor thing couldn't play HD content and no AGP cards exist that can.  So it was a total rebuild.

The new specs are:

Intel core i5 650 (3.2Ghz Dual Core HT)
4Gb Corsair XMS3 DDR3
Asus P7H55-M PRO

Now to unpack:

The CPU:

CPU fitted:

Now for the heatsink:

heh.. I stood back and laughed at this :)

Something tells me this thing isn't going to fit.  OH ARSE!

Nevermind I thought, after rushing out and buying a cheap tower just to get me by.  Surprisingly, it was too big for that as well.  Looking into it, the heatsink is designed for large gaming cases.  Oh Fook.  So back I went with the case for a refund.
Being the stubborn git I am, I refused to be beaten.  I was using a "Scythe Mini Ninja Socket 478/775/754/939/940/AM2 Heatpipe Cooler" and thought if I could just adapt the fittings from the new "Scythe Mugen 2 Rev B For Socket 1366, 1156, 775, 478, AM3, AM2+, AM2, 940, 939, 754 Processor Cooler".
Call it an utter fluke, but the socket 1156 bracket fitted perfectly on the mini ninja.  None of the other brackets fitted at all.  PHEW!

Now to get this baby installed:

The harddrive is a 5400rpm 1Tb Western Digital eco.  The 2 x 120mm fans run on the slowest speed.  I need this PC to be very very quiet.  And it is.. very!

In conclusion, this is a very quick system now.  What used to take almost an hour to compile on the old P4 3Ghz, now only take a few minutes (and yes, I use Gentoo!)
HD 1080p playback is perfect.  To say the IGP (integrated graphics) is built into the CPU, this is amazing.  I'm very impressed if I do say so myself!

Update:  I've now installed RAID1 and an extra 4Gb RAM!.

Jack-3.1.1

Jack (not to be confused with the jackd audio daemon) is a cdripper for Linux written in python.  You can download via your package manager or from the homesite.  I have found on Gentoo and Fedora that jack depends on python-2.4 which is a pain when just about everything else builds against python-2.5 or higher which causes problems.  I was forever getting:

$ jack
Traceback (most recent call last):
 File "/usr/bin/jack", line 42, in <module>
 import jack_argv
 File "/usr/lib/python2.6/site-packages/jack_argv.py", line 22, in <module>
 import jack_utils
 File "/usr/lib/python2.6/site-packages/jack_utils.py", line 26, in <module>
 import jack_functions
 File "/usr/lib/python2.6/site-packages/jack_functions.py", line 222
 def starts_with(str, with):
                         ^
SyntaxError: invalid syntax

I had my fill of fixing this every time I needed to rip a cd, so I fixed it.  All you need to do after it has been installed is run this script jack python-2.6 patch

If you look at the script, you'll see that it just changes any definitions from starts_with to startswith.
Another common problem is a gcc memory leak.  To fix this add MALLOC_CHECK_=1 at the start of your command.  I have added this as an alias in my .bash_profile eg.

alias jackflac='MALLOC_CHECK_=1 jack --device=/dev/sr0 --append-year=yes --dir-template "%a/%l" -C -Q -R --rename-fmt "%n - %a - %l - %t" --workdir /home/cdstealer/Desktop/ -E flac'

alias jackmp3='MALLOC_CHECK_=1 jack --device=/dev/sr0 --append-year=yes --dir-template "%a/%l" -C -Q -R --rename-fmt "%n - %a - %l - %t" --workdir /home/cdstealer/Desktop/ -E lame --vbr=no -b 320 -e 2 --write-id3v2=yes'

Please make sure that jack and its dependencies have been built against python-2.6+.

dev-python/id3-py
dev-python/cddb-py
dev-python/pyogg
media-libs/id3lib
dev-python/pyid3lib
dev-python/pyvorbis
media-sound/jack

I edited the files below to add high quality and forced stereo.  Just add "-q0 -ms" to the end of the 4 line in each file.  eg:

'cmd': "lame --preset cbr %r --strictly-enforce-ISO %i %o -q0 -ms",
'vbr-cmd': "lame -V %q --vbr-new --nohist --strictly-enforce-ISO %i %o -q0 -ms",
'otf-cmd': "lame --preset cbr %r --strictly-enforce-ISO - %o -q0 -ms",
'vbr-otf-cmd': "lame -V %q --vbr-new --nohist --strictly-enforce-ISO - %o -q0 -ms",

/usr/lib/python2.6/site-packages/jack_helpers.py
/usr/lib/python2.6/site-packages/jack_main_loop.py
/usr/lib/python2.6/site-packages/jack_plugin_lame.py