Browny's Grotto :: http://www.clan-elite.info/

News headlines

Headlines: [ view archive ]
Play Outcast with WINE - 30th of June 2008
Gentoo progress - 24th of March 2008
Compile bsnes on Ubuntu Feisty - 3rd of September 2007
Velleman K8055 and Linux - 20th of August 2007
Bugfix - 25th of October 2006

News articles

Repair GRUB after installing Windows
- Posted 20th of May 2009, 2:50 pm by Mr.Brownstone

Use the following method if you have recently needed to reinstall your Windows partition on a dual-boot Ubuntu/Windows setup. (Note: These instructions are not limited to Ubuntu only. Most any flavour of Linux and dual/multi-boot configuration can be repaired with few or no tweaks to the procedure.)

1. Boot from a recent Ubuntu installation CD (or Live CD.) Choose to "Try Ubuntu" without installing it from the boot menu.

2. Open a terminal.

3. Determine where your Ubuntu partition is using fdisk:

Bash Script:
sudo fdisk -l
It's probably the first partition with a "System" of type "Linux." In this example I will use /dev/sda6 as the Ubuntu partition, where /dev/sda is the hard-disk that contains your dual/multi-boot setup.

4. Mount it:
Bash Script:
sudo mkdir -p /media/ubuntu
sudo mount /dev/sda6 /media/ubuntu

5. Run grub-install with the root-directory option set:
Bash Script:
sudo grub-install --root-directory=/media/ubuntu /dev/sda

Reboot and you're done.

Comments on this article: 0
Last comment by: Mr.Brownstone, 20th of May 2009, 2:50 pm
- [ Back to top ] -

Windows XP Home - Repairing freezes on "Installing Network"
- Posted 18th of May 2009, 12:31 pm by Mr.Brownstone

I recently had this problem trying to fix an old laptop running Windows XP Home. I found a solution here: http://www.pcmech.com/forum/showthread.php?t=139698 but I ran into a snag of my own when trying to run Task Manager.

The message Task Manager has been disabled by your administrator popped up when I tried to follow the guide. I suspect this is a curiosity of the XP Home disc, but it was easily fixed by running the Registry Editor and changing the appropriate flag.

The whole process is documented below for reference:

