Windows 7 freezing every few seconds – culprit found

August 15th, 2010 Darkimmortal 3 comments

This issue plagued my old computer for most of its lifetime while on Windows 7 x64 – every 5-10 seconds, everything but the mouse cursor and any sound being played would completely freeze for about half a second. This was most noticeable by youtube videos lagging, flash/gif animations suddenly freezing or wildly varying in framerate, and while dragging windows around. It also rendered most FPS games and Osu completely unplayable.

After building a new computer and reinstalling Windows (which in hindsight, I should have done first), the issue disappeared for about a month and I was thoroughly happy with my purchase. Then, just after installing the Bitdefender 2011 beta, a similar issue appeared. Programs were taking considerably longer to load, and the freezing began again. No problem, I thought, I’ll just uninstall Bitdefender. Which I did, even using their uninstall tool (the fact that they even have a special uninstall tool at all is quite worrying). But no good, my brand new PC seemed to be doomed to a life of not ever being truly usable for any multimedia task, be it gaming, watching videos or anywhere in-between.

I did literally everything I could think of, including going so far as to delete every mention of ‘bitdefender’ from the registry. This (looking back, unsurprisingly) rendered my PC unbootable until I restored a backup of the registry from before Bitdefender 2011 was installed. Sadly this did not fix the issue. Among other things I tried were looking for leftover files and drivers, of which I could find none. There did not seem to be any resident part of Bitdefender left over, suggesting it uses some serious rootkit techniques and just leaves them there when uninstalled.

In order to finally fix the issue, I took a full backup, then restored a 3 week old backup on to my SSD (Crucial C300 64GB if you’re interested, which I use for Windows, appdata, ntuser.dat and a few programs) and then copied over my updated appdata folders from the new backup along with a few registry keys. I’m happy to say, the issue is now gone. :)

Sadly I never did find out exactly what Bitdefender does that causes the issue, though there is little doubt in my mind that it was the culprit – my old PC had no resident software (that I hadn’t already installed before Bitdefender with no issues) or hardware in common with my new one until I stupidly went and tried the Bitdefender 2011 beta. My old PC had been running Bitdefender 2010 for a year before I removed it, so beta software is not the issue here.

tl;dr – steer clear of Bitdefender (beta or not) or risk permanent damage to your Windows installation. I’ll be going back to common sense and MalwareBytes.

Categories: /b/, Shitposts Tags: , ,

InstallMaps – an easy way to download, extract, install and bzip multiple SRCDS maps on Linux

April 28th, 2010 Darkimmortal No comments
#!/bin/sh

echo ---------------------------
echo InstallMaps by Darkimmortal
echo ---------------------------
echo Paste map URLs to be downloaded here, type @ to begin downloading.
echo

mkdir -p /tmp/installmaps
cd /tmp/installmaps

read -d @ line

echo
echo

if [[ $line == *rapidshare* ]]
then
  rsfaggot=" --user=YOUR_RAPIDSHARE_USERNAME_OPTIONAL -pass=YOUR_RAPIDSHARE_PASSWORD_OPTIONAL"
fi

if [[ $line == *tf2maps* ]]
then
  tffaggot=" --wait=26"
fi

wget --no-clobber --content-disposition $tffaggot --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" --accept=bsp,rar,zip,bz2 ${line//&/\&} $rsfaggot

echo
echo
echo --------------------------------------------------------------------------
echo
echo

echo Extracting any compressed maps...
for f in *.zip;do unzip -j "$f";done
for f in *.rar;do unrar e -ep "$f";done
bzip2 -d -v -f *.bz2

echo Removing any non-bsp files...
ls -Q | grep -v .bsp\"$ | xargs rm

echo Zipping all maps...
bzip2 -k -z -v *.bsp

echo Moving files to the correct folders...
mv -f *.bsp YOUR_SRCDS_INSTALLATION/tf/maps
mv -f *.bz2 YOUR_SV_DOWNLOADURL/tf/maps

