Securing MediaWiki – Making Your Wiki Private

Making your wiki private is something you may require if your wiki is for personal use or if it’s strictly for internal use. To do this one small addition is required in your LocalSettings.php file, add the below text to the end of the LocalSettings.php file


# This snippet prevents editing from anonymous users
$wgGroupPermissions['*']['edit'] = false;

# This lists ages anonymous (not-logged-in) users may see (only the log-in)
$wgWhitelistRead = array("Special:Userlogin", "-", "MediaWiki:Monobook.css" );
$wgGroupPermissions['*']['read'] = false;

# This snippet prevents anonymous users registering
$wgGroupPermissions['*']['createaccount'] = false;

Moving Gmail accounts? Move all your existing Gmail to your new Gmail account.

I recently started using Google Apps for my domain and in the process I needed to move all my mail from 2005 – Today. So for anyone else in such a situation or if you are just moving from one Gmail to another, here are the steps.

Step 1: Log in to your Gmail account which holds all your mail
Step 2: Select Settings then Forwarding POP/IMAP
Step 3: Select the radio button beside Enable POP for all mail (even mail that’s already been downloaded)
Step 4: Log in to your new Google Apps email or new Gmail account
Step 5: Select Settings then Accounts and Import
Step 6: In Google Apps select Add a mail account you own, Gmail select Get your mail from other accounts in Gmail using POP3

Now just fill in your POP info into Gmail and your Emails will slowly move on over.

Tethering your BlackBerry over bluetooth in Mac OS X Leopard

One slight addition to your library is required to get this working, Below you will find the BlackBerry.ccl download which is required to preform this method. Also, while this has only been tested with the 9000, there should be no risk associated with attempting this with other models of BlackBerry. Rogers is the carrier used for the test for Bell please see below.
Download: blackberry.ccl.zip

I would like to bring attention to Greg’s comments left on this post, there are as follows.

I just successfully did this with a BlackBerry 9630 (Tour).

The Tour in question was on the Bell Canada CDMA network and I had to make the following changes:

- Telephone number: your telephone number (w/o country code)
- Account name: the email you use on the Bell Canada website
- Password: the PIN you use for your voicemail

*Note for Step 5: When you add the ccl file to your modem scripts, you will now have two “Research in Motion” vendors. Remember to select the one that contains the “BlackBerry 8800″ as one of its models.

Step 1: Pair your BlackBerry to your Mac’s Bluetooth.

Step 2: Copy the unzipped BlackBerry.ccl script to your Macintosh HD>Library> Modem Scripts folder.

Step 3: Set up a new network connection by accessing Network and selecting the + button to add a new connection, enter the following.
-Interface: Bluetooth DUN
-Service Name: “Enter whatever name you like”

Step 4: Enter the following to configure the new connection.
-Telephone Number: internet.com
-Account Name: wapuser1
-Password: wap

Step 5: Select the Advanced button and enter the following under the Modem Tab.
-Vendor: Research in Motion
-Model: BlackBerry 8800 *NOTE* the 8800 model is used for the 9000

Step 6: Connect to your new connection, enjoy.

For advanced users here is the PPP tab of the Dial up network we have created.

Hosting your own website for free on Ubuntu 9.10 (Dynamic IP)

What will be covered in this post is the creation of a server on your Ubuntu 9.10 Machine , hosting of a html or PHP website accessible through a free domain redirection to your IP address which will later become automated to update the redirection with your ever changing dynamic IP assignments from your ISP. This is done by Installing Apache2 webserver with PHP5 and MySQL, additional software such as inadyn will also be installed. Installation of a website will not be covered, this tutorial has been tested using WordPress and MetaWiki. As usual use only if you have advanced knowledge of Linux.

Step One: MySQL 5


To begin open a terminal.
Type:

sudo apt-get install mysql-server mysql-client

You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost as well as root@example.com.

New password for the MySQL “root” user: EnterYourPassword
Repeat password for the MySQL “root” user: EnterYourPassword

Step Two: Installing Apache2

Back in the Terminal type:

sudo apt-get install apache

Now direct your browser to “http://localhost” and you should see the Apache2 placeholder page (It works!)
Apache’s default document root is “/var/www” on Ubuntu and the configuration file is “/etc/apache2/apache2.conf”

Step Three: Installing PHP5

Install PHP5 and the Apache PHP5 module as follows:

sudo apt-get install php5 libapache2-mod-php5

Restart Apache afterwards:

sudo /etc/init.d/apache2 restart

