## Archive for May, 2015

### Kung Fury

Sunday, May 31st, 2015

What movie can pack dinosaurs, kung-fu, tricerocop’s, hitler (AKA the ‘kung führer’), thor, Vikings and time travel in only 30 Minutes? It’s got to be ‘Kung Fury’ one amazingly short movie. As Jon Irenicus would say, ‘how wonderfully mad’.

This movie is packed with action, fantasy, FX on every frame and is completely free (though you might want to buy the game or movie to support them).

If you like humor, action and FX you might want to watch .

### Math MediaWiki extension with Texvc problem.

Thursday, May 28th, 2015

This puzzled me for a while. My math was rendered as $Hard to understand math goes here$ instead of a nice png. I don’t fully understand the problem but made it work anyway by hacking the Math extension sources.

First to make it work texvc must be installed (obviously). You must be able to run it as your web server (whatever that account is running on). So far the obvious part. Now you have to add the following to your LocalSettings.php in the root wiki dir in this order:

$wgMathValidModes[] = array( MW_MATH_MATHJAX, MW_MATH_PNG, MW_MATH_SOURCE ); // Define MathJax as one of the valid math rendering modes$wgUseMathJax = false; // Enable MathJax as a math rendering option for users to pick $wgDefaultUserOptions['math'] = MW_MATH_SOURCE; // Set MathJax as the default rendering option for all users (optional)$wgMathDisableTexFilter = true; // or compile "texvccheck" $wgUseTeX = true;$wgTexvc = '/usr/bin/texvc'; $wgUploadDirectory= "upload";$wgUploadPath = "upload"; $wgMathPath = "{$wgUploadPath}/math"; $wgMathDirectory = "{$wgUploadDirectory}/math"; $wgTmpDirectory = "{$wgUploadDirectory}/tmp"; $wgShowSQLErrors = 1; require_once "$IP/extensions/Math/Math.php";

Make sure the directories are created under your root wiki install so if the LocalSettings.php are in /home/wiki/ then there should be a dir

 public function callTexvc() { global $wgTexvc,$wgTexvcBackgroundColor, $wgHooks;$wgTexvc="/usr/bin/texvc"; wfProfileIn( __METHOD__ ); $tmpDir = wfTempDir(); if ( !is_executable($wgTexvc ) ) { wfDebugLog( 'texvc', "$wgTexvc does not exist or is not executable." ); wfProfileOut( __METHOD__ ); return$this->getError( 'math_notexvc' ); } $tmpDir="/tmp"; Then finally they appeared in the preview. But unfortunately my wiki is not in the root of the website and it didn’t use the complete URL in the final pages as it does in the preview. This can be solved as follows in MathTexvc.php. I just hardcoded (again) the prefix. return Xml::element( 'img',$this->getAttributes( 'img', $attributes, array( 'src' => "/mydir/mywiki/".$url