BigSmoke

Smokes your problems, coughs fresh air.

Page 31 of 52

MediaWiki thumb.php and rewrite rules

May, last year, I created an empty draft for this post, because, around that time, I had gone through quite some effort before I got thumbnails for foreign file repos working just right. Now, I’m taking a dive into my MediaWiki working dirs in preparation of the creation of a separate development environment, so it’s a good moment to rehash the past experience (almost as good as when I’d have done it right away).

This is how I configured the foreign file repo to be able to use images uploaded to the English wiki from the Dutch wiki:

$wgHashedUploadDirectory = false;
 
$wgForeignFileRepos[] = array(
    'class' => 'ForeignDBRepo',
    'name' => 'en',
    'url' => "http://wiki.hardwood-investments.net/media",
    'hashLevels' => 0,
    //'thumbScriptUrl' => "http://wiki.hardwood-investments.net/thumb.php",
    'transformVia404' => true,//!$wgGenerateThumbnailOnParse,
    'dbType' => $wgDBtype,
    'dbServer' => $wgDBserver,
    'dbUser' => $wgDBuser,
    'dbPassword' => $wgDBpassword,
    'dbName' => 'hardwood',
    'tablePrefix' => 'mw_',
    'hasSharedCache' => false,
    'descBaseUrl' => 'http://wiki.hardwood-investments.net/Image:',
    'fetchDescription' => false
);

To make thumbnails be generated by thumb.php on request I added the following to my .htaccess at the other end (and visa versa, because the Dutch wiki actually contains most of the images):

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^media/thumb/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2 [L,QSA]

Creating an Unreal Tournament 99 server in Linux

(Post edited to reflect the steps required for the 451 version of the server, which has some crucial bug fixes, among which a working webadmin.)

I created an Unreal Tournament 99 server using this page as a guide (I may update that page myself soon, to help out others). However, I had to do a lot more, so here is the info:

First get and unpack the UT server, the 451 patch and the server utility script:

wget http://ut-files.com/Entire_Server_Download/ut-server-436.tar.gz
tar -zxf ut-server-436.tar.gz ut-server
wget http://www.ut-files.com/Patches/UTPGPatch451LINUX.tar.tar # May be changed to .tar.bz2 by the admins soon
tar xfj UTPGPatch451LINUX.tar.tar
wget http://ut-files.com/Entire_Server_Download/server_scripts/asu-0.6.tar.gz
tar -zxf asu-0.6.tar.gz
chmod +x asu.sh System
ln -s libSDL-1.1.so.0 libSDL-1.2.so.0

Because of some error (as described), map names with ][ in them, like DM-Deck16][, are 0 bytes. So, you have to copy them from some other UT installation. 2399Skillz on the forums said he’ll fix it, so it might be fixed at some point.

Next, you can run the asu.sh script. Choose option “I”, to install. Most important thing is to choose the username it will run under (not nobody as it suggests). The rest is obvious.

The script will have made an ucc.init file. Important to know is, that the path of the server is set in it. So, if you want to move the server to another dir, you have to change that file. The path name is mentioned several times.

Next you want to enable the webadmin. You can do that by opening UnrealTournament.ini, going to the [UWeb.WebServer] section and setting bEnabled=True and choose a port (5080 is standard):

[UWeb.WebServer]
Applications[0]=UTServerAdmin.UTServerAdmin
ApplicationPaths[0]=/ServerAdmin
Applications[1]=UTServerAdmin.UTImageServer
ApplicationPaths[1]=/images
DefaultApplication=0
bEnabled=True
ListenPort=5080 

When going to the webadmin, be sure to include /ServerAdmin/ in your address bar, because otherwise it will try to redirect you to that, using a HTTP redirect, but that will fail because the server has no idea you’re using an internet hostname and therefore it will redirect you to it’s LAN-IP, which obviously won’t work if the server is not in your LAN. Apache has config parameters to set the redirect hostname, but this webadmin doesn’t.

As a security precaution, patch 451 adds brute force protection to the admin login. See the file Releasenotes.htm in the Help dir for more info. In the Engine.Gameinfo section, a few rules should be added/modified (depending on whether they’re already there or not):

[Engine.GameInfo]
(snip)
...
LoginDelaySeconds=1.000000
MaxLoginAttempts=50
ActionToTake=DO_KickBanPlayer

The server (at moment of writing) has special net-textures, to reduce the size of the installation. Problems my occur when clients are using the high-res textures (see aforementioned topic). To solve this, copy the normal CD1 textures to the server dir.

I was under the impression that the asu stuff would take care of setting the environment properly so the files can be found, but when trying to start the server, it complained about not being able to find it’s data directory. It started doing that after applying the 451 patch, so that might be the cause. To fix it, I added this line below MYUSER=User.ini in ucc.init:

UT_DATA_PATH="$MYDIR/System/"

However, it might not be necessary when you apply the patch before you extract the asu scripts. I applied the patch after, so that may have been the difference. Try without this modification first.

You can start the server by “./ucc.init start”. Or stop by “./ucc.init stop”. Or restart by “./ucc.init restart”.

Default e-mail addresses for domains

Sometimes automated services or people need to contact some domain administrator for a certain domain. There are a couple of addresses that should be present by default. Google uses these addresses to notify you when they put you on their malware blocklist:

  1. abuse@
  2. admin@
  3. administrator@
  4. contact@
  5. info@
  6. postmaster@
  7. support@
  8. webmaster@

I think I need these for my domains to be present by default:

  1. abuse@
  2. postmaster@
  3. hostmaster@
  4. webmaster@
  5. root@

Learning PC assembly language

Over the years, I’ve made a few half-hearted stabs at learning assembly language. In doing so I’ve discovered this great PC Assembly Language textbook by Paul Carter. Last October, Halfgaar and me took this free book as a starting point to rediscover the joy of programming.

Bareboot with ugly colors

Bareboot with ugly colors

Today, I’m getting reacquainted with what we did last fall. I’m also looking at some stuff that Halfgaar added without me. After fetching and merging his latest changes, I’m now greeted by the image of a nude person of the female persuasion with a somewhat psychedelic color palette.

The first goal of our assembly learning project was to have a bootable beauty, a simple disk-image of sorts which we can boot with Bochs or another emulator to display an image of a girl. Halfgaar has the lead because he crafted an 8-bit BMP image (with what he thought to be a proper color index), and he modified our code to traverse and display the image pixel by pixel.

Now I want to find out why the color palette of the image doesn’t quite match the BIOS’ palette, but, while I know the latter must be somewhere on Wikipedia, I’m having trouble finding it again… I can’t even find the nicely organized list of all the BIOS interrupts and arguments which we used to learn how to draw colored pixels. I’m left wishing that I wrote this post while I still knew where to find all this information.

Can you save me some googling, Halfgaar?

Very, very old homepage

Today, in the images-that-I-stumble-upon-somewhere category: an image of a very old homepage that I hosted at my ISP back in the day:

Old bigsmoke @Home homepage

I’m not even entirely sure if I was already pulling this stuff together with XSLT. Probably I was, because I vaguely remember that this was one of the alternate CSS styles and I can’t imagine myself adding more than one <link> tag to every source file. 😉 (Unlike a sense of esthetics, laziness is deeply ingrained in every somewhat decent programmer.)

« Older posts Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