FishGuy876

FishGuy876

Programmer, Geek, Beer Drinker

Home page: http://www.cvgm.net

Yahoo Messenger: FishGuy876

Jabber/GTalk: FishGuy8765

AIM: FishGuy876

Posts by FishGuy876

Dual-Booting Kubuntu Alongside Windows 7 Without Wubi – Properly!

0

Windows 7/Kubuntu Dual BootThe hard drive took a major dump in my laptop this weekend, left it backing up some stuff while I went to go see Tron, and when I got home it sounded like a DJ was scratching some kind of new rap tune. Needless to say, the drive was on its way out, but luckily I have been able to recover almost all of my data so far 🙂

After installing a replacement hard drive, I thought it was about time that I put a dedicated linux partition on this system as I have been using Kubuntu to do some Android development (installed via Wubi). While Wubi is nice for messing around, it isn’t the most stable system to be using and I have had a couple of disasters in the past with it messing up my virtual partitions. Wubi also has some known bugs, where after installing inside Windows, you’ll get a message about no root filesystem being defined and that you should fix it in the partition manager. Nice, if you can actually get there to do it!

So, I installed Windows 7, left 40gb of free space intentionally for Kubuntu. After the process of doing all the software installs and updates etc. for Windows I thought that I had better take a shot at installing the Linux side of things. Boy, what a mess 🙂 Firstly, there is something about the partition layout in Windows 7 that GPartEd just cannot see them (even using the GPartEd Live CD, or any LiveCD including Kubuntu). It thinks my hard drive is completely unpartitioned. Not what I was expecting, as I was hoping I could just throw some linux partitions into the free space, and then install. Very confusing 🙂 Adding any changes at this point would erase my new Windows 7 partition instantly.

I remember something a friend told me years ago about partitioning, that he had once used Linux to do the partitioning of his drives for some wierd XP install, as the Windows tools at the time were quite shit, so I figured that to get this to work the way I want it, I should probbably attempt something similar. I didnt really have much to lose (besides sitting through a few hundred megs of Windows Updates) so I went ahead and prepared the partition in GPartEd.

An important thing to remember here is the partition table. You must go into the Partition Table section and create a new ms-dos partition table, otherwise if you don’t it may try and use GPT by default (which won’t work with Windows 7). If you try to install Windows 7 without this partition type change, it will pop up a Warning message when you try to select the partition, and clicking Details will tell you that it cannot install on a GPT partition. So, after this step (which will completely zap your entire drive) I proceeded to create an NTFS partition, leaving 40gb free space for Linux later on. After applying the partition changes, booting the Windows 7 installer and installing windows by selecting the NTFS partition I just created, I was then able to reboot with a KUbuntu LiveCD and work with the free space on the drive correctly! It will even mount the Windows partition (just remember to hit Yes on the option to Unmount it duringi the Kubuntu install). Even grub works well and offers Windows 7 as an option in the boot menu.

When installing Linux with manual partitions, remember to add a swap partition at least 2x the size of the available ram in the machine, and the rest can then be an ext4 partition (that mounts to /) and thats the minimal that Kubuntu will need in order to boot correctly. Grub takes care of the rest of the issues with booting and selection etc. as most of Grub resides in the liunux part.

I am sure that several people have had problems trying to get the dual booting to work correctly, so I hope that this helps at least one human being out there who has struggled with this as long as I have.

And So We End 2010 :)

0

NOW! ScreenshotWith the end of 2010, now is the time after all the wild parties and heavy drinking to look back on the year that just ended 🙂 Overall, I think it was a great year with many of my personal achievements accomplished 🙂

