jQuery Pagination Plugin

I found a jQuery pagination plugin at http://rohitsengar.cueblocks.net/jquery-pagination-plugin/. The plugin is brilliant except for it’s lack of jQuery.noConflict() solution. I have unminified the plugin and made the small changes necessary for jQuery.noConflict() support. I hope the author (Rohit) don’t mind me unminifying his script and redistributing it here. If you have any isues please feel free to leave your comment, or go over to the original website to get Rohit’s help.

Link to ‘child pages’ in WordPress with ‘the_post_thumbnail’

WordPress 2.9 has been released and comes packed with some awesome new features. One of the new feature that I am loving as I have been longing for it, is the post thumbnail. This is a new feature in WordPress that allows you to upload an image to a post that you are creating and attaches to the post as its thumbnail. No longer do you have to use custom fields if all you want is a image for you posts.

It can be used for both posts and pages so I may use both post or page interchangeable throughout this post. I’ve recently used the new ‘Post Thumbnail’ feature in 2.9 to link child pages from a ‘Parent’ page using the Post Thumbnail as an image link.

Wordpress Post Thumbnail

The code below is an example of how to use the ‘get_the_post_thumbnail()’ to list the current page children with its content and a title.

100 Open Computer Courses

While doing my usual random searching through Google I stumbled across a wonderful resource. Something I think every individual not only computer savvy persons or geeks would find useful. It’s a list of 100 open computer courses. Yes, open as in FREE!

The are split into the following categories:

  1. Computer Science and Engineering
  2. Computer Security
  3. Programming
  4. The Web
  5. Software
  6. Information Technology
  7. Communication Technology
  8. Technology in Education
  9. Tech Math
  10. Technology and Society

To see the full list head over to Fred Palmer’s website over at http://fredpalma.com/100-computer-open-courses/.

Converting keystores between JKS and P12

Found these keytool commands that saved me some valuable time working with an already existing .p12 certificate for signing an applet.

It withs in JDK6 and onwards (not in JDK5 and earlier).

JKS → P12

keytool -importkeystore -srckeystore keystore.jks -srcstoretype JKS  -deststoretype PKCS12 -destkeystore keystore.p12

P12 → JKS

keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12  -deststoretype JKS -destkeystore keystore.jks

Original post by tomas at http://blog.ejbca.org/2008/02/converting-keystores-between-jks-and.html.

Useful Online HTML Tools

Ever interested in applying all kind of stuff to text you already have, like converting csv data into a table or reversing the order of words in a sentence without reversing the letters of the words? Well, I have and it has been a nightmare to find online resources to get these quick tasks completed.

As a programmer it is tempting to bake a script to do the trick but sometimes when time is not on your side these tools may come in handy.

Follow this link http://www.textfixer.com/html/csv-convert-table.php to access the tools on the Text Fixer website.

WordPress Automatic Update Issues

When trying to use WordPress automatic update I got this error ‘Error: There was an error connecting to the server, Please verify the settings are correct.’, after trying multiple attempts to rid myself of the problem I had a eureka moment. I thought to myself, “what if it Apache wasn’t seeing the right permissions of the folders?”, and low and behold that was the problem.

Apache was expecting the owner of the folders in the document root to be www-data, I figured this is for some form of security purposes.

How I got rid of the problem

I got rid of the problem by changing the group and owner of my WordPress install folder in apache root to www-data by executing the following command:

cd /yourwordpress_dir/
sudo chown -R www-data:www-data *

How to mount a USB drive in Linux

Most Linux distribution such as Ubuntu automatically mounts your usb drive when it is plugged in. Sometimes we take this for granted and if for some reason the drive doesn’t load we tend to pull our hair out trying to figure out why. If you’re like me then this is a sad reality that you have to overcome perhaps every week.

The other day I was locked out of my Ubuntu after upgrading from Intrepid to Jaunty and GDM decided to take a break. The real problem occurred when I urgently needed my CV to be sent off that day and the most up-to-date CV was on my Ubuntu login, sigh.

What I did

After launching the recovery mode from GRUB I was able to get to a root console. This was good because my girlfriend had her laptop so I could send the CV from her Windows XP system (don’t laugh).

Anyway, here goes… but remember before accessing root you should consider backing up your important files so any mishap wont have you eating your heart out.

Please be careful when running commands under Linux as root, if you are unsure then ask someone before making any changes as root.