echo Clearing download directory...
rm -rf ./*

echo Done!

This simple bash script allows you to paste a bunch of URLs (one per line) leading to uncompressed .bsp maps, or maps compressed as .rar, .zip or .bz2. It will then extract these maps, bzip them and move them to your SRCDS maps folder and the bzipped copies to your sv_downloadurl maps folder.

Replace YOUR_SRCDS_INSTALLATION and YOUR_SV_DOWNLOADURL with the appropriate values for your system, add Rapidshare details if you want, then you’re good to go.

Prerequisites: wget, unzip, unrar, bzip2

Categories: /b/ Tags:

Z-War – Full Zombie Survival Game in Javascript with Map Editor

December 11th, 2009 Darkimmortal No comments

Z-War – a Javascript game with no story what-so-ever. Some random futuristic guy with a pocket motorbike fighting zombies in a classic old-style RPG environment with forests and castles and stuff like that. Hurrrrr.

That being said, the gameplay isn’t bad. It’s not designed to be a demo or proof-of-concept – it’s an actual playable game designed to be hard, not pick-up-and-play fun. It’s also been in development for over one year (although only properly for about a month – just minor bugfixes and new maps after that).

The game doesn’t really use jQuery during gameplay – just for loading and laziness. Besides, it’s far too slow already – the engine (if you could even call it that) is pure, messy Javascript. And there is canvas support tacked on, but sadly I was too lazy to re-implement the ground or cliff rendering in canvas, so it simply overlays the normal HTML with a couple of transparent canvases. The sound is Flash based which I put together myself manually with some externalinterface calls (I hadn’t discovered SoundManager back then). And the AI… well, for Javascript it isn’t too bad. Not quite A*, but it knows what it’s doing and doesn’t just follow the player aimlessly. Well ok, maybe it does a bit.

Some gameplay screenshots:

One of the many ways to win Green Forest (which is actually quite difficult):

And the awesome map editor, which features drag+drop, cliffs which lock together and free painting of ground tiles:

Also on Nihilogic Games:

http://www.javascriptgaming.com/2009/02/z-war.html

Categories: Gaming, Javascript Tags: ,

The solution to Google Wave

November 29th, 2009 Darkimmortal 5 comments

CTRL+V CTRL+ENTER

In other news, they should really use native UI elements and Flash for communication, not some retarded Javascript bullshit and equally retarded AJAX polling.

Categories: /b/ Tags:

Finally a new PHP 5.3.2 snapshot

November 13th, 2009 Darkimmortal 1 comment

Updated: PHP 5.3.1 (released as of today) has fully functioning support for NTFS junctions.

The PHP Windows team finally bothered to release a new 5.3.2 snapshot after over a week of inactivity:

http://windows.php.net/snapshots/

Sadly, vBulletin 3.8.4′s inlinemod.php still manages to crash it. Stupid unstable snapshots D:

Also I’m running 5.3.2 because some idiot decided it would be smart to drop support for NTFS junctions in PHP 5.3.0 and 5.3.1, while I, like many Windows users, use them to support the www. subdomain.

And I’m running 5.3 because VC9 amongst other things makes PHP 100% faster running vBulletin 3.8 under Windows in my experience.

Categories: PHP, Servers Tags:

DarkCSSCache & DarkJSCache – The best way to compress CSS and JS

November 9th, 2009 Darkimmortal 1 comment

Download required PHP minify classes

CSS.php:

<?php

	require "class.cssmin.php";

	$prefix = './';
	$files = array("my.css", "another.css");

	$contents = '';
	$size = 0;
	foreach($files as $name){
		$contents .= "\n\n" . file_get_contents($prefix.$name);
		$size += filesize($prefix.$name);
	}

	$contents = "/* DarkCSSCache - 100% Pure Win. */\n".cssmin::minify($contents);

	file_put_contents("../darkcsscache.css", $contents);
	file_put_contents("../darkcsscache.css.gz", gzencode($contents, 9, FORCE_GZIP));
	echo number_format($size)." bytes compressed to...<br />".number_format(strlen($contents))." bytes standard<br />".number_format(filesize("../darkcsscache.css.gz"))." bytes gzipped";
?>

JS.php:

<?php

	require "../class.jsmin.php";

	$prefix = '../';
	$files = array("jquery.js", "shit.js");

	$contents = '';
	$size = 0;
	foreach($files as $name){
		$contents .= "\n\n" . file_get_contents($prefix.$name);
		$size += filesize($prefix.$name);
	}

	$contents = "/* DarkJSCache - 100% Pure Win. */\n".JSMin::minify($contents);

	file_put_contents("../darkjscache.js", $contents);
	file_put_contents("../darkjscache.js.gz", gzencode($contents, 9, FORCE_GZIP));
	echo number_format($size)." bytes compressed to...<br />".number_format(strlen($contents))." bytes standard<br />".number_format(filesize("../darkjscache.js.gz"))." bytes gzipped";
