Thursday, 7 July 2016

Old PC: RAM and CD Drive

My next job for this PC is to get a modern Operating System installed. This was hampered by both of the CD drives being non-functional. To compound this problem, USB booting is not supported by the motherboard and so that avenue for getting an operating system installer booted up was not an option.

So on to repairing the CD burner drive. When you press the eject button, but the tray would not slide out and would only move slightly. Aparently this is a fairly common fault with older drives and cleaning a little belt will fix this. There are loads of youtube videos out there for this problem, here's the one that I used. After doing my cleaning, the drive was back to normal.

The second thing that I looked into was increasing the RAM which was 1GB of PC2700 non-ecc RAM. More RAM is always better, especially with applications getting more and more RAM hungry as time goes by. According to specs for my ASUS A7V333 motherboard, the maximum RAM that I can install is 3GB - this is a 32 bit machine after all and I have three RAM slots. I went through a friends spare RAM collection and found a spare 1GB PC2700 memory module. Feeling lucky I installed it onto the motherboard and booted it up. The RAM was detected without any drama and it now has two 512MB and one 1GB memory modules to make a healthy enough total of 2GB RAM.

Choosing an operating system is next on my list, front runners are Debian, and Arch. In the next post I'll hopefully have an Operating System installed and will be testing system performance.

Saturday, 25 June 2016

Old PC: Resurrection

I want to get my old PC going again which has been in storage for the past 6 years gathering dust. It has a 32bit AMD 2.1GHz processor (AMD rated 3000+) with 1GB RAM and 160GB hard disk. I think I bought it at the end of 2003 or beginning of 2004. It's not ancient, but still old enough.

Up to now I have been using a modern and powerful multicore i7 laptop on a daily basis. It suits my needs but I still miss a desktop for various reasons - I want a large monitor with a high resolution, I want a proper keyboard, I want to be able to use a dual monitor setup for coding on. But the biggest reason for getting it up and running is, just for the hell of it :)

Here's the specs:

CPU: AMD Athlon XP 3000+ (barton) 32bit
RAM: 1GB PC2700 DDR-333Mz
Motherboard: ASUS A7V333
Graphics: Nvidia GeForce FX 5950 Ultra
Hard Disk: Seagate Barracuda 160GB, 7200 RPM
Sound Card: Soundblaster audigy 5.1 (SB0090)
Speakers: Creative labs 5.1 surround sound speakers
Network: D-link 100Mbps network card, and a MODEM
    3.5" internal floppy disk drive
    Medion dvd ReWritable (DVR-106DB)
    Samsung CD RW 24-10-40 (Model SW-224)

This was a top of the line gaming rig when I bought it and had the best graphics card that I could purchase at the time. The CPU got upgraded at some stage - I think I originally bought the PC with a 2600+ processor and upgraded it later on. The DVD re-writer was added later on too.

After booting it up for the the first time since 2010, there's few jobs that immediately presented themselves. I found a dualboot setup with Windows XP and Ubuntu 9.10 on it and neither would boot. I don't want to keep either OS and so a clean OS install will fix this. Both the DVD and CD drive will not work and so need to repaired or replaced. I need to get a monitor - the original LG 19" CRT Flatron monitor was a beast and i think went to the re-cycling centre for being too heavy. A cheap wireless network card would be a good investment too.

I'm interested to see how it all pans out - especially when a decent monitor and the 5.1 surround sound speakers are hooked up. I think it will be perfectly usable running GNU/Linux with a moderately light desktop environment - it's not totally ancient after all.

The end game is to have a fast and usable PC with some form of GNU/Linux or BSD running on it. I'll do a couple more posts with some updates on the project as things progress.

Friday, 5 February 2016

Deploying Google Chrome with CFEngine 3

This post describes how to install Google Chrome with a CFEngine 3 and provides a ready-made bundle for download written by yours truly.

Deploying chrome is fairly straight forward, and about the only thing that you need to watch out for is how to get the Google apt signing key distributed and installed on each target machine.

To get the key installed onto each of my target machines, I took the approach of downloading the key manually and saving it to a text file on the cfengine policy hub - CFEngine then replicated this file automatically to each of the target client machines. A promise then executed the debian 'key-add' command to install the key.

This promise bundle also adds the google deb archive, and performs the google chrome install using the built in apt package manager.

Step 1
Download the promise file from here and save it to your CFEngine policy server.

Step 2
Create a subdirectory called 'files' and save the google key in a file called chromekey.txt.

A variable called $(this.promise_dirname) is used to access the chrome key file from within the bundle. This means that the key file always exists in a subdirectory relative to the chrome promise bundle and makes specifying absolute paths to the key file un-necessary.

Thats pretty much it. It will take a little while for google-chrome to install because CFEngine is usually configured to run apt-get update once every 24 hours. Allow for that much time to elapse before starting to troubleshoot.

Happy CFEngining

Wednesday, 20 January 2016

Troubleshooting CFEngine 3 client machines

Here's a couple of operational tips that I have gathered together when running CFEngine 3. This page is mainly for finding out why a client did not get a particular promise applied and so these commands are geared towards being run on client machines for troubleshooting.

Is the service running?

For systemd systems:

  systemctl status cfengine3
for System V init systems:
  /etc/init.d/cfengine3 status

How do I know if all the promises have been kept on a client?

Run the following command on a client machine

  tail -f /var/cfengine/promise_summary.log
You will see two things, the outcome of which is how many of the promises have been kept on the machine, and secondly the outome of it tells you if any new promises have been downloaded from the policy hub. The outcome of is the main one that we want to see at 100%

Promise Directory Locaton

This is where the promises kept on a client, you may want to inspect these files to see if the client has pulled down a promise or template file from the policy hub.

You should find that all promise and template files get synced to the client, even those promise files that do not get executed or apply to the client. Compare the files here with the files on the policy hub.

Manually run the cfengine rules on the client

This gives output straight to the screen for you to read. Any errors will be displayed on screen.

  cf-agent --no-lock --inform -f /var/cfengine/inputs/

Find out the current environment

We use different environments, as described in the "Learning CFEngine 3" book. To see what environment applies to a client, we have written a bundle to write the environment string to a file. Then all you have to do is inspect this file on any client to see which environment is in effect. Here's the bundle:

  bundle agent current_environment_info
          "curr_environment" string => "/etc/current_environment";

              create => "true",
              edit_defaults => empty,
              edit_line => write_environment_string;

  bundle edit_line write_environment_string
              "Environment: $(";