How to get CodeIntel working in Sublime Text on OSX

Posted November 24th, 2012 in Uncategorized

SublimeCodeIntel is perhaps the most useful and heavily installed package for Sublime Text but it’s also very difficult to get working. The most common issue people run into is the dreaded endless

Info: processing `PHP': Please wait…

This can be fixed by navigating to the SublimeCodeIntel package directory and running For to compile we first need to install two things: pcre and XCode Command Line Tools. Annoyingly this is around 1.6GB of files!


Installing XCode Command Line Tools

Head over here and click View in Mac App Store. Hit install and watch your progress in the Purchases tab.

Once installed open it up and go to XCode – Preferences – Downloads – Components and install Command Line Tools.


Installing pcre

This little script is required by the scintilla package of SublimeCodeIntel. First install MacPorts then run:

sudo port install autoconf
sudo port install pcre
sudo cp /opt/local/include/pcre.h /usr/include/

You’re done! Navigate to the SublimeCodeIntel package directory and run sh src/ If all goes well at the end of compilation you’ll see a done! message. Restart Sublime Text and you’re good to go.

Read More »

Installing RocketRaid 2760a drivers on Ubuntu 12.10

Posted November 8th, 2012 (Updated 30 Dec 2012) in Linux

So I don’t forget, here’s a tutorial on installing the RocketRaid 2760a drivers and management utilities on Ubuntu 12.10. I’m using 64-bit but 32-bit should be the same – just substitute where appropriate.

Installing the Driver

The installation disc comes with an out of date version of the driver and kernel module. The way the installation works, we need to download and compile the kernel module then download the driver installer, drop the module into place and run the installer. Make sure you have appropriate compiler tools installed – to be safe just run

sudo apt-get install ubuntu-dev-tools

Download and extract the ones with kernel 3.x support from the HighPoint website:

mkdir ~/driver
cd ~/driver
# driver
tar -xvzf rr276x-ubuntu-11.10-x86_64-v1.1.12.0502.tgz
# kernel module
mkdir module
cd module
tar -xvzf  RR276x-Linux-Src-v1.1-120424-1734.tar.gz

Build and compress the kernel module for our driver installer:

cd rr276x-linux-src-v1.1/product/rr276x/linux/
# Ignore the warning about not being able to find him_rr2760x.o...doesn't seem to matter
gzip rr276x.ko
mv rr276x.ko.gz ~/driver/boot/rr276x$(uname -r)$(uname -m).ko.gz

And finally install the driver

cd ~/driver
sudo bash

This step succeeded! Now you can press ALT+F1 to switch back to the installation screen!

sudo bash

Update initrd file /boot/initrd.img-3.5.0-17-generic for 3.5.0-17-generic
Please reboot the system to use the new driver module.

sudo shutdown -r now

That should be everything! You can now test with

cat /proc/scsi/rr276x/*


Installing the RAID Management Software

Annoyingly the RAID management console is difficult to install to say the least. The GUI deb packages error when trying to install and HighPoint don’t even provide a deb for the command line version and to top it off the version of the command line utility on the driver CD is newer than the version on their site! For this reason I’ve provided the newer command line RPMs here.

Let’s get this thing installed.

Web version:

mkdir ~/driver/utility
mkdir ~/driver/utility/console
mkdir ~/driver/utility/web
cd ~/driver/utility/web
echo "rr276x" | sudo tee -a /etc/hptcfg > /dev/null
tar -xzvf WebGUI-Linux-v2.1-120419.tgz
sudo apt-get -y install alien
sudo alien -d hptsvr-https-2.1-12.0419.$(uname -m).rpm
sudo dpkg -i hptsvr-https_2.1-13.0419_amd64.deb


Command Line version:

cd ~/driver/utility/console
sudo alien -d hptraidconf-3.5-1.$(uname -m).rpm
sudo alien -d hptsvr-3.13-7.$(uname -m).rpm
sudo dpkg -i hptraidconf_3.5-2_amd64.deb

Run the web server:

sudo hptsvr

You should now be able to connect to it from your browser by navigating to http://localhost:7402 with username RAID and password hpt.


Further Reading

HOWTO: Get GUI hptsvr & hptraid 3.13 working on Ubuntu
HighPoint driver download page for RocketRaid 2760a

Read More »

Partitioning and Formatting New Disks in Linux

Posted November 4th, 2012 in Linux

The below is a quick guide to creating partitions on a newly purchased, unformatted disk. For this guide I’ll be formatting a new WD 2TB Black.


Find the disk you want to partition

# lsblk

sda 8:0 0 55.9G 0 disk
├─sda1 8:1 0 53.6G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2.3G 0 part [SWAP]
sdb 8:16 0 1.8T 0 disk
sdc 8:32 0 1.8T 0 disk

Partitions appear as subitems. Notice sdb and sdc have no partitions – those are the disks I want to format.


Create the partition

# sudo fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd3e43840.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):

Below I’m using the default values to create one large partition for the whole disk.


Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended

Select (default p):
Using default response p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-3907029167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3907029167, default 3907029167):
Using default value 3907029167

Command (m for help):

All done? Write!


The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

That’s all for partitioning! Take a gander at your fancy new partitions:

# lsblk

sda 8:0 0 55.9G 0 disk
├─sda1 8:1 0 53.6G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2.3G 0 part [SWAP]
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part
sdc 8:32 0 1.8T 0 disk
└─sdc1 8:33 0 1.8T 0 part


Format to NTFS

I’m choosing a quick format. You may choose instead to remove the -f argument for a proper one instead.

# sudo mkntfs -f /dev/sdb1

Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.


Optional: Name the drives

Because I’m running NTFS I can give the drives labels. Make sure you have ntfsprogs installed then enter:

# sudo ntfslabel -f /dev/sdb1 YourLabel


More Information

For more information on partitioning check out Chris Wakefield’s post here.
For a short and sweet howto on  formatting as NTFS check here.
Information on NTFS labels here.

Read More »

How to Remove Ctrl+L Key Binding from Pidgin

Posted October 27th, 2012 (Updated 10 Aug 2014) in Uncategorized
Removed 'Clear Scrollback' shortcut

Removed ‘Clear Scrollback’ shortcut

This would have to be far and away the most annoying ‘feature’ of Pidgin.

In just about every web browser, Ctrl+L is used to highlight the URL bar allowing easy navigation via the keyboard. In pidgin it’s used to clear the scrollback of the active window. As a web developer I’m always hitting Ctrl+L in the browser however every now and then I won’t take notice to which window is active on my desktop at the time and use it while Pidgin is active, clearing out the conversation I’m having with my contact at the time. Frustrating!

There was a bug post here about it but as usual the devs don’t particularly care and instead just pointed to their FAQ page. For convenience here’s how you remove the shortcut:

Open ~/.purple/accels and change

; (gtk_accel_path "<PurpleMain>/Tools/Preferences" "<Primary>p")


(gtk_accel_path "<main>/Conversation/Clear Scrollback" "")

Remember to remove the semicolon at the start of the line!


Read More »

Updating your Banner Slideshows Module

Posted September 3rd, 2012 (Updated 26 Aug 2014) in Uncategorized

One week from this post I will be publishing an update for my Banner Slideshows module for LemonStand which upgrades it to use the newly released Nivoslider 3. This will provide a few nice benefits however the implementation isn’t completely backwards compatible so your frontend code may need updating. Details inside.

What do I need to do?

Simply press the Update slideshow button on your slideshow page in the Administration:

Hit the update button indicated above

Hit the update button indicated above

Then remove your existing slideshow code on your sites frontend and follow the instructions on the marketplace page (to be updated when the module update is released) to add the new version.

How does this benefit me?

The biggest benefit is its new responsive design which resizes with your browser – making it easier to build sites that scale from a desktop monitor all the way down to a mobile phone. I’ve whipped up a live demo to see this feature in action. Open it up and resize your browser window. Notice the slideshow resizes with the window.

Also new in this version of the module is full HTML support for slide descriptions:

HTML support for slide descriptions

HTML support for slide descriptions

Read More »

Creating your first LemonStand Widget

Posted August 22nd, 2012 (Updated 26 Aug 2014) in Uncategorized

Creating custom widgets with the Widgets module for Lemonstand is a quick and painless process. Below, I’ll describe how to build a widget for Lemonstands Contact module. I’ll call this module Simple Contact Widget.

Download the completed module from my GitHub repo.

While this tutorial will go over everything you need to do to build a complete and working module, it would be very beneficial to also know the basics of module development, naming conventions and so on. Take a look at the documentation Developing LemonStand Modules if you haven’t already done so.

Read More »

Add Chrome Web Store Style Vertical Scroll Boxes To Your Site

Posted July 2nd, 2012 in Javascript

I really like the Chrome web store vertical scroll box functionality so figured I’d write up a tutorial post on how to add them to your site.


Hover over the boxes below.

Read on for the code!

Read More »

How to move WPMU domains

Posted May 31st, 2012 in Database, PHP

Here’s a very quick set of SQL snippets for updating a WPMU domain. This might be useful when building a site on a development domain before moving to a production one later on.

Firstly update the wp_blogs table:

UPDATE wp_blogs SET domain='';

There will be a bunch of wp_options and wp_posts tables – one per site. Find all the tables:

SHOW TABLES LIKE "%_options";

and for each table, perform the following query:

#_options tables
UPDATE <tablename> SET option_value=REPLACE(option_value, '', '');
#_posts tables
UPDATE <tablename> SET post_content=REPLACE(post_content, '', '');

This was enough to get the sites working for me. Additional tweaks are probably required afterwards – if you find anything let me know in the comments below.

Read More »

An Introduction to the HTML5 Pointer Lock and FullScreen APIs

Posted May 12th, 2012 in Javascript

Preface: These APIs are still quite new and subject to change. As of the time of writing, the following tutorial works in Chrome 18.0.1025.168. Firefox 12 supports full screen but not mouse lock.

I’ve been having a little play with some HTML5 features and worked up an example of Pointer Lock and Full Screen APIs. As it stands at the moment, pointer lock is tightly coupled with full screen, so you won’t be able to use it without first loading up full screen mode.

You’ll need to enable Enable Pointer Lock in about:flags in Chrome then restart the browser for mouse lock to work.

You may request full screen mode like so:

element.requestFullScreen =
	element.requestFullScreen    ||
	element.mozRequestFullScreen ||

Once in full screen mode, pointer lock should become available:

navigator.pointer = navigator.pointer || navigator.webkitPointer;
	function() {
		console.log('Pointer lock');
	function() {
		console.log('No pointer lock');

Note in the above two scripts, element is a DOM element

Check out the working demo here. I’ve also added some JS to determine the direction the locked pointer is travelling and output the data to the screen. View page source for details.

Read More »

Remove a PPA and roll back changes in Debian

Posted May 10th, 2012 in Linux

If you’re a Ubuntu user, you may be familiar with ppa-purge. It’s a handy little automated script to remove a PPA and roll back the version of any apps installed from that PPA. Debian doesn’t have this nicety by default but there’s a relatively simple way to get something close.

Firstly, remove your PPA from /etc/apt/sources.list or from the /etc/apt/sources.list.d/ directory.

Do an update:

sudo apt-get update

Find any packages that are now obsolete:

aptitude search '?obsolete'

For me this returned the following:

# aptitude search '?obsolete'
i A libmysqlclient18      - MySQL database client library                                                                           
i A mysql-client-5.5      - MySQL database client binaries                                                                          
i A mysql-server-5.5      - MySQL database server binaries and system database setup                                                
i A mysql-server-core-5.5 - MySQL database server binaries                                                                          
i A ruby-passenger        - Rails and Rack support for Apache2 and Nginx

Now just remove the listed packages with apt-get remove and reinstall as necessary. It’s not quite the automated tool that ppa-purge is, but it’s a pretty good start.

Read More »

Page 5 of 15« First...34567...10...Last »