The year began with a very big bang for me as I had started working on Zine at the beginning of the year. Zine was to be my first big contribution to the scene in a very long time, since my Amiga days actually, and I was very excited to be able to travel to Evoke in Germany and see it unveiled, talk to the people who read it, and cook a few sausages for people attending the release party. I got to meet a lot of cool people, a lot of people who I idolized as a spotty nerd teen, and most of my fellow Brainstorm guys. I was also proud to get Bit Arts and Romeo Knight (musicians from the Red Sector Megademo) together in the same room for beers \o/ Lots of beer, tears and laughs were had that weekend 🙂 It was definitely my greatest moment this year and I can’t thank everyone who helped on this project enough! Issue 15 will appear some time soon! [Zine #14 Page | Pouet Link]

The next big personal acheivement for me came with working with Ultrasyd on a last-minute Amstrad CPC project called NOW! I spent most of my early life developing on the Sinclair Spectrum and I had wanted to get back into 8-bit coding for quite some time. The Spectrum & Amstrad are very similar in design. Syd and Fenyx Kell composed the music for the project, and I threw a very basic interface together in about 2-3 weeks to get the release ready for Main party. Boy were we shocked when we scored a 3rd place win! Completely unexpected, as we weren’t really trying to win anything 🙂 Again, the feeling was great to see the video being played on the big screen, and watching people’s reactions. Great job guys 🙂 [NOW! Page | Pouet Link]

Another project I was proud to be involved with this year was the Alien Invasion music disk supported by Nectarine, and coded by maep. This disk took the 4sceners.de award for the best music disk of 2010. Nectarine is a demoscene web radio station, using the Demovibes codebase that I work on with Terrasque (Project Page). Congratulations to everyone involved, especially maep who stayed up late to talk to me, and for working so hard on the project! [Pouet Link]

Unfortunately, I didn’t get to release any new games this year though I have been working on some projects. I have been working a lot on the new Piles’O’Tiles engine, which i’m not sure yet when it will be ready. I have also started working on some Android code, so I am hoping to be bringing some of my games to this exciting platform. The first game released will most likely be Jelly Othelly, but I may change my mind in the future with that and release something else instead, like Piles’O’Tiles.

I am pretty sure I have forgotten to add something epic to this post, so I apologize ahead of time and will keep editing it as time goes on to thank all the great people that helped me this year. It’s time to enjoy a bit of 2011 with a large pint of beer and a compiler!

FishGuy876

Immutable Drives In VirtualBox On Windows

2

I have been playing with VirtualBox for the last day or so now, and I am very pleased with the way that it works so far. Feels snappier to me than VMWare did, but maybe thats just me 🙂

One of the more useful features I found in VirtualBox is immutable hard drives. These are drive images that never change, so to speak. Any data that is written is saved to another drive containing only changes, so if you have lots of VM images for many different projects (like I do) you don’t have to install an OS on each of them; Just make a differencing disk and only make it the size of the changed data (such as programs and updates etc.) Brilliant!

It took me a while to figure out how to make an immutable disk on Windows, as the GUI is not very friendly towards this process. You should start by making a new Virtual Machine with the desired OS (I used Windows for the time being) and create a new hard drive image for it. From that VM, proceed to install Windows as you normally would do, activate it and install all your Windows updates and tools you wish shared to your multiple machines. For me, this is mostly just Windows, all the updates, and Altap Salamander.

Once this process was done, I proceeded to delete all temporary files from the system, a bunch of un-necessary Windows files, and ran a defrag on the drive using PerfectDisk to make sure everything was at it’s peak performance.

In order to make the drive immutable, we have to perform several steps to it. Firstly, I compressed the VDI image to make sure the file was as small as possible. While cloning will do this for us as well (described later) I wanted to keep the original image small in case I needed it for something else in the future. VirtualBox is great in that you can control it via the command line. Open a Command Prompt and change the folder that you installed VirtualBox and run the VBoxManage command with the modifyhd command, followed by the VDI file and the compact command:

This may take a few minutes to complete, but if the file has lots of empty space in it, that will all disappear after the process is complete. Next, we will make a clone of the disk. Again, I chose to do it this way so I could keep the original for something else in the future. Cloning a drive is very simple to do, using the clonehd command and the filename of the source VDI, and a filename of a target VDI. Cloning is an important step, as VirtualBox won’t allow you to use the same VDI file copied to multiple locations, the cloning process changes the internal drive GUID so that the clone can be added as a seperate drive. In VMWare in the past, i’d have huge VMDK files that I would just copy to a new VM and launch from there, which also resulted in much larger files being used than what was actually necessary. I cloned the drive using the following command:

VBoxManage clonehd "Windows XP Pro 32-Bit.vdi" "Windows XP Pro 32-Bit - Immutable.vdi"

Which will produce a new VDI file that we will use with our future VM’s:

If you go back to the Media Manager in VirtualBox, click on Add and add the newly created VDI file to the list of volumes. Everything should match except for the name. The next step is to mark this as an immutable drive, so VirtualBox recognizes it as such. This is done with the modifyhd tag as follows:

VBoxManage modifyhd "Windows XP Pro 32-Bit - Immutable.vdi" --type immutable

And if you refresh your Media Manager folder, you will see that the drive type is now set to immutable:

So, now that we have an immutable drive we should probably try and use it 🙂 To do this, simply go back to the VM management and create a new Virtual Machine for Windows as you did before. Now when you get to the part where it asks about the Hard Drive, choose an existing drive and select the Immutable image, You will notice that it has a blue spot next to it, signifying that it’s immutable:

After the VM is created, click Settings and go to Storage, select the Immutable drive and place a checkmark in the box for differencing. This will cause a new hard disk name to appear. Click OK to accept the changes, then launch the VM. It will boot to the same way as it did before, except its not using the old image. Make sure it boots OK then go ahead and shut down the VM so we can make some changes.

Some Notes About Differencing

Typically, drives that use differencing disks will “forget” the changes made to them once the VM is restarted. This is the case here by default, once you boot with a differencing disk, any changes made will be lost when it shuts down. This protects the original disk, and prevents anything from changing in it. Its always easy to see which VM’s use immutable drives, if you go to the Media Manager there will be an expandable arrow next to the main drive, which contains all the differencing disks from the various VM’s that use that specific immutable drive.

Differencing disks can be changed to allow them to retain their changes after the VM shuts down. In the console, simply run the following command (exchanging the GUID for the one found in your media manager) :

VBoxManage modifyhd cfcb7143-af07-40ff-89b1-c953bfacaebb --autoreset off

The filename should match the GUID and is located in the Virtual Machines folder/{Machine Name}/Snapshots folder. Mine is {cfcb7143-af07-40ff-89b1-c953bfacaebb}.vdi respectively.

After that, any changes written to the disk will remain permanent! I hope this helps someone out there with a similar situation, and that this helps then understand it a little better 🙂

Recent Experiences With VirtualBox – Better Than VMWare :)