1. When stuck at 31/32 minutes, press SHIFT-F10 to bring up a command-prompt (yes, that one's news to me, too.)

2. Type taskmgr and press ENTER. If the Task Manager appears skip to step 3. If you get a warning, continue to 2a:

2a. Type regedit and press ENTER.

2b. Navigate to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System. You will see a value labeled DisableTaskMgr and its value will be set to 1. Double-click on it and change the value to 0.

2c. Close the Registry Editor and return to the Terminal window. Type taskmgr and the Task Manager should appear this time.

3. Look for the process(es) in the Processes tab that are hogging all the resources (ie, greater than 90% CPU, huge memory usage, etc.) and causing setup to freeze. If you don't see any, your setup may not have actually frozen yet. Patience, grasshopper!

4. Click "End Process" on each rogue process once you're sure they are causing problems. Setup should start making progress quickly after you've killed the right process.

5. Setup may freeze again at the 13 minute mark. If it does, simply repeat from step 1.

Do not be trigger-happy about loading Task Manager and killing processes. Ensure the that setup has frozen by waiting 30 minutes to 1 hour before acknowledging that yes, it really doesn't have 31/32/13 minutes to go!

Comments on this article: 1
Last comment by: Mr.Brownstone, 19th of May 2009, 1:10 pm
- [ Back to top ] -

Gentoo: gcc update problems + solution
- Posted 1st of April 2009, 3:18 am by Mr.Brownstone

A recent emerge --update --deep world performed an upgrade of gcc. This was fine in itself; the problems came after running emerge --depclean, which removed my old gcc version and invalidated my current gcc profile.

But I did not actually realise gcc was broken until I tried emerging something else, and even then I did not immediately look to my gcc configuration!

Solution
These are the steps you should take when faced with upgrading gcc:

1. Before installing a new version, check that your current gcc is configured correctly:

Bash Script:
linux # gcc-config -l
linux # gcc-config 1

2. Install new version:
Bash Script:
# Manually:
linux # unset GCC_SPECS
linux # emerge gcc

# Or through a world update:
linux # emerge --update --deep world
linux # emerge --depclean
linux # revdep-rebuild

3. Update your environment:
Bash Script:
linux # source /etc/profile

4. Running gcc should now report no profile related errors:
Bash Script:
linux # gcc
gcc: no input files

Symptoms
The following errors are symptomatic of a broken gcc:

1. Problems emerging new software:
Bash Script:
linux # emerge geoip
...
configure: error: C compiler cannot create executables
See `config.log' for more details.

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-libs/geoip-1.4.5/work/GeoIP-1.4.5/config.log
 * 
 * ERROR: dev-libs/geoip-1.4.5 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2627:  Called econf '--enable-shared'
 *               ebuild.sh, line  543:  Called die
 * The specific snippet of code:
 *   			die "econf failed"
 *  The die message:
 *   econf failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-libs/geoip-1.4.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/geoip-1.4.5/temp/environment'.
 * 

2. emerge --info reports that gcc cannot be found:
Bash Script:
linux # emerge --info
!!! No gcc found. You probably need to 'source /etc/profile'
!!! to update the environment of this terminal and possibly
!!! other terminals also.

3. gcc-config -l reports that your gcc profile is invalid:
Bash Script:
linux # gcc-config -l
 * gcc-config: Active gcc profile is invalid!
 [1] x86_64-pc-linux-gnu-4.3.2

4. Trying to switch gcc profiles with gcc-config 1 gives the following warning:
Bash Script:
 * Switching native-compiler to x86_64-pc-linux-gnu-4.3.2 ...

 * Your gcc has a bug with GCC_SPECS.
 * Please re-emerge gcc.
 * http://bugs.gentoo.org/68395

>>> Regenerating /etc/ld.so.cache...                                                                                                                                                                                                                                                                                 [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   # source /etc/profile

5. Typing gcc on its own reports:
Bash Script:
linux # gcc
gcc-config error: Could not run/locate "gcc"

Comments on this article: 0
Last comment by: Mr.Brownstone, 1st of April 2009, 3:18 am
- [ Back to top ] -

Replacing a faulty drive in an mdadm managed RAID5 array
- Posted 15th of December 2008, 11:35 pm by Mr.Brownstone

Taken from elsewhere for my own notes:

1. Use "mdadm --manage /dev/md0 -r /dev/sdd" to remove the drive that was marked as faulty from the array.

2. Power down and replace the drive with a good drive.

3. Power up and set the partition table on the new drive to match those of the other drives in the array. Here we used "sfdisk -d /dev/sda | sfdisk /dev/sdd".

4. Add the proper partition on the new drive into the array, "mdadm --manage /dev/md0 -a /dev/sdd2"

5. Sit back and wait for the recovery to happen, you can "cat /proc/mdstat" to watch its progress; you should see something like:

Bash Script:
Personalities : [raid5]
md0 : active raid5 sdd2[4] sdc2[2] sdb2[1] sda2[0]
731985408 blocks level 5, 256k chunk, algorithm 2 [4/3] [UUU_]
[===>.................] recovery = 19.7% (48253056/243995136) finish=59.1min speed=55184K/sec

Comments on this article: 4
Last comment by: Mr.Brownstone, 24th of December 2008, 4:08 pm
- [ Back to top ] -

Play Outcast with WINE
- Posted 30th of June 2008, 1:18 pm by Mr.Brownstone

Image.

Outcast is a PC video game from 1999 by the now bankrupt Appeal, and was distributed by Infrogrames. At the time it was Windows-only, but today you can get your retro-fix on Linux thanks to developments with WINE.

Here are instructions on how to get Outcast working in Ubuntu Hardy Heron, although you will not have too much trouble transferring them to other distros:

Installing WINE: You will need a patched version of WINE 1.1.0 in order to fix the mouse-look problem. This problem affects other games, too. Fortunately, the patch adds an optional ENV flag, so you will not affect your other WINE applications with it.

1. Install the build-dependencies and patching utility:

Bash Script:
sudo apt-get build-dep wine
sudo apt-get install patch


2. Download the WINE 1.1.0 source to your HOME directory "~/" and extract it:
Bash Script:
mkdir ~/wine-dev
cd ~/wine-dev
tar xvf ~/wine-1.1.0.tar.bz2 -C .


3. Download this patch (original post) to your HOME directory and apply it:
Bash Script:
cd ~/wine-dev/wine-1.1.0
patch -p0 < ~/wine-force-mousewarp.patch


4. Compile WINE. This will take a long time!
Bash Script:
./configure
make
sudo make install


5. Configure WINE:
Bash Script:
winecfg
# Applications > Windows Version > Windows 98
# Graphics > Allow DirectX apps to stop the mouse leaving their window
# Audio > OSS Driver
# Drives > Autodetect... (make sure it picks up your CD-ROM drive!)
# Press OK


Installing Outcast: The following guide presumes you own a genuine copy of the game. You should be able to pick it up in most bargain-bins for about £5 these days.

1. Insert Disc 1.

2. Preparation: There exists a bug in the installer on the CD-ROM which, on a modern Windows system and even through WINE, will cause the game to be immediately uninstalled after completing DirectX tests. Appeal released a new installer to fix this, but it is not necessary to use it.

To get around the bug you simply need to delete the Uninst.isu file that is created during installation. You should keep a second terminal-window open so you can do this easily:

Bash Script:
# Terminal 1
# Install the game as normal (use the default settings)
# Assumes D:\ is how WINE detected your CD-ROM drive
wine "D:\Setup\SETUP.EXE"

# Terminal 2
# Once the installer starts copying the game-files, run
# this command to delete Uninst.isu when it exists.
# The game takes a little while to install, so you should
# not need to rush the process
rm ~/.wine/drive_c/Program\ Files/Outcast/Uninst.isu


3. After installation you will need to modify the shortcuts that start the game. The default shortcuts run this command:
Bash Script:
env WINEPREFIX="~/.wine" wine "C:\Program Files\Outcast\Outcast.exe"


Change them to this:
Bash Script:
env WINEFORCEMOUSEWARP="yes" WINEPREFIX="~/.wine" wine "C:\Program Files\Outcast\oc\loader.exe"


The WINEFORCEMOUSEWARP option was introduced in the WINE-patch you applied earlier. You can use it to fix other games that have problems with mouse-look (there are many!)

4. Download the Zip-file outcast_loader.zip from this page. Extract the contents to "~/.wine/drive_c/Program Files/Outcast/oc"

5. That's it! Insert Disc 2 and run the game!

Post-installation notes:

1. The winecfg option "Graphics > Allow the window manager to control the windows" prevents you from using the Escape-key to stop the credits when you want to exit the game. You can disable this option to allow you to exit the game quickly, but this will affect other in-game buttons (the save-game button F2 will no longer work, for example.) The workaround is to wait for the credits to finish, or ALT+Escape back to your desktop, open a terminal-window and run wineserver -k to kill the game. Unfortunately this will leave your desktop in a low-resolution, and it is tricky to change it back.

2. It is written elsewhere that you will need to use a native amstream.dll file to run the game properly. I found this was not necessary, but you do need to make sure you configure WINE to emulate Windows 98.

Comments on this article: 0
Last comment by: Mr.Brownstone, 30th of June 2008, 1:18 pm
- [ Back to top ] -

Gentoo progress
- Posted 24th of March 2008, 8:38 pm by Mr.Brownstone

This article is a backup of a thread I posted elsewhere, and partially documents the installation of my Gentoo server.

Click "Comments" to see the whole thread.

Comments on this article: 18
Last comment by: Mr.Brownstone, 4th of January 2009, 2:34 am
- [ Back to top ] -

Crackling sound in ZSNES on Ubuntu Feisty
- Posted 3rd of September 2007, 10:30 pm by Mr.Brownstone

Still on a retro-gaming bender, I reinstalled ZSNES recently only to find out why I abandoned it in the first place: Bad sound quality on my system.

After much digging I think I've finally stumbled on the solution, so here's the lowdown on getting ZSNES up-and-running from source: (This assumes you've already downloaded it from the ZSNES site and have extracted it to an appropriate place.)

Bash Script:
# You'll need SDL if you don't have it:
sudo apt-get install libsdl1.2-dev

# Configure, make and install ZSNES
./configure --enable-libao --enable-release
make && sudo make install

Now try it out by running zsnes at the command-line. If you get bad sound, you'll need to try another SDL sound driver. By default Ubuntu uses libsdl1.2debian-alsa, but you have two other choices that may fix sound for you. All three are listed below:

Bash Script:
sudo apt-get install libsdl1.2debian-alsa
sudo apt-get install libsdl1.2debian-oss
sudo apt-get install libsdl1.2debian-esd

Installing any one of these drivers will automatically uninstall the others. The esd driver worked for me. oss gave me no sound at all, but generally works for most of the people I've seen in the Ubuntu forums.

Comments on this article: 1
Last comment by: Mr.Brownstone, 28th of June 2008, 11:20 pm
- [ Back to top ] -

Compile bsnes on Ubuntu Feisty
- Posted 3rd of September 2007, 1:28 pm by Mr.Brownstone

bsnes aims to emulate SNES hardware as closely as possible, and as of 4th August 2007 it claimed to achieve 100% compatibility with all commercially available games.

Trying to compile version 0.022 on Ubuntu 7.04 Feisty Fawn I came a cropper on a couple of dependencies, so here they are for anyone else who's interested in trying out bsnes:

Bash Script:
sudo apt-get install libxv-dev libao-dev

That's it! You can now compile bsnes with the usual make command from the directory you extracted the tarball to.

Be warned that bsnes needs some serious grunt to work at full-speed -- a Core 2 Duo will get you a decent framerate, and I have to switch on frame-skipping to about 2-3 on my single Athlon 64 3000+.

Comments on this article: 0
Last comment by: Mr.Brownstone, 3rd of September 2007, 1:28 pm
- [ Back to top ] -

Velleman K8055 and Linux
- Posted 20th of August 2007, 2:46 am by Mr.Brownstone

Miles off-topic, but perhaps I can be forgiven since this is my first post on this site for nearly a year. Grin.

If you're interested in amateur electronics, you may have heard of Velleman and their excellent kits, and you may also have heard of their K8055 USB Experiment Interface Board.

Unfortunately Vellemen only provide Windows drivers and examples for this great little project, but help is at hand for Linux users over at this site:

http://libk8055.sourceforge.net/

One of the issues highlighted is giving the device the correct permissions using hotplug when it is first plugged-in. If you are using udev instead, follow this procedure:

1. Build your K8055. Razz.

2. Plug it in and find out its Vendor and Product ID. You'll need to install usbutils for this:

Bash Script:
# Install usbutils in a Debian-based distro (eg, Ubuntu)
sudo apt-get install usbutils

# Install usbutils in Gentoo
emerge usbutils

Now type lsusb at the command-line and you should see some output with a line similar to this:

Bash Script:
Bus 002 Device 052: ID 10cf:5500 Velleman Components, Inc. 8055 Experiment Interface Board (address=0)

Take a note of the two numbers separated with a ":" following "ID". These are the Vendor and Product IDs respectively.

3. Create a udev rules-file /etc/udev/rules.d/40-k8055.rules and paste the following into it:
Bash Script:
# udev rules file for Velleman K8055 USB Experiment Interface Board
#
SUBSYSTEMS!="usb", ACTION!="add", GOTO="k8055_rules_end"

# The K8055 device, including all jumper configurations             
ATTRS{idVendor}=="10cf", ATTRS{idProduct}=="5500", GROUP="k8055", MODE="0660"
ATTRS{idVendor}=="10cf", ATTRS{idProduct}=="5501", GROUP="k8055", MODE="0660"
ATTRS{idVendor}=="10cf", ATTRS{idProduct}=="5502", GROUP="k8055", MODE="0660"
ATTRS{idVendor}=="10cf", ATTRS{idProduct}=="5503", GROUP="k8055", MODE="0660"

LABEL="k8055_rules_end"

You can see that there is one line using the Vendor and Product IDs we picked up with the last command (10cf and 5500), and lines beneath it that use different Product IDs (5501, 5502, 5503). This covers all of the "address" settings made possible by the SK5 and SK6 jumpers. If your IDs are different for some reason simply copy-paste one of the existing lines and change the numbers accordingly.

4. Save the file and restart udev:
Bash Script:
/etc/init.d/udev restart

5. Now you must create a group called k8055 and assign your own Linux username to it:
Bash Script:
groupadd k8055
usermod -a -G k8055 <your_username>

You may also want to assign the k8055 group to root, although this is not necessary.

6. Reconnect your K8055 and you're ready to go! (Note: If you get warnings that k8055 could not open the device using your normal login, you may need to restart your machine to give udev a kick.)

Comments on this article: 0
Last comment by: Mr.Brownstone, 20th of August 2007, 2:46 am
- [ Back to top ] -

Bugfix
- Posted 25th of October 2006, 3:45 pm by Mr.Brownstone

Oops... Upload-links were broken. Curse.

Comments on this article: 0
Last comment by: Mr.Brownstone, 25th of October 2006, 3:45 pm
- [ Back to top ] -