MSE and HTTP Proxies

MSE seems to be the current flavour of the month virus checker, but it doesn’t use the same HTTP proxy settings other Windows software does.

After a bit of Googling I found this website which explains how to fix this. I have reproduced it below. There’s a few sites showing confusing methods involving manual updates which you don’t need to bother doing.

After installing MSE and the update has failed, open a dos box and type the following depending on your Windows version:
Windows XP

proxycfg -u

Windows Vista / Windows 7

netsh winhttp import proxy ie

If you get a permissions error, the DOS box needs running as the Admin user by right-clicking its icon and choosing “Run as Administrator”.

Posted in Howto | Tagged , , , , | Leave a comment

Microsoft Excel VLookups

I often have the need to match something like a student’s mark to a grade which lies within a boundary. For example a grade ‘A’ might cover marks in the range 100-90. I can never remember the correct way to do this, so here it is.

In the Excel spreadsheet, rename one of the worksheets to something appropriate, and type out the grades. They need to go in ascending order. The title of the columns doesn’t matter.

Enter the data required into a different worksheet and then set up the VLookup.

The VLookup needs its parameters subtly setting

  • Specify the range to do the vlookup on, but miss off the title row
  • Wrap the range in absolute cell reference markers (press F4 on them)
  • Either miss off the “Range lookup” parameter so it defaults to “True”, or set it “True”

I found this on this website which explains other uses for VLookup.

Posted in Howto | Tagged , | Leave a comment

links for 2010-07-13

Posted in Links | 1 Comment

Recover a corrupt sudo configuration

Modern Linux systems don’t have traditional root users – I don’t know what my root password is, and have never needed to type it in. Instead I use sudo to do superuser things to my system. I think we can partially blame Apple for this idea as my Ubuntu system operates in a very similar way to my Macbook.

The /etc/sudoers file controls the use of sudo, defining who can use it and what they can do. It’s managed by the handy command

sudo visudo

which starts up your favourite editor and allows changes to be safely made. Notice how you need sudo in order to be allowed to edit its configuration file. What happens if you damage your sudoers file by introducing a syntax error or removing a vital line by mistake?

Well… you’re somewhat stuck. You can’t log in as root because there is no root password, you can’t manually edit the sudoers file because it’s only readable by root, and you can’t start up a root shell using sudo… because it is probably confused and won’t let you run anything.

It’s quite easy to fix though, but you will need physical access to the machine, a keyboard and a monitor. The machine will need to be rebooted safely (a tricky task if you aren’t root).

I shall assume you have the grub bootloader, and are sat at the machine using a keyboard plugged directly into it, looking at a monitor connected directly to the machine. This won’t work over SSH.

First, switch the machine on and wait for the grub loader to prompt for a kernel to boot. Now press the e button to edit the grub config, a simple editor should appear.
Find the line that looks something like this

linux   /boot/vmlinuz-2.6.32-22-generic-pae root=UUID=afb72950-fffb-46e3-9d5b-4cf88eaa954f ro   quiet splash

and at the end, add the following text

init=/bin/bash

Now press ctrl-x to boot the machine. It will quickly boot into a very minimal system, nothing will be running apart from the shell and the root filesystem will be mounted read-only.

Remount the root filesystem read-write by typing

mount -o remount,rw /

Your root filesystem is now mounted read-write and you are the root user, you have full access to the entire boot drive and can do anything to it.

Repair your sudo config by typing

visudo

Now mount the root filesystem read-only so that it correctly syncs and clears the disk buffers – if you don’t do this, you could corrupt your filesystem

mount -o remount,ro /

Now reboot. Since the root filesystem is read-only, you can just press the computer’s reset switch, press ctrl-alt-del or even pull the power cord out.

Boot the machine as usual and see if you have correctly fixed the problem.

This technique will also let you recover from a corrupt boot sequence, change the root password on an older Linux system, and can also be used to reset any user’s password – for example if you have just acquired a second-hand Linux machine and don’t know its password. It’s also a good reason to keep your machine in a safe location – a few short keystrokes on the connected keyboard will allow anybody to modify your machine without leaving a trace beyond a reboot.

Posted in Howto | Tagged , , , , | 2 Comments

links for 2010-06-24

Posted in Links | Leave a comment