It was a dark and stormy night and Bram Stoker had just finished writing his novel "Dracula".
This was rather silly of him because Stoker was in actual fact a big sissy who was afraid of the dark, not to mention bats, mice, spiders, snakes, the sight of blood, heights, large open spaces, small enclosed spaces, dentists and clowns. Clowns particularly.
Daze of Our Lives

Blocking IPs w/o Apache Directives

apachechiefIt’s considered gauche, not to mention, fruitless, to block ips, but still there are times when brute force is required just to introduce some level of serenity on a site exposed to attack by web server spammers. The provision of subsidiary Apache directives for this purpose usually are not available at the document root level of the web server, so as to avoid unnecessary hits on server performance. In these instances, one has to make do without the handy .htaccess file full of directives to do all sorts of nifty things, among them, blocking ips with the ‘deny from’ command.

An alternative involves using a php script with methods for accomplishing the same objective placed at the head of a file. The targeted objective in this case is not the individual ip address, but ranges encompassing whole countries — as best as can be determined from resources on the web. The resource of interest here is called Country IP Ranges Generator. A target country from the list provided is selected. Next, ‘formatting by input’ is selected. The format to use: {startip}/{netmask}. A complete list is spat out when the “generate” button is clicked. Each line in the list represents a range of possible networks in the country selected. Here is the most current list for the whole of Afghanistan:


#Afghanistan
58.147.128.0/255.255.224.0
110.34.40.0/255.255.248.0
117.55.192.0/255.255.240.0
117.104.224.0/255.255.248.0
119.59.80.0/255.255.248.0
121.100.48.0/255.255.248.0
121.127.32.0/255.255.224.0
125.213.192.0/255.255.224.0
202.56.176.0/255.255.240.0
202.86.16.0/255.255.240.0
203.174.27.0/255.255.255.0
203.215.32.0/255.255.240.0
210.80.0.0/255.255.224.0
210.80.32.0/255.255.224.0

For larger areas, such as China or the Russia Federation, these lists can be quite long, but still quite manageable. The ip ranges can be used selectively or wholesale depending on one’s policy. If you’re targeting a language group for inclusion in your web service, such as a forum or a weblog, you need to avoid wholesale blocking of countries who might include potential participants of the friendly sort. The thing is, the foes tend to wage their exploits from far-flung areas outside North America, if they can get away with it.
Read the rest of this entry »

MediaWiki Short URL Solution for Subdomains

The subdomain is particularly challenging for those who don’t want to be mucking about with httpd.conf files or otherwise cannot. That’s not to say it is less onerous to achieve the same result within the confines of a domain.

Most often, a subdomain, e.g., wiki.blancmange.net, is nothing more than a virtual domain that points to some subdirectory — in this case, wiki — in the htdoc/public_html root of the parent domain, i.e., blancmange.net (www.* is, as a rule, an alias of the parent domain, rather than a subdomain). In these cases, happily, the attainment of short urls involves only two simple steps (distilled from many hopeful but ultimately unworkable solutions). Assuming you have set up a subdomain called wiki.blancmange.net that points to a subdirectory /wiki, you need to:

  • Edit the LocalSettings.php file in the MediaWiki root directory.
  • Edit an .htaccess file that will reside in the same directory

In the LocalSettings.php file you will add or change the following to what was automagically generated during the setup of your MediaWiki install:

  • $wgScriptPath  = “”;
  • $wgArticlePath = “$wgScriptPath/$1″;

Just to be clear, the value assigned to the first variable is a pair of quotes (avoid using the smart quotes in this post).  The one assigned to the second variable is derivative of the first.  The effect is that the url for the main page will look like this:

wiki.blancmange.net/Main_Page

The next step is to add Apache mod_rewrite statements to the .htaccess file.  Here are the statements that seem to make it all happen:

RewriteEngine On
RewriteCond %{HTTP_HOST} wiki.blancmange.net
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?title=$1 [L,QSA]

The really key bit here is the second statement.  It does depend on permission to use .htaccess files.  With it present where it is, the 404 errors you’ve been confounded by are finally brought to an end.

