Tech Thought

Tech tips, hints, and general musings. PHP, Perl, Mysql, Javascript, AJAX, JSON, Linux, Mac OSX

Entries for the ‘How To’ Category

Removing ._ files on Linux

If you have zipped up a directory from a Mac OSX machine and unzipped it on a linux box, chances are you have heaps of hidden files that look like ._myfile and ._mydirectory – these are files that OSX uses to keep track of additional information about your files. To remove these, do the following [...]

Comments (3)

MiniFrontpage Joomla Extension – Thumbnails not working

We’re started using Joomla as our CMS for a new website we’ve been developing. One of the key functions we wanted was the ability to display article ‘snippets’ on the front page including a thumbnail image from the article. The MiniFrontpage Joomla extension provides exactly this functionality – so we installed it. Everything was working [...]

Comments (3)

How-To: Export RSS feeds from Mac Mail

To export all your RSS feeds from Mac Mail as a list, open up terminal and enter the following on a single line: IFS=$’\n’;for i in $(find ~/Library/Mail/RSS/ -name “Info.plist”);do grep “<string>http://” $i | sed “s/.*\(http[^<]*\).*/\1/”;done Thanks to macosxhints.com for this one!

Comments (1)

How To: SSH Port Forwarding on Mac OSX

As long as you have SSH access, you can still access ports on a remote server which are blocked via a firewall.  You simply need to use a function of the SSH protocol called Port Forwarding (or Tunneling).   This process allows you to open a port on your local machine, which is forwarded via SSH [...]

Comments (3)

How-To: Determine CPU Speed on Linux

I’ve been trying to work out how fast a server that I maintain is (in Mhz).  The simplest way to do this is to follow these instructions: Enter the following command: dmidecode | grep “Current Speed” | head -n 1 And you should receive output like this: Current Speed: 3400 MHz

Comments (2)

How-To: Fix “command not in docroot” suexec apache error

If you’re in the process of setting up a new server, and you want users to have the ability to execute scripts in their home directory: http://myserver.com/~myname You will often run into problems with suexec. suexec is an apache security construct to stop users from executing scripts outside of a known path. I was recieving [...]

Comments (1)

How-To Fix Perl Error: Can’t locate object method “new” via package “LWP::Protocol::https::Socket”

I came across the following error while trying to connect to an LDAP server over HTTPS using the Perl module SOAP::Lite: Can’t locate object method “new” via package “LWP::Protocol::https::Socket” The way to fix this problem is to install the Crypt::SSLeay module from CPAN. Hope that helps someone!

Comments (2)

How-To: Update all system packages with yum

This might sound like a really really simple thing to do, but it actually took me a little while to work out how to do this. To list all the available packages available for update, use the command: yum list available To update all packages on your system to the latest version, use the command: [...]

Leave a Comment

How-To: Fix SimpleXML CDATA problem in php

If you’ve used the SimpleXML functions in PHP, you may have noticed some strange things happening with CDATA values in your XML file/string. All I needed to do was extract the value of my CDATA fields, however these were always coming back blank in the structure that simplexml_load_file returns. Finally, after hours of trawling google, [...]

Comments (25)

How-To: Fix Mail Server Fully Qualified Domain Name problems

We have been having problems sending emails from our mail server (running Kerio) to a particular domain over the past few weeks.  We kept receiving bounce emails with the following: 550 Rule imposed. Sender using invalid hostname  in greeting as per RFC specification. After trying all manner of solutions, it turned out to be a problem with [...]

Comments (1)

How-To: Redirect one domain to another with mod_rewrite

Recently I needed to change the end of one of our domains from .com to .org. However we wanted to maintain any old links that pointed at the .com domain. Using mod_rewrite you can achieve this move seamlessly for users, and keep all the parameters in tact. Simply add the following lines to your .htaccess [...]

Comments (1)

How-To: Sound Not Working in AVI/Divx on Mac OSX

If you’ve downloaded AVI files and tried to play them in Quicktime, only to discover that they don’t play with any audio, then try installing A52Codec.  It provides a codec for AC3 audio in quicktime, with the following features: Multi-channel decoding of AC3 audio (can do full 5.1 decoding). Implemented as a core-audio component so [...]

Comments (1)

How-To: Install GD on CentOS

Installing the GD library is easy on CentOS thanks to yum.  Simply type: yum install gd gd-devel php-gd And all your GD fun is installed and ready to go.  I was trying to install the Perl module GD::Graph and it wouldn’t compile, complaining: GD.xs:7:16: error: gd.h: No such file or directory After installing the GD-Devel [...]

Comments (7)

How-To: Fix “Bluetooth Not Available” problem in Mac OSX

Recently my Bluetooth on my MacBook Pro stopped working without warning. The bluetooth icon in the top right-hand corner of the screen displayed with a line through it, and showed “Bluetooth Not Available” when I clicked on it. This was REALLY annoying as I use a bluetooth mouse on my Macbook Pro. Thankfully, it was [...]

Comments (90)

How-To: Open .docx Files in Office 2003 and Older

I now use Microsoft Word 2008 (Microsoft Word 2007 if you are on windows) to edit my Word Documents. It has heaps of handy new features that I like and makes my documents look heaps better than the older versions of Microsoft Word. However this can cause problems for people who don’t have Microsoft Office [...]

Leave a Comment

How-To: htaccess – Require a password for some IPs, not others

The following is a really useful .htaccess configuration options to allow certain IP address to access a site without a password, while requiring everyone else to enter a password: AuthName “My Secret Page Here” AuthUserFile /sites/apache-passwords AuthType Basic Require valid-user Order deny,allow Deny from all Allow from 171.231.12.8 Satisfy Any Some really handy examples are [...]

Leave a Comment