Technical Insanity

In every Microsoft operating system since windows 98 (It was installed as an extra, remember?) there has been Windows Update… the application. It sits there in your system tray and reminds you every 2 minutes that you have one update to install that affects something you never use, then waits for you to go get a cup of tea before forcefully restarting you computer, casually losing anything you were working on!

For those of you who follow this blog, you may have noticed this being posted before, but you may not have noticed that this is an update! When an update window is seen, the process is automatically terminated for you. This does not affect the normal updating of your computer, but merely stops it bugging you about the update, and stops it for restarting by itself. The result? When you return from getting your cup of tea you work is still on the screen of your computer with you music still playing, ready for you to continue using it… the way it’s meant to be!

This version is also developed to work with windows 7 and XP, although others should work! Requires .Net Framework v2.0 to work.

If you have any comments or suggestions, please comment on this post. You never know, it might just get added!

WAU-Controller-v2

Download here: WAU Controller v2.2.0.1

Edit 20/05/2009: Realised I didnt attach a licence to this little project, so let it be the lastest version of the GPL, which at present is v3.  :-)

Before I start this, it should be known I am relatively new to shell scripts, and while this may not be the best method by any means, it does work.

Everything needed is available here as a tarball, it should be placed in /etc/apt/ and unpacked using ‘tar -xvf source-switcher.tar’, running source-swapper.sh will get you set up. You will have to configure your sources files though!

My problem was this. I have a local repo on a machine in my house, which makes updating and installing a lot quicker that it used to be, let alone being fun to set up. My laptop however, is not always in the house for obvious reasons, and even when it is,  it’s not always connected to the network.

For this, I wanted a way of switching between sources.list files with as little user intervention as possible.

I already have a folder called ‘sources.safe’ which contains a different list for each location, and this is a listing so far:

1
2
3
4
root@ben-laptop:/etc/apt/sources.safe# ls -1
sources.CD-Rom
sources.Home
sources.Official

So I wrote this script which checks to see what repo is available, and copies the right sources.list and overwriting the one that is already there, and then notifies user 1000 (perfect for single user systems).

/etc/apt/source-swapper.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
 
apply()
{
export DISPLAY=:0.0
sudo -u \#1000 notify-send -u normal -t 10000 -i /etc/apt/apt.png "APT Source: $1" 'Your sources list has been updated for this network!'
cp "/etc/apt/sources.safe/sources.$1" '/etc/apt/sources.list'
}
 
if wget -t 1 -T 1 --spider http://192.168.0.200/; then
apply 'Home'
elif wget -t 1 -T 1 --spider http://archive.ubuntu.com/ubuntu/; then
apply 'Official'
else
apply 'CD-Rom'
fi

As you can see, the apply lines use the same extension as the sources files in the sources.safe folder. More scripts can be added by more else statements. This also allows prioritisation. Note that if all else fails it uses the CD-Rom sources list, this should allow me to have something to install from available at all times.

Also in my /etc/apt folder I created this script, which sets up the links in /etc/network/if-up.d and /etc/network/if-down.d so that the script runs when you ‘change location’.

/etc/apt/source-swapper-setup.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
 
echo 'Setting up links...'
 
link /etc/apt/source-swapper.sh /etc/network/if-up.d/source-swapper
link /etc/apt/source-swapper.sh /etc/network/if-down.d/source-swapper
 
echo 'making main script executable...'
 
chmod +x /etc/apt/source-swapper.sh
 
echo 'Installing dependencies...'
 
apt-get -y install libnotify-bin
 
echo 'should be done :-)'

A few things that should probably be noted. First is that the setup script will need to be set executable. If you decide not to use the setup script, make sure you manually apply its changes. The only other thing that have is the ‘package’ icon. That should be places in the apt folder as /etc/apt/apt.png, if you decide to place it elsewhere or which to use another image, you will need to adapt the script accordingly.

Here is the package icon. I got it from here: http://files.opensuse.org/opensuse/en/thumb/3/39/Icon-package.png/120px-Icon-package.png
120px-Icon-package

So, I thought this would be a little bit of fun aswell as a bit educational. I have some parts lying around, and I wanted to give this a shot. I want this system to be able to:

  • Burn ISO images of single layer DVD
  • Burn the contents of a folder to DVD
  • Duplicate discs
  • Create ISOs of discs to HDD or network

All of this should be available via a remote interface, and all options should be able to use multiple drives.

So thats the idea, first step is the hardware. Here are the components I will be using:

  • Lian Li case (It was recently made redundent) (4x 5.25″ bays 2x 3.5″ 3x 3.5″ HDD bays)
  • 350W PSU (Not branded)
  • 300W PSU Codegen
  • PSU Tester (to bring the second PSU online)
  • AOpen AK77 Pro-A 133 Motherboard
  • AMD Athlon 2100+ XP
  • Arctic Cooling Copper Silent 2 (CPU Heatsync and Fan)
  • 512MB DDR 400 (That’s PC3200) (Thanks to Steve Peace (http://www.stevepearce.info))
  • nVidia GeForce MX-440 8X 64MB
  • Realtek RTL8169S Gigabit Ethernet NIC (Unfortunately no boot ROM)
  • Fujitsu MPC3065AH (6.5GB) IDE – This will be the system drive
  • Maxtor 90651U2 (6.5GB) IDE – Temp drive (For disc images)
  • Pioneer DVR-109 IDE
  • Sony NEC Optiarc AD-7170A IDE (Only reads/writes DVDs – It was free)
  • Toshiba Samsung SH-S182 IDE
  • NEC ND-3550A IDE
  • iTE IT8212F IDE Controller (2 channel)
  • Floppy Drive (was already in the case, dont need the bay and I can’t see a blanking plate)
  • 2x 120mm fan

As I have a floppy drive, might consider grabbing that as a boot record…

Ok, so I’ve hooked it all up, and mounted the PSU on the top of the case (temporarily) with cable ties and black tape.

NAB-Build-InternalNAB-Build-FrontNAB-Build-Rear

( Click pics to see bigger versions )

Now that its all together, lets see if it boots!

It didn’t at first, but I reseated the memory and now it runs as expected. Now for the software!

I need this link to be active.

Here is a link over to the project page, I will edit this post soon!

http://projects.viperfang.net/vipernas/