?>

As you might have guessed, this requires nginx with gzip_static to serve the .gz files. A much older version of DarkJSCache exists for Apache – fire me a message/comment if you are interested.

Anyway, this is by far the most efficient way to serve Javascript and CSS concatenated into a single file, minified and GZipped where the user’s browser allows. Other solutions where PHP outputs the CSS/JS are FUCKING INSANE, even if you’re an apache-fag.

It’s also quite unrealistic for a cron script etc. to check dates and update the files. Much better to do it yourself, so you can see changes almost instantly.

Anyway I use this on Imgkk and it’s certainly very successful there.

Live nginx status

November 9th, 2009 Darkimmortal No comments

Nginx is a beast of a webserver so you can actually do something like this and receive replies with 0ms delay in between (unfortunately ping is a factor :< )

Also graphs coming soon, but I still find the native format useful and quite readable with it updating several times a second.

Requirements:

<html>
<head>
<script src='jquery.js'></script>
<script>
var fresh = 0;
var doIt = function(){
	$.ajax({
		url: "/nginx_status",
		type: "GET",
		dataType: "text",
		success: function(data, textStatus){
			lol.textContent = data;
			doIt();
		}
	});
	fresh ++;
	ref.textContent = fresh;
};
</script>
</head>
<body onload="var lol = document.getElementById('lol');var ref = document.getElementById('ref');doIt()">
<pre>Nginx Live Status
 By Darkimmortal

Refreshes: <span id='ref'></span>

---------------------------------------------------------------
<span id='lol'></span>---------------------------------------------------------------

</body>
</html>

Also you obviously need this in your nginx config somewhere:

	location /nginx_status {
		stub_status on;
		access_log   off;
	}
Categories: Servers Tags: , ,

Playing XM tracker music in C#

November 7th, 2009 Darkimmortal No comments

Updated: Just use the .NET FMod that I wish I had discovered before posting this :P

Using the extremely handy Delphi port of MiniFMod, I put together a (very) simple C# wrapper:

using System;
using System.Runtime.InteropServices;
using System.Threading;

namespace RUM
{

    public class MiniFMod
    {
        private int module;
        private Thread pthread;
        private bool playing;
		public string status;

        [DllImport("MiniFMOD.dll")]
        public static extern int SongLoadFromFile(string name);
        [DllImport("MiniFMOD.dll")]
        public static extern int SongLoadFromResource(string name);
        [DllImport("MiniFMOD.dll")]
        public static extern void SongPlay(int module);
        [DllImport("MiniFMOD.dll")]
        public static extern void SongStop(int module);
        [DllImport("MiniFMOD.dll")]
        public static extern void SongFree(int module);
        [DllImport("MiniFMOD.dll")]
        public static extern int SongGetOrder(int module);
        [DllImport("MiniFMOD.dll")]
        public static extern int SongGetRow(int module);
        [DllImport("MiniFMOD.dll")]
        public static extern int SongGetTime(int module);

        public MiniFMod()
        {
            pthread = new Thread(new ThreadStart(progress));
        }

        private void progress()
        {
            string status;
            while(playing)
            {
                status = "Time: "+String.Format("{0:0.00}", (float)SongGetTime(module)/1000.0)+"\nOrder: " + SongGetOrder(module) + "\nRow: " + SongGetRow(module) + (SongGetRow(module) % 8 == 0 ? "\nTICK" : "");
				// Handle status update here, for example RUM does this:
                // RUMWindow.Invoke(new main.stringMT(RUMWindow.musicStatus), status);
                Thread.Sleep(30);
            }
        }

        public void play(string name)
        {
            playing = true;
            pthread.Start();
            module = SongLoadFromFile(name);
            SongPlay(module);
        }

        public void stop()
        {
            playing = false;
            pthread.Abort();
            SongStop(module);
            SongFree(module);
        }
    }
}
Categories: C# Tags: , , , ,

Hello world!

November 7th, 2009 Darkimmortal 14 comments

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

I’m going to be super badass and not delete this. :3

Categories: /b/ Tags: