Install MediaWiki wiki system + WYSIWYG

Today, I setup the MediaWiki wiki system for HomeNet. Just follow the directions on their website. Also try this page if you want to integrate the FCKEditor WYSIWYG editor when editign wikis (alternative to learning the difficult wiki markup).

Notes (after installation):

For wiki restrictions, in LocalSettings.php file, optionally add:

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
# Disable editing by anonymous users
$wgGroupPermissions['*']['edit'] = false;

That’s it!

Posted in Software, Tech | Leave a comment

Apache startup failure tip

My web server was down today. Apparently, the server’s power cord came loose and so it shut down after a couple of hours. After booting it up, I started Apache but it failed. It didn’t display a reason, the process judt wouldn’t start. After googling for ways to view an error log, I found that if you go to apache/bin directory in Command Prompt and run apache.exe -t, either the process will spawn pr you will get an error message. Apparently the problem I was having was that after the reboot, one of my external drives was mapped to a different drive letter than apache was expecting.

Posted in Software, Tech | Leave a comment

An easier alternative to your own SMTP server

I tried setting up an SMTP server today so that I could send emails directly from my web server using PHP’s mail() function. I tried the free Mercury SMTP server and a couple others and spent a few hours setting them up. But no matter what I tried, I couldn’t get the server to send out emails. After googling for the problem, it looks like ATT/SBC/Yahoo DSL might be blocking connections on port 25 (SMTP)  – to prevent spam. Crud.

Anyway, I found a better alternative for Gmail users: PHP Mailer. It provides a class to replace PHP’s mail() function which provides vastly more functionality, the most useful of which is authenticated SMTP connections. This means that you can use Gmail to act as your SMTP server to relay your emails!

Just follow the directions on the website. In the ZIP file, you will find an example file that shows you how to use PHP Mailer with Gmail.

Posted in Software, Tech | Leave a comment

Setup Subversion (SVN) and Trac the easy way

Having used the Subversion version control system in my team programming projects at Berkeley and noticing my friends use it for their own single-developer projects, I finally decided that I too should start using it personally. And having it be remote-enabled will allow me to share code with others and invite others to work with me in a team.

I spent the last few hours struggling to get remote-enabled SVN + Trac + TortoiseSVN to work together. I never imagined that such a popular combination did not yet have a simple all-in-one installer without having to resort to command line and script hacking.

But…some googling led me to EasyTrac which promises to “be able to quickly deploy Trac and Subversion to your computer.”

Anyway, here is my detailed steps to getting all this to work together:

  1. Install all these things on the computer you mean to be the svn server:
  2. Install Python
  3. Install EasyTrac – this will install Subversion and Trac and some helper packages
  4. Choose “path” for access mode
  5. Choose your apache port (other than 80 if you have a web server running)
  6. You might want to leave the Subversion port as 3690 (I haven’t been able to change it later)
  7. You need to port-forward both these ports on your router so that you can access from anywhere
  8. Choose a good place to store all your repository + trac data (Authz, SVN, Trac folders will be created in it)
  9. Let install finish
  10. In Authz\SVN.acp, change line to “admin = admin, your-name”
  11. In Authz\Users.acp, add line “your-name:your-password”. Change admin’s password also for safety
  12. Create a practice repository (Start Menu -> EasyTrac -> Create Project)
  13. In SVN\repository-name\conf, edit svnserve.conf to be
    1. anon-access = none
    2. auth-access = write
    3. password-db = passwd
    4. realm = some string
  14. In SVN\repository-name\conf, edit passwd to be
    1. your-username = your-password
    2. admin = admin’s password
  15. Install TortoiseSVN on the server and your personal computer
  16. In Tortoise, go to repository svn://server-ip/repository-name
  17. Add some files to the repository
  18. Change them and commit them to the repository for testing
  19. Go to http://localhost:apache-port/trac/repository-name to see TRAC at work!
  20. Go to http://localhost:apache-port/svn/repository-name to see the SVN rep
  21. You can login and go to admin->permissions to change anonymous access, make yourself admin, etc
  22. If you want to backup/restore repositories, simply copy/paste the SVN\repository-name directory and TRAC\repository-name
  23. From SVN programs, access your repository using svn://server-ip/repository-name

That’s it. Good luck coding.

Posted in Software, Tech | Leave a comment

Code Syntax Highlighting plugin for WordPress


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /srv/www/wordpress/wp-content/plugins/wp-syntax/wp-syntax.php on line 380


Just thought I would share how I got syntax highlighting to work on the previous post on XAJAX.

Check out the WordPress plugin wp-syntax. Blurb:

WP-Syntax provides clean syntax highlighting using GeSHi — supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

Setup:

    1. Install the plugin
    2. Activate it
    3. Example usage:
<pre lang="java">
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
<pre>

Result:

public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

Posted in Software, Tech | Leave a comment