mail me! sindicaci;ón

Archive for August, 2009

Shock N97 News!

N97 newspaper

Just read this whilst at work today – surprising, yet somehow expected.

How to tell Link Speed in Linux

I could have sworn that ifconfig used to tell me what link speed a connection was established at, but I must have been imagining it (?)…

root@box:~# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:11:11:82:9e:8c
inet addr:192.168.x.10 Bcast:192.168.69.255 Mask:255.255.255.0
inet6 addr: fe80::211:11ff:fe82:9e8c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2515495 errors:0 dropped:0 overruns:0 frame:0
TX packets:1007536 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3552713819 (3.5 GB) TX bytes:81240550 (81.2 MB)
Interrupt:16

Anyway, after a quick install (apt-get install ethtool) ethtool tells you a host of things, including Link Speed:

root@box:~# apt-get install ethtool
root@box:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes

Now the real question is why am I only achieving 5.2MB/s via Gigabit… Samba perhaps?

25 hours remaining to transfer 339GB =/

Update: My bad, should have never have suspected Samba without first checking Windows :$ Windows is only connected at 10/100 for reasons as of yet unbeknownst to me…

SharePoint Search Issue

Following a standard SharePoint install (WSS 3.0) you may receive the following error when carrying out a search:

The Web application at http://[URL to SharePoint]/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

This is due to internal DNS mappings not being mirrored within SharePoint. That is, your DNS server may resolve http://sharepoint.local to 10.1.1.1, but SharePoint (or at least the search service) is only listening to requests on http://servername.local.

To add the CNAME within SharePoint, follow the instructions below:

This presumes you are configuring the search for internal searches – you can easily alter the instructions below for external mappings.

1. Login to the SharePoint server via RDP
2. Administrative Tools > SharePoint 3.0 Central Administration
3. Click ‘Operations’ in the left-hand menu pane
4. Click ‘Alternate access mappings’ under the ‘Global Configuration’ header
5. Click ‘Add Internal URLs’
6. Select ‘SharePoint – 80′ from within the ‘Alternate access mapping collection’ drop-down menu.
7. Type the full URL you require in the space provided. For example http://sharepoint.company.com
8. Select your required zone – for our example we select ‘Intranet’. Click Save which should then take you back to the mappings list.

SharePoint search should now work!

Redirect *all* BASH errors

A friend helped me out with a shell script I’m currently creating. I was trying to avoid having to append 2> to the end of every command within the script, and lo-and-behold my friend knew a way: use the exec command.

If you run exec with no arguments, all redirects apply to the current shell, so placing:

#!/bin/bash
exec 2> $errorlog
errorlog=”/var/log/custom.log”

Worked a treat!

Installing Debian on an old Sony

This post gives brief details on reviving an extremely old Sony Vaio PCG-505TX and loading the Debian net installer via floppy disk

I was recently given an old Sony PCG-505TX, with a monster spec of Pentium 300 MMX and 64MB of RAM. Whilst most phones come with a more powerful processor and more RAM nowadays, you can’t* install Debian on a phone, and the keyboard on the laptop still makes it a winner.

However, with only a floppy disk drive at my disposal, I had limited choices with what distribution to install. Luckily, whilst Debian is no longer released with floppy disk netinst images, the old Etch repo’s still contain them. I’ve uploaded them here in case the etch repo’s are ever dropped.

The old HDD in the laptop had also died, so I decided to replace it with a 10GB relic from an old ThinkPad I had lying around. After removing all the screws from the base of the unit, I was still unable to pry the keyboard away from the shell. After ten minutes of Googling I stumbled upon this site, which gave me the final clue – I needed to remove the ‘hinge caps’ from around the hinges of the monitor.

To do so – you need to apply a fair bit of force, you may think you’re about to break the plastic – but as long as you’re only using your finger(nail)s you shouldn’t worry. Just pry each end of the cap away until it finally succumbs to the pressure. Following that there should be no more screws to unscrew, just lift the keyboard gently away – note that you’ll have to release the clips holding the three ribbon cables in place.

With the new hard drive installed and the floppy images written to disk – I booted up with the ‘boot.img’ floppy inserted. The installation is pretty painless, and it will prompt you for each disk in turn. I had both a PCMCIA 10/100 network card installed and a USB network jack installed, and to my surprise both were detected and installed correctly once I’d loaded both ‘net-drivers’ disks.

The installation took about an hour, and I decided to forego installing X during the initial installation. After first boot-up I had 31MB out of 64MB free =)

Stupidly, I then did a:

apt-get install xorg xfce4

A couple of minutes later and following a startx, I was presented with a somewhat basic, but functioning, X windows environment. However, doing a free -m revealed that I only had 1MB of RAM free - so X was promptly uninstalled.

I'm soon to buy a new battery for the unit so it can act as my permanent portable console.

* This probably has been done!

Simple CUPS issue

This post applies to Ubuntu 9.04 Server and cupsys v1.3.9-17. It details a quick fix for a problem when adding a printer after a standard apt-get install.

I’ve recently installed CUPS on one of my Ubuntu servers using apt-get:

root@box:~# apt-get install cupsys

Following the documentation over at the CUPS project homepage, I issued the following command to add my stalwart HP LaserJet 6MP (connected to the network by an even older JetDirect 500X):

root@box:~# lpadmin -p LaserJet -E -v socket://192.168.x.110 -m laserjet.ppd
lpadmin: Unable to copy PPD file!
root@box:~#

A quick check of the logs (/var/log/cups/error_log) revealed:

E [20/Aug/2009:21:42:01 +0100] [cups-driverd] Unable to open “/usr/share/cups/model/laserjet.ppd” – No such file or directory

So, simple fix – find where laserjet.ppd is hiding and copy it to that directory:

root@box:~# find / -iname laserjet.ppd
/usr/share/ppd/cups-included/HP/laserjet.ppd
root@box:~# cp /usr/share/ppd/cups-included/HP/laserjet.ppd /usr/share/cups/model

And hey presto, CUPS works – that’ll hopefully save someone five minutes of digging!