0

I would like to thank my friend bpoint for getting me into using VirtualBox instead of VMWare, I am already finding it far more useful and saved considerable amounts of disk space 🙂

VirtualBox is a virtual machine system that allows you to install additional OS’es into virtual machines, including Windows, Linux, and even Mac!

Im sure I will blog about it more when I learn how to use it properly and all that good stuff 🙂

Fuel Pump Problems On My 1993 Ford Escort

0

Last week has been a really bad week for problems on my car. Started last Monday after the damn thing broke down while out to lunch. Despite having a full tank of gas, I couldnt get it to start. A similar problem happened the Thursday before when I thought I had ran the car out of gas; And after filling it with a Jerry can it was able to start again, but I was still quite sure it wasn’t empty. Anyways, I couldn’t do much in terms of repairs, so had to have it towed back to the house.

Turns out the Fuel Pump/Sending Unit is the culprit. After removing the cover to mine, I could see that it was extremely rusted, so rusted in fact that it didn’t take very much effort to break off the old locking ring instead of unscrewing it. Inside, the whole thing was heavily corroded and it wasn’t any wonder as to why it didn’t work anymore! Junkyard Time! Went to EZ Pull & Save junk yard and pulled another pump for $15 and spent all day Sunday installing it.

Unfortunately, the install didn’t go as smoothly as I would have liked. Due to the excessive rust on the old systems, the new lock rings would not correctly seal, and so when I would test drive the gar it would pour gas out of of the top of the new seal! After several attempts and cleanings, I have it sealed well enough that it now only leaks just a little amount of gas when the tank is very full and swishing about. Will re-seat it another day when I have time and energy to do so 🙂 If it continues to leak ever so slightly, I may need to replace the fuel tank =/

Win32 – SDL Loses Sound When The Main Window Loses Focus – Fix

0

So, I ran into an interesting problem this week while working on the “Alien Invasion” music disk that causes all sound to be disabled when the main SDL window would lose focus or become hidden. This could be a bit of a problem for a music disk, so I looked into trying to figure it out for myself.At first I tried the usual SDL culprits, which are the event system for handling focus, but no luck there.

After some poking around in the SDL source code, I was finally able to find a fix. In SDL_dx5audio.c you can change the following function to read:

void DX5_SoundFocus(HWND hwnd)
{
    // This makes sound audible regardless of focus being lost
    //mainwin = hwnd;
}

A better solution long-term in SDL will be to have an option to do this, rather than having to change the code, or just have this enabled by default. We’ll see! This was tested on 1.2.14 which is available to download from http://www.libsdl.org Hopefully someone else can find this useful too 🙂

Converting Databases To UTF8 Format From Latin1

1

I have been putting off the inevitable the last couple of weeks, which was the task of converting the database for CVGM.net to UTF8 from the default collation of latin1-swedish-ci. I am not the best when it comes to administering MySQL via command script, and phpMyAdmin didnt do the job properly of conversion for me. After a bit of googling, I found a bash script at islandlinux that was able to help me out considerably:

#!/bin/bash

DATABASE=$1

if [ ! "$DATABASE" ]; then
echo "Please specify a database"
exit
fi

BACKUPDIR="/root/tmp/mysql_backups/"

if [ ! -d "$BACKUPDIR" ]; then
mkdir -p "$BACKUPDIR"
fi

BACKUP="$BACKUPDIR""$DATABASE.sql"

mysqldump --add-drop-table --extended-insert "$DATABASE" > "$BACKUP"

TABLES=`mysql --batch --execute 'SHOW TABLES' "$DATABASE" | grep -v "^Tables_in"`

