Tech Thought

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

Entries for the ‘Linux’ Category

How-To: Remotely monitor your server with monit

moint is a fantastic utility that can be installed on Linux or Mac OS X and provides the ability to monitor services running on your server.  These could be apache, mysql, bind or any other service you need to be up and running.  After installing monit, you create a config file containing information about the [...]

Leave a Comment

How-To: Check a Reverse DNS Record Lookup (PTR Record) and Solve Email Delivery Issues

More and more mail servers are starting to reject email if your outgoing mail server doesn’t have a reverse DNS record or PTR record. You can check if you have one by issuing the following command:

dig -x 127.0.0.1

Obviously, replace the 127.0.0.1 address with the relevant IP address of your mail server. You should [...]

Leave a Comment

How-To Fix: make: yacc: Command not found

I have been getting the following error when trying to compile monit for my CentOS server:
make: *** [y.tab.c] Error 127
To resolve it, I simply installed bison:
yum install bison
Then run configure again:
./configure
make && make install
And that fixed the problem!  Hope that helps someone.

Leave a Comment

Handy RPM Search Utility - rpm.pbone.net

If you are looking for an easy way to find RPMs for your favourite linux distribution, there are many options out there.  However none seem to have the easy of use and search capabilites of rpm.pbone.net.  The service is easy to use and covers all the major distributions and version.  Very handy.

Comments (1)

How-To: Configure Postfix to Relay based on Domain

We use Postfix as a dropin replacement for Sendmail on our servers.  We wanted to configure postfix to relay email via our internal mail server for internal email addresses, and send directly if the email address was external.
To do this, follow these steps:

Edit the /etc/postfix/transport file and add the following line:
myinternaldomain.com smtp:[ipaddress]:25
Edit the [...]

Leave a Comment

Centralized storage of prototype.js with Google AJAX Libraries API

Google has just announced that it now provides a free, hosted copy of a many common AJAX Javascript libraries through Google AJAX Libraries API.  This has huge implications for speed and caching for users hitting sites which utilise these libraries:

Google automatically serves them up in Gzip format (if your browser supports this)
Caching is done by [...]

Leave a Comment

How-To: Convert Epoch to Normal Time

If you want to covert from epoch (number of seconds since 1970) to a more human readable format, you can use this simple perl script:

#!/usr/bin/perl
$time = localtime($ARGV[0]);
print “$time\n”;

Save it as epoch.sh and make it executable, then simply issue the following command from the command line:

$> ./epoch.sh 1211926097
Wed May 28 08:08:17 2008

It’s that easy!

Leave a Comment

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 at [...]

Leave a Comment

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 [...]

Leave a Comment

Upgrading PHP on Fedora Core 5 (or other distro)

Download the RPMs you require for your new PHP installation from the following URLs. If you have RPMs that aren’t listed, use the search function:

php-5.2.5

pcre-6.6
php-cli-5.2.5
php-common-5.2.5
php-pear-1.7.1
php-gd-5.2.5
php-pd-5.2.5
php-mysql-5.2.5
sqllite

Or if you are upgrading another distrobution, search for the equivalents here.
Check which PHP RPMs you currently have installed:
rpm -qa | grep phpphp-5.1.6-1.6
Output should be something like:
php-pear-1.4.9-1.2

php-pdo-5.1.6-1.6

php-gd-5.1.6-1.6

php-mysql-5.1.6-1.6
** Do The Following [...]

Comments (3)

What redhat/fedora distribution am I running?

To determine which version of Fedora or Redhat you are running, simply type:
cat /etc/redhat-release
This will then display something like:
Fedora Core release 5 (Bordeaux)

Leave a Comment