Posts related to the the demoscene group I am involved with – Brainstorm
Posts related to the the demoscene group I am involved with – Brainstorm
In the next few weeks, this bad boy will be shipped off to the datacenter and installed in it’s rack, so the site can receive a much-needed upgrade.
If you want to check out CVGM and listen to some great oldskool computer game music, check out http://www.cvgm.net Thanks!
Recently I purchased a new Dedicated server box running Ubuntu 8.10 / DirectAdmin and needed to transfer a bunch of my stuff to it. One of the sites I needed to trandsfer was CVGM ( http://www.cvgm.net ) which is powered by Django / Python / Mod_WSGI. I couldn’t find many instructions on the net on how to complete the task easily, so after I figured out how to do it, I wanted to post my results here so that other people who need the same kind of help can find the post and maybe use it 🙂
The DirectAdmin default setup uses a customized version of Apache in order to work, and as a result, it’s not as simple to work with/customize as a regular install of apache. To give you an example, if you would apt-get a module (such as mod_wsgi) that relies on apache2 as a dependency, it thinks apache2 isn’t even installed, so be careful! The global config file for the DirectAdmin apache is /etc/httpd/conf/httpd.conf and I should point out that right now, you should not edit anything in this file whatsoever!!
First, we need to install the Apache module for Mod WSGI. I copied a version of the file from a copy of 8.10 Server I installed on a VM to make sure it matched the same system requirements (Python 2.5) however you can always build one, or obtain one from somewhere on the net. Once I built the file, I copied it to /usr/lib/apache/mod_wsgi.so on the dedicated box.
There are two ways that you can proceed to activate the module, and i’ll explain both ways. The 1st way is probbably more beneficial if you plan on running multiple WSGI applications, whereas the second is better if you just plan on running a single site and you don’t want to initialize it for every thread your apache creates.
Enabling As Global Module
This is the simplest method of enabling the module. Open the following file for editing:
There should already be a line in there for PHP, so we only need to add the following line underneath it:
LoadModule wsgi_module /usr/lib/apache/mod_wsgi.so
Save and Exit the file, if you restart the httpd instances within DirectAdmin, they will all have access to mod_wsgi features.
Setting up a VirtualHost to run a WSGI Application
I’d like to point out here that we are manually editing/changing the automated VirtualHost information generated from within DirectAdmin, so DirectAdmin might change it all back again if you go to edit anything through the admin panels. Remember, when it works, back it up in case that does happen!
The VirtualHost lists are defined in a user’s httpd.conf file, so to edit the list for your site, run the following command:
vim /usr/local/directadmin/data/users/[UserName]/httpd.conf (Replacing UserName with the user account name set up under your site)
Modify the top portion of your Vhost file to look like the following, with your own WSGI settings of course:
# Frontpage requires these parameters in every httpd.conf file or else # it won't work. ServerRoot /etc/httpd WSGIDaemonProcess ProcessName threads=25 WSGIProcessGroup ProcessName <VirtualHost *:80> ...
Inside the VirtualHost container, you will add your actual WSGI code as such:
# Load the WSGI adapter just for this VirtualHost, if you choose not to enable it # Globally. Do not add this line if you added the module globally!! LoadModule wsgi_module /usr/lib/apache/mod_wsgi.so # Set up Aliases to Django admin, and our own static files Alias /media/ /usr/share/python-support/python-django/django/contrib/admin/media/ (path might vary on your setup) Alias /static/ /path/to/static/ <Directory /usr/share/python-support/python-django/django/contrib/admin/media> (path might vary on your setup) Order deny,allow Allow from all </Directory> # Direct root to our WSGI script file WSGIScriptAlias / /path/to/file.wsgi <Directory /path/to> Order deny,allow Allow from all </Directory> <Directory /path/to/static> Order deny,allow Allow from all </Directory>
Save the changes to your VirtualHost. I would like to point out here, that for CVGM I chose to comment out completely the same VirtualHost entry for SSL (port 443). My site has no use for SSL, and duplicating this code in the 2nd VirtualHost (which is what would happen if edit the Custom HTTPD for this domain in DirectAdmin) will cause an error for already having being called once.
The WSGI file for your project is created in pretty much the standard way:
import os, sys sys.path.append('/path/to') sys.path.append('/path/to/ExtraPath') os.environ['DJANGO_SETTINGS_MODULE'] = 'ProcessName.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
Save it, double check the paths to the files and then restart httpd in DirectAdmin. If all goes well, the site should fire right up! If you start getting 503/500 errors, check the error.log file in the DirectAdmin viewer for a detailed description of what is happening. If there are no errors in the log, it’s not WSGI causing the problem, it’s something else in your code.
Common Error With Mod_WSGI and DirectAdmin
Depending on which version of DirectAdmin you are using, you may run into a massive slap-in-the-face 503 error regarding misconfiguration, and the error log will tell you something like: “No such file or directory: mod_wsgi (pid=7295): Unable to connect to WSGI daemon process”.
If you do run into this problem, you can try one of two things in the virtual host file. Here is a quote directly from Graham Dumpleton on the WSGI homepage explaining the problem and the solution ( http://code.google.com/p/modwsgi/wiki/ConfigurationIssues#Location_Of_UNIX_Sockets ) :
“To resolve the problem, the WSGISocketPrefix directive should be defined to point at an alternate location. The value may be a location relative to the Apache root directory, or an absolute path.
On systems which restrict access to the standard Apache runtime directory, they normally provide an alternate directory for placing sockets and lock files used by Apache modules. This directory is usually called ‘run’ and to make use of this directory the WSGISocketPrefix directive would be set as follows:
Although this may be present, do be aware that some Linux distributions, notably RedHat, also locks down the permissions of this directory as well so not readable to processes running as a non root user. In this situation you will be forced to use the operating system level ‘/var/run’ directory rather than the HTTP specific directory.
Note, do not put the sockets in the system temporary working directory. That is, do not go making the prefix ‘/tmp/wsgi’. The directory should be one that is only writable by ‘root’ user, or if not starting Apache as ‘root’, the user that Apache is started as. ”
So, you would change the top of the VirtualHost to read something along the lines of:
WSGISocketPrefix /var/run/wsgi WSGIDaemonProcess ProcessName threads=25 WSGIProcessGroup ProcessName
After restarting Httpd in DirectAdmin, it should clear up the problem!
This was a post I had originally made a long time ago (November 2009), so I have edited/replaced it here for completeness, as I get a lot email requests about it. I don’t use this setup any longer, and use a dedicated box for CVGM which solved a lot of other issues that I was having at the time, and of course the dedicated box is running a much newer Ubuntu distribution. Thanks!
With 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!
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!
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)
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!
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!
Evoke 2010 was awesome this year 🙂 Lots of great demos, great competitions and many great people 🙂 Truly a party to remember 🙂 It was extra special for me, as Zine was released there. The parties held by our fellow Brainstorm goats were also unforgetful, and I absolutely cannot wait until next year!
Yes of Brainstorm took some great pictures, you can find them Here.
Again, thank you to everybody who worked on zine to get it ready in time. It was a show that wont be forgotten!
I guess it is safe to say at this point that the secret project I have been working on for the last few months was Zine 🙂 Zine is a demoscene based disk magazine filled with articles and information on the demoscene and demoscene-related productions. Zine #14 is now available for immediate download. The pouet page (where you can download, as well as comment) can be found Here. Enjoy!
Zine is the first project I worked on after joinging the group Brainstorm, and has been more than a year in production on and off. Most of the work was done on the issue in the last 6 months or so, with a lot of last minute changes and implementations in the last 40 days or so until release making this one of the most challenging projects that I have ever worked on. Last minute stuff always works the best, eh? 🙂 In a positive note, it’s also the first issue to go multi-platform, working on Windows, Mac and Linux! \o/
Overall, im OK with this production. There was a shed load of features and things that I needed to get in and working, but simply didn’t have time. They will have to go into the upcoming issues to meet my personal “This rocks” meter – Unfortunately, if I can see or think of problems that exist in a production, I tend not to think too highly of myself.
Zine #14 was released at the Evoke 2010 demo party, which I attended with my wife epec. It was truly amazing to be stood on the stage in front of all those people talking about something I had worked on. Then throughout the party, looking at peoples screens and monitors to see them reading and talking about the issue. Very inspiring, and made me feel good to have produced something people liked to read 🙂 Evoke really inspired me.
The Zine team wasn’t just myself, I would like to thank the following people and individuals for their help and contributions to the issue (and I apologize if I forget anyone!) :
Axel – Chief editor of Zine
Menace – Co-Editor of Zine with Axel, both responsible for article content and chasing down articles etc.
Epec – Copy Editor & Production Assistant. Her contributions to articles and scheduling were invaluable on this project, and it would have failed without them.
Prm – Responsible for all article and issue layout graphics once a base layout had been devised and coded in.
Prowler – Artist who composed the opening picture in such a short time period, at the same time he was opening a gallery of some of his other works, including the oil painting our picture was based on.
Bit Arts – For creating those wonderful intro & outtro jingles on such short notice.
And the Musicians who contributed to this issue:
Hansee, Mikael Fyrek, c-jeff, Scott and Willbe
My Family – For putting up with my shit this last year as I worked on this project!
Shoecake – Your work on Dexter is invaluable, my friend! I wish you could have been there!
bpoint – Thanks for the last minute code tips and info, even though we couldn’t use most of them in the end, I thank you for being there while I was still awake at 5am fixing this stuff
deathy – Always my voice of reason when I needed to vent 🙂
Brainstorm – You guys fucking rock!
The Evoke 2010 party page is now active and accepting registrations. You should scoot your ass over there and sign up for one of the best demoparty’s in Germany!!
We will be there and unveiling something great. I can’t wait to meet you all!
I will be attending Evoke 2010 this year, and I will also be bringing something very special along with me to unveil, although you will have to be there to truly see what it is!
Evoke this year will be held on August 27th – 29th at Abenteuerhallen Kalk in Cologne, Germany. I will be attending with many of my fellow goats from our group Brainstorm. We are mostly all staying in the Leonardo hotel, with a few most likely ending up in the Best western hotel, also near to the venue (but I believe that the Leonardo is actually a little closer). Come join us for a beer or 8, because you should!
Watch the official invitation demo:embedded by Embedded Video