for TABLE in $TABLES; do
echo 'ALTER TABLE `'"$TABLE"'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;';
# uncomment the following line to process the commands
#mysql --execute 'ALTER TABLE `'"$TABLE"'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' "$DATABASE"
done

This script converted the database tables and everything under it to the correct format. It also backs up the databases first in case something decides to take a crap on you. The problem I had with phpMyAdmin was even though I changed the collation to utf8_general_ci it didn’t do it recursively into the tables and the fields underneath it.

Thanks for the script guys 🙂 You saved me even more work!

Automatically Restarting Apache2 Via Cronjob If It Crashes

0

I have been having an issue with my trac server that causes random apache2 crashes, and as of late I haven’t been able to figure out exactly what is causing them, seems the server just seems to automagically turn off at random intervals.

This is a script I put together to test if any of the apache2 executables are currently running:

#!/bin/sh
run=`ps ax | grep /usr/sbin/apache2 | grep -v grep | cut -c1-5 | paste -s -`
if [ "$run" ];
then
echo "Apache2 is running"
else
/etc/init.d/httpd start
fi

The script checks to see if they are, and if it can’t find any running tasks it will attempt to restart apache2. Install this to a crontab every couple of minutes, and it should cause Apache to auto-restart in the event of a crash. Works well on the trac server anyways 🙂

NOW! Amstrad CPC Music Disk Released At Main Party 2010

1

NOW! Screenshot NOW! is a music disk I have been working on in collaboration with Ultrasyd and Fenyx Kell for the Amstrad CPC 128K system. The music disk features 12 awesome music tracks, and was coded in a little over two weeks before I get settled into working on Zine again. This is my first production on the Amstrad (and also the first CPC project for Brainstorm) that was any good (as I did a bit of BASIC many moons ago), I have played with a friends system many years ago as a kid, but this is the first piece of code I have written on the system that hasn’t been utter shite. I am very pleased with the outcome of this project, and the music is amazing 🙂

I started working on this project on Sept. 13 with Ultrasyd, as the people who were supposed to write him a music disk had bailed out of the project. I took it on as a challenge, realizing the path would not be straight and easy, plus I have been looking for an excuse to get back into 8-bit development for quite some time 🙂

The project is written using Z88DK (available HERE) and uses C and Z80 Assembly language. I used CPCRSlib for some of the graphics code, mixed with a bit of my own dodgy code. The music replayer is by Targhan and available HERE.

There were many technical challenges on this project. The biggest was the small amount of RAM available to the system at any one time, certainly not enough to hold all the music let alone the program and the data it needed to run. At one point, I spent 2 solid days working on getting 5 tunes in and working without crashing the computer, when I realized a mistake I had made in some code earlier that would allow me to hold many more. So at around 4pm yesterday I was able to fit all 12 songs into the production without a problem. Nothing quite like a last second fix for a production thats due to be released the very next morning 🙂 Many thanks to Ultrasyd for staying up late on the CVGM OneLiner to get this thing finished in time for Main (and showing it off to the Amstrad community there). There is also a hidden, 13th tune 🙂

Download the DSK file Here. To run, insert the disk and type RUN “NOW!” to start the music disk. Up & Down arrow keys to change between music. Escape to quit. If you wish to run this in an emulator, I recommend using JavaCPC or WinAPE. This disk has been fully tested on real 6128 Hardware (Thanks again, Ultrasyd!).

Full Production Credits

Music: Ultrasyd/BRS and Fenyx Kell
Graphics: Yes/BRS (Loading Screen), Ultrasyd/BRS (Main Picture)
Code: FishGuy876/BRS
See the TXT file on the DSK/Zip for a full list of everyones greetings and thanks 🙂

EDIT: The music disk was entered into the Wild compo at Main and ranked in 3rd place!!! Fantastic! \o/ Congratulations to everyone again! It can also be found on Pouet now, where you can comment and rate it! Thanks!

Main Party 2010 – Working On A Project With Ultrasyd

0

While I won’t be at Main Party this year, Ultrasyd will be, and to mark the occasion I am working on a project with him for some Amstrad CPC music he has written along with Fenyx Kell. We are putting together a music disk that will be released at the party, featuring my code and Ultrasyd’s music and gfx. This will be the first Amstrad CPC project I have work on in almost 16 years (and that was using BASIC code!).

The new disk will be written using the z88dk compiler, which turns raw C code mixed with assembler into Z80 code that can be used on the Amstrad, ZX Spectrum, and many other Z80/Z88 based computers. Its a very exciting project for me, as I have been itching to get into 8-bit development again for quite some time! I will post more on this project as it is released!

FishGuy876's RSS Feed
Go to Top