Additional: add the following line to redirect common links to your wiki, just in case people have linked it that way. Assuming the same subdomain above, you would write the following in the .htaccess file, above the other entry:

RedirectMatch /wiki/(.*)$ http://wiki.blancmange.net/$1

This will forestall broken links, at least to some extent.

It should be noted that this has been achieved on versions 1.14.0 – 1.16.4.

Zappadan Note

In honor of the occasion, a 404 page will be officially launched, having been operational for some number of years already without any formal notice. If you make an error in the dinsdale directory at flag, the host of this venerable site, you will get the following image along with a brief message:

What you see on a 404 page at Dinsdales place

What you see on a 404 page at Dinsdale's place

It is hoped this will fulfill our obligation to pay proper tribute to Frank Zappa, himself appearing here as a 10 year old version of himself.

The artist as a young man of 10

The artist as a young man at 10

On Disconnecting Tungsten T3 PDA Digitizer from LCD

The question of how to disassemble T3 components so as to free the digitizer of water was raised, recently. An admirable answer has already been provided in a series of well-illustrated steps, leaving little to the imagination (which is a positive boon, in this case). It’s particularly useful for those who want to replace either the digitizer or the LCD.

However one final step was never reached, namely, after the screen has been separated from the PDA, how to separate the digitizer from the LCD. More to the point, how on earth to disconnect the digitizer ribbon from the LCD. It’s not immediately apparent as one surveys the back of the metal screen case shown here:

View of T3 screen with detail of connector of interest

View of T3 screen with detail of connector of interest


Read the rest of this entry »

Downloading iTunes Videos on a G3 Lombard

It’s a challenge, to be sure. The laptop of interest here was happily minding its own business within the confines of Jaguar, deemed the most suitable OS for that generation of Macs, when along came the need to download a video on a portable. It being the newest laptop in the Mac inventory, built and first delivered in May 1999 (terminated in February 2000), meant it would be the one designated to do the heavy lifting involved.

First of all, the iTunes store will not permit downloads on a device running anything less than Mac OS 10.3.9 (Panther). That meant an upgrade of the OS was the first order of new business. Fortunately, the upper limit of OS installs recommended for the Lombard (also known as the “bronze keyboard” Mac) turned out to meet that requirement by a hair’s breadth.

Installing the Panther OS is no small matter when it comes to the Lombard. It turned out, after a couple of failed attempts and a bit of investigation that the Lombard has an issue having to do with the video hardware. About a third of the way through the first install disc, the screen would suddenly go wonky and the whole process would freeze (that is to say, crash). This issue was quickly resolved by reducing installed RAM to 256MB. After successfully installing 10.3, it was tested with all the RAM installed again. As a precautionary, the same procedure was followed during the upgrade from 10.3 to 10.3.9.
Read the rest of this entry »

Word Origins: Blancmange

The word blancmange derives from Old French blanc mangier. The name “whitedish” is a modern term used by some historians, though the name historically was either a direct translation from or a calque of the Old French term. Many different local or regional terms were used for the dish in the Middle Ages:

    English: blancmanger, blankmanger, blank maunger, blomanger, blamang
    Catalan: manjar blanch (Old Catalan; nowadays it would be menjar blanc)
    Portuguese: manjar branco
    Italian: mangiare bianco, blanmangieri, bramangere
    Spanish: manjar blanco
    Dutch/Flemish: blanc mengier
    German: blamensir
    Latin: albus cibus, esus albus

Though it is fairly certain that the etymology is indeed “white dish”, medieval sources are not always consistent as to the actual color of the dish. Food scholar Terence Scully has proposed the alternative etymology of bland mangier, “bland dish”, reflecting its often mild and “dainty” (in this context meaning refined and aristocratic) taste and popularity as a sick dish.

From Wikipedia.

Thinkpad T61p Notes

The laptop was ordered configured with Home Vista with the intention, upon receipt, of installing XP Pro. It’s not as simple as reformatting the drive and installing the older more benign OS. The laptop arrives with the system restore data installed on a hidden hdd partition. This seems to have become acceptable practice among the major vendors of Wintel machines.

