Archive for May, 2007

axel - what an awesome little app

Usually I use ncftp to transfer files around, as it has cool recursive put & get features. But recently, I needed a command line ftp client with some form of rate limiting. This is because, over 100mbit LAN, files can come across very fast (10MB/s), which will result in a disk getting slammed, and even in DMA mode, the CPU getting sucked away.

A quick search in google for “linux ftp client limit speed” revealed a little utility called ‘axel‘ (A light download accelerator for Linux.).

$ axel -s 500000 http://example.com/somedisk.iso

Will download the somedisk.iso file at 500KB/s.

Axel has a few other features too, like max connections, etc.

The well know ‘wget’ also has a rate limiting feature “–limit-rate=RATE”, but I forgot about that parameter until after I wrote this post.. and besides.. typing “-s 500000″ is a lot quicker then “–limit-rate=500000″.. :)

I guess this post is more of a note to myself, rather then being a informative/useful contribution to the Internet blogging world.. Oh well..

SC/BW versionchecks for PvPGN

Surprisingly, Blizzard released an update today, for their Starcraft/Broodwars game - v1.15.

Who would have thought, 9 years on (released in 1998), there would be an update? Not me! The last update (1.14) was released about the same time last year, so it’s not like this is the first one in agers. The reality is, that the game is huge in Korea. To put it in perspective, a quote from wikipedia “popular in South Korea, where professional players and teams participate in matches, earn sponsorships, and compete in televised matches”.

Anyway, onto the guts of this post. If you’re a server administrator of a PvPGN server then you’ll have to make some adjustments to your versioncheck.conf, to make you’re server compatible with the new update. You can do this by reading your server logs, extracting the checksum/mod dates, and so on. I’ve just done this (for the EGN PvPGN server), and tested it, and it all seems to work. So below are the versioincheck extracts for any other PvPGN server admins out there.

# Starcraft - Brooadwar (Expansion) 1.15 - (Brooadwar mode)
"A=2521522835 B=3428392135 C=218673704 4 A=A^S B=B-C C=C+A A=A-B" \
"IX86ver1.mpq" \
IX86 \
SEXP \
"starcraft.exe 05/08/07 19:13:26 1220608" \
0x000000d1 \
0x010f0001 \
0xc9ca8bc3 \
SEXP_115
</code><code>
# Starcraft - Broodwar (Expansion) 1.15 - (Starcraft mode)
"A=2521522835 B=3428392135 C=218673704 4 A=A^S B=B-C C=C+A A=A-B" \
"IX86ver1.mpq" \
IX86 \
STAR \
"starcraft.exe 05/08/07 19:13:26 1220608" \
0x000000d1 \
0x010f0001 \
0xc9ca8bc3 \
STAR_115

I’ve posted it here, because the PvPGN forums are down, and there doesn’t seem to be anywhere else to post it.

Max files open

Recently, the EGN PvPGN server has become flooded with users, due to the Bored Aussies pvpgn server going down (apparently the guy is moving location).

Anyway, in coping with the flood of players (some 1000+), we ran into a few problems.

One of these was that there is actually a limit to the number of files simultaneously open in Linux (usually 1024). This is both for security (i.e. DOS with memory) and safety reasons (infinite loops, etc). Keep in mind that when a program opens sockets, it opens them to devices, which are also treated as files. So each user theoretically will have its own socket/file, so if you have >1000 players on a server with a filelimit of 1024, you’re going to hit a wall.

The way around this is of course is to increase the limit. I looked around for a while on how to do this, but couldn’t find an exact solution. The final fix was two config adjustments from two different sites.

This page: “Changing the maximum allowed file size (ulimit)” explains how you can add “ulimit -n 4096″ to the “/etc/profile” file to increase the ulimit each time someone logins to a new shell.

And this page: Fun with user limits explains how to set privileges in your “/etc/security/limits.conf” file, so users can actually change their ulimit.

Once these changes are made, the user and any previously run processes need to be re-logged in/restarted.

Thanks to d1zzy (core pvpgn developer) who educated me on the whole ulimit thing.