Step Four: Testing PHP5 / Details About Your PHP5 Installation

The document root of the default web site is “/var/www/” we will now create a small PHP file called “info.php” in that directory and access it in a browser. The file will display details about your PHP installation such as the installed PHP version and modules.

sudo pico /var/www/info.php

Now type this into the file and save then exit.

<?php
phpinfo();
?>

(Exit and save by pressing control + x, then type “y” and hit enter)

To access this in your browser type: http://localhost/info.php

If you see the status page then PHP5 is working and it’s working through theApache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don’t have MySQL support in PHP5 yet.

Step Five: Getting MySQL Support In PHP5

To do this install the php5-mysql package. It’s a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:

sudo aptitude search php5

Pick the ones you need and install them by typing:

aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

Now restart Apache2:

sudo /etc/init.d/apache2 restart

Reload http://localhost/info.php in your browser and scroll down to see the modules section. You will now find your new modules including the standard MySQL modules.

Step Six: phpMyAdmin

PhpMyAdmin is a web interface in which you can manage your MySQL databases. It’s a good idea to install it:

sudo apt-get install phpmyadmin

Select the following:

Web server to reconfigure automatically: apache2
Configure database for phpmyadmin with dbconfig-common?: No

When this is complete enter this into a terminal:

sudo ln -s /usr/share/phpmyadmin/ /var/www

Step Seven: Configuring a Database in phpMyAdmin

Please note that depending on the type of site you choose to install your database may need a custom and different configuration then follows.
To access phpMyAdmin type “http://localhost/phpmyadmin/” into your browser.
Login username will be “root” and password is the one created during step one.
Enter a name for your database in field under “Create new database”
Hit Create and select the privileges tab on the same window
Select add new user at the bottom of this tab and choose a user name, password and only fill out those fields hitting “Go” in the bottom right to create the user. These are now your credentials for your first database in phpmyadmin.

Step Eight: Installing your Website

Now that you have a database you can install your website, this can be done many different ways for different sites but most PHP sites are the same. Extract the downloaded PHP zip for your WordPress site to the “/var/www/” folder, go to a browser and type “http://localhost/install.php”. This will prompt your through the sites install. If your receive any errors feel free to post it in the comments and I will try and help.

Step Nine: Configuring a Redirection (dyndns.com)

The service we will be using is dyndns.com and their free Dynamic DNS. If you haven’t already, go to there site and register your free account. This service is very stright forward in setting up a free domain to redirect to your external IP address so anyone accessing your site will not need to know your current IP address as it’s always changing.

Step Ten: The Final Step

Assuming that your server and website is up and running and you have dyndns.com redirecting to your external IP address, you will want to configure one last thing to ensure dyndns.com stays up to date with your dynamically changing IP. This will happen if you disconnect and reconnect or if your ISP assigns you a new one.

Be advised that the following is not to be used on a multi-user computer as it will expose your password to those users for the dyndns.com service.

We need to install a package called inadyn, type the following in a terminal:

sudo apt-get install inadyn

Now that we have a service installed we need to create the config file with some instructions.
Type the following in a terminal:

sudo pico /etc/inadyn.conf

Add the following to our empty inadyn.conf file:

# Basic configuration file for inadyn
#
# /etc/inadyn.conf
update_period_sec 600 # Check for a new IP every 600 seconds
username YourUserName
password YourPassword
dyndns_system dyndns@dyndns.org
alias EnterYour.DyndnsDomain.com

Replace the username & password sections as well enter your domain that we created with dyndns.
After you have placed those lines with replaced sections hit control+X, then type “Y” Hit “Enter”.
This will save your configuration file and we can move on to the last step.

Adding a script to your startup applications.

Startup Applications is located in the following menu tree:
System>Preferences>Startup Applications

Hit the add button and enter the following:

Name: CheckIP
Command: inadyn –username YourUserName –password YourPassword –update_period_sec 600 –alias EnterYour.DyndnsDomain.com
Comment: I left this blank

Hit Save and your done, you now have a service which will at startup check your external IP every 10 minutes and if your IP is changed it will automatically update your dyndns domain name with the proper IP so your site will continue to function and be accessible even with a dynamic IP from your ISP.

Mouse Art: Mousepath


I came across an interesting Java application that can run on any OS called Mouse Path.
It tracks your mouse on a blank canvas, painting in black the location of your mouse as it travels on your screen. When your mouse is left alone the black ink starts to pool indicating the duration the mouse was left still by size of the ink spill.

Download: MousePath