In any event, the first order of business was to backup the factory installed system. Recovery discs were created along with a Rescue and Recovery Startup disc using the ThinkVantage utility intended for this task. The utility was a bit temperamental, but came through, at the end of the day.

Before installing XP Pro, two things had to be done after the recovery discs were made (for posterity, I suppose). The first was to set the drive to ‘compatibility’ in the system BIOS. The second part was to remove the hdd partitions.

Any attempt to install XP straightaway results in a failure to install owing to an inability of the installer to recognize the hdd. It will report there are no candidate drives. To work around this stumbling block it was necessary to enter BIOS (F1 during boot sequence) and select Config > Drive and change the setting to Compatibility. Having done this, it was finally possible to proceed with the install.
Read the rest of this entry »

Blancmange Function

The Blancmange function, also called the Takagi fractal curve (Peitgen and Saupe 1988), is a pathological continuous function which is nowhere differentiable. The iterations towards the continuous function are batrachions resembling the Hofstadter-Conway $10,000 sequence. The first six iterations are illustrated below. The dth iteration contains N+1 points, where N=2d, and can be obtained by setting b(0)=b(N)=0, letting

b(m+2(n-1))=2n+1/2[b(m)+b(m+2n)],

and looping over n=d to 1 by steps of -1 and m=0 to N-1 by steps of 2n.

Javascript: Select box navigation

So, you have this form object such as the one illustrated below.

<form>
<select id="idname" class="button" size="1">
<option>Section I </option>
<option>Section II </option>
<option>Section III </option>
<option>Section IV </option>
<option>Section V </option>
<option>Section VI </option>
<option>Home </option>
</select>
<input class="button" onclick="selectOption('idname', URLarray)" type="button" value="Go" />
</form>

You could attach a routine written specifically for that object. Or you could initialize an array with the values for each option and call a routine that knows how to handle such an array passed to it. Here is an example of such a function named selectOption():

//generic list item function

function selectOption(ident, listItemURL)
{
var selObj = document.getElementById(ident);
var num = selObj.selectedIndex;
for (i=0; i<listItemURL.length; i++) {
if (i==num) {
top.location= baseURL + listItemURL[i];
break;
}

}
}

Somewhere before that function you’ll need to initialize an array to pass as a listItemURL parameter. Here’s an example:


var somearray1 = new Array(
'/directory/somefile1.shtml',
'/directory/somefile2.shtml',
'/directory/somefile3.shtml',
'/directory/somefile4.shtml',
'/directory/somefile5.shtml',
'/directory/somefile6.shtml',
'/index.shtml'
);

The form parameter URLarray in this case would be somearray1.

In the function, the optional variable baseURL is also initialized elsewhere, depending on the structure of the files. It is not required in this example as the values of the array in this case are based in the root directory by default. You might, however, want a base url, in which case you would declare it in a header page that would include the head portion of your shtml document. One way to do that would be as follows:



<script type="text/javascript">

var rootdir = "/";
var urlhost = location.host;
var locpath = location.pathname;
var pathtohome = locpath.substr(0, locpath.indexOf(rootdir));
var baseURL = "http://" + urlhost + pathtohome + rootdir;
document.write('<base href="' + baseURL + '" />');
</script>

This declaration would be placed before the function.

The long and short of it is you need only call one function to make a particular select box object work once you have declared an array of option values and successfully passed that array to the function.

Revising the Ubiquitous Billgatus Iconograph

The original creator of BillGatus apparently used an image capture of a video featuring the The Best of Both Worlds sequel to the of Star Trek: Next Generation episode, Q Who?, where Q had unceremoniously flung the Enterprise into a very distance and uncharted sector of the universe populated by the rather ominous borg collective, then unknown to the United Federation of Planets. The sequel sees Capt. Picard dragooned by the borg collective for the purpose of communicating their message to people on earth targeted for assimilation that “resistance is futile.”

At any rate, the size of a teevee image on a computer screen was decidedly smaller than what one normally viewed on the average telly. The result was less than spectacular but the best one could do at the time it was created.

The original version looked like this:

BillGatus 3.0

It’s a bit muddy.
Read the rest of this entry »

« Newer PostsOlder Posts »