Nerd Documents

Colonoscopy Demonstrating Moving Worm

Thursday, April 3rd, 2008

Chinese Linux

Wednesday, April 2nd, 2008

This can’t be good for GNU/Linux’s Image.

Creating a Screenshot from Ffmpeg

Tuesday, February 19th, 2008

Using ffmpeg, to create thumbnails for flash video files you can use the following command

ffmpeg -y -i videofile.flv -f image2 -ss 12 -vframes 1 -an screenshot.jpg

I use this command to create the stills for the videos I embed using the Flash Media Player

Enabling PHP tags in MediaWiki

Wednesday, January 30th, 2008

For internal Wiki’s for personal or small business use, it’s very useful to enable raw php. This of course, is a security nightmare so make sure you set it so that only people who have accounts can edit pages.

To prevent the creation of new accounts put the following into LocalSettings.php

$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgShowIPinHeader = false;

Then add this simple PHP tag parser to includes/Setup.php

function ParsePHPTag($Content)
{
 global $wgOut;
 $wgOut->enableClientCache(false);
 ob_start();
 eval($Content);
 $Result = ob_get_contents();
 ob_end_clean();
  return($Result);
}
$wgParser->setHook('php','ParsePHPTag');

That tells Mediawiki to pass the <php> tag’s contents to the function ParsePHPTag which will execute the code.

I use it for advanced page building as well as simple hacks such as getting around some of the other filters with code like

<php>echo "<iframe src='somepage.php' />"; </php>

If you want your privacy, you can disable anonymous page views with the following inside of LocalSettings.php

$wgGroupPermissions['*']['read'] = false;
$wgWhitelistRead = array ("Special:Userlogin");

That disables anonymous viewing of all pages except the login page.

And finally, if for some reason you need TeX support for math symbols or neat graphs, you can enable it with a rather complicated process.

  1. Make sure you have LaTeX, dvips, and ImageMagick installed on the server. You also need machine with GNU Make and Ocaml
  2. Run make in the /math directory of MediaWiki on the system with Ocaml. This will build texvc. If you can’t get access to a machine with a build process, you can try this one which I built on dreamhost so it should work there. Drop it into your MediaWiki’s /math directory
  3. set $wgUseTeX to true in your LocalSettings.php

This should enable <math> tags inside of your MediaWiki, allowing you to create stuff like
ax^2+bx+c=0 \Rightarrow x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}

Eclipse CDT debug error

Monday, December 31st, 2007

If you get the error

A syntax error in expression, near `-console'.
mi_cmd_env_cd: Usage DIRECTORY

when trying to launch the debugger from Eclipse CDT, change your project and or path to not have any spaces in it. Apparently the debug launch code isn’t smart enough to put quotes around paths or escape spaces.

(On Ubuntu Gusty Gibbon)

Think Different

Sunday, September 30th, 2007

The State of Linux Audio

Tuesday, July 17th, 2007

Why Linux Audio Has Been a Mess for Years

And will likely stay that way.

Ubuntu 7.04 Feisty Fawn

Saturday, June 16th, 2007

Everyone raves about Ubuntu and how it’s easy it makes everything. 7.04 garnered critical acclaim for being, “better, but not that different” which isn’t the greatest endorsement, but at least it’s an endorsement. I did 4 upgrades from Edgy (6.10) to Fawn (7.04). It was very simple, I just used the update manager and it updated all 4.

Unfortunately, of the 4 only 1 booted after upgrade. It took much finagling including a complete reinstall to get the other machines up to speed.

To me this does not bode well for Ubuntu.

The Hackintosh Project (osx86)

Sunday, November 12th, 2006

Picture 1.png IMG_0228.JPG
In which I chronicle the installation of Mac OS X 10.4.8 on a Dell.
(more…)

RSS Feed Reader

Monday, March 20th, 2006

Because Danny Silverman is doing it, I decided to try out using an RSS Feed Reader to do my blog reading. I chose liferea based on some very minimal reading. Everything is kind of ugly and hard to read, but it will probably save some time.

Liferea

Some notes, for Myspace RSS feeds, do:

http://blog.myspace.com/blog/rss.cfm?friendID=<friendID>

Where the friendID is a number that is in most links on their page.

For Xanga feeds do:

http://www.xanga.com/rss.aspx?user=<username>

That is, just replace home.aspx in the url with rss.aspx

Here’s hoping I never have to listen to 10 songs playing simultaneously when loading all my bookmarks

Muine

Tuesday, May 10th, 2005

I’ve been exploring the neat mono apps that everyone has been raving about lately.

Muine is a very simple music player that “Just Works”. It works really fast and does mostly everything anyone would want in a music player. It’s not music management software, it’s just a player.

Muine Screenshot