Detecting USB hard drive

After you plug in your USB device to your USB port, linux add new device into /dev/ folder. At this stage you are not able to use this device. You need to mount it to your system first in order to be able retrieve any data. To find out what name your device have you can run fdisk command:

# fdisk -l

You will get output similar to this:

Disk /dev/sda: 60.0 GB, 60060155904 bytes 255 heads, 63 sectors/track, 7301 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes     Device Boot      Start         End      Blocks   Id  System /dev/sda1               1        7301    58645251   83  Linux

Creating the mount point

Create directory where you want to mount your device:

mkdir /mnt/sda1

Edit /etc/fstab

To automate this process you can edit /etc/fstab file and add line similar to this:

/dev/sda1       /mnt/sda           vfat    defaults        0       0

Run mount command to mount all not yet mounted devices. Keep in mind that if you have more different USB devices in you system, device name can vary!!!

# mount -a

Original article: http://www.linuxconfig.org/Howto_mount_USB_drive_in_Linux

Taming Ubuntu : Access shared Ubuntu folders from Windows XP

Ubuntu is a wonderful system especially for those who want to be in control of their operating system. On the other hand, sometimes you just want something to work without the hassle. Here is how to overcome one of those hassle if you or your friends want to share files across an Ubuntu installation.

On Ubuntu

Run the following command on your Ubuntu machine as root.

Please be careful when running commands under Linux as root, if you are unsure then ask someone before making any changes as root.

sudo smbpasswd -a 'yourusername'

Add a password when prompted (can be different from pc password).

On Windows

Simply access \\xxx.xxx.xxx.xxx\. Where xxx.xxx.xxx.xxx can either be the machines’ IP address or name.

When asked for credentials, provide user name, password for samba.

That’s it, you now have access to your Ubuntu system.

Migrating Cforms 2 to Production Server

Cforms II is one of the most popular plug-ins considered by WordPress. I recently started using this plug-in for the contact form on any website that I create and it works like a charm. The only problem arise when you want to migrate your local development install to your production server. Here I am presenting a nice little script that I put together to help with fixing the form references after migration.

The Problem

When you migrate your cforms plugin from server to server, cform apparently keeps reference to the initial install which for me caused a lot of problem. For instance, when the website was loading I realise that a file was being referenced from my local server. huh!!! I was curious which plugin was doing this and went straight to the database only to find out that the culprit (with no fingers pointing) was cforms.

These are the references that it keeps:

Because the cforms data is being saved in the database as serialised data changing these from the database would cause the data to be corrupted and in some instances cause your cforms install useless.

For me, I had both problems, I initially tried to update the data from the database and it got corrupted and I tried using the methods prescribed by cforms to fix this problem but that didn’t work. Cforms method is to disable and enable the plugin or edit the data in the little form that the corrupt data page gives you.

Remember, always backup your wordpress install, both database and files before messing around, especially in production environments.

Also, in cforms, go to global settings and backup all settings.

The Solution to Updating the References

After finding that the problem was with cforms I went into cforms code and found what they were doing and here is the final result. Use this method if you have moved over your installation and want to update the references to your production server.

The Solution to Remove Cforms Totally and Reinstall

Use this method to totally remove cforms data from the database, especially if cforms constantly reports that its data is corrupt and doesn’t give you the option to remove it.

Remember to backup your website before messing around.

  • WordPress version: WordPress 2.8.1
  • Cforms version: Cforms 2 10.5.2

Events Management Web Portal

This design and development was for a company that does entertainment events management and production. The company, YaadStyle Entertainment, is geared towards providing reggae and dancehall entertainment to Jamaica, the Caribbean and the World. The company needed the system to be able to sell tickets and other merchandise and also be able to allow it’s users to blog. To facilitate this, I fused Magento commerce and WordPress a blogging systems to have one coherent theme. I then used a WordPress event plugin and modified it for my needs.

The website uses the CMS engine of Magento but is not limited to that alone. It is able to use the CMS functionality of WordPress if necessary.

Technologies used:

  • CSS
  • XHTML
  • PHP
  • jQuery
  • XML
  • Photoshop/GIMP

Major Website Features:

  • Events creation
  • Bloggable events
  • Events calendar
  • Upcoming events
  • Image Gallery
  • Video Gallery
  • E-commerce
  • Blog
  • CMS