Web

MediaWiki password reset

Here’s the SQL to reset the mediawiki password of a user: use mediawikidb; update tbl_user set user_password=md5(concat(user_id,’-‘,md5(‘newpassword’))) where user_name = “Alex”; The default admin username is WikiSysop, with user_id=1, so you could do: update tbl_user set user_password=md5(concat(‘1-‘,md5(‘newadminpassword’))) where user_id=1; Here’s how you add a new user: insert into user(user_name) values (“Alex”); then set a password […]

Read More
Web

Blocking Image Bandwidth Theft/Hotlinking with URL Rewriting

You can stop others from hotlinking your site’s files by placing a file called .htaccess in your Apache site root (main) directory. The period before the name means the file is hidden, so you may want to edit your file as htaccess.txt, upload it to your server, then rename the txt file to .htaccess in […]

Read More
Web

Check if a URL exists/is online

Function to check if a URL is online/exists. function is_valid_url($url){    $url = @parse_url($url);    if (!$url)    {        return false;    }    $url = array_map(‘trim’, $url);    $url[‘port’] = (!isset($url[‘port’])) ? 80 : (int)$url[‘port’];    $path = (isset($url[‘path’])) ? $url[‘path’] : ”;    if ($path == ”)    {   […]

Read More
Web

CSS Shorthand Guide

Ok. Let’s set the record straight. There is no official guide for each and every CSS shorthand property value. So let’s work together and put one together shall we? Ok. Straight to the business. Anytime I’ve ran into a specification (besides the confusing mess at the W3C), it turns into showing off a couple of […]

Read More