Tech Thought

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

Entries for the ‘Linux’ Category

How-To: Check root DNS settings for domain

Using “dig” you can determine what IP address or CNAME your domain is pointing to quite easily. However what I didn’t know was that you can actually check what the root server thinks your domain is pointing at, so you can check if its set correctly when you are migrating to a new IP address. [...]

Leave a Comment

How-To: Recursively remove .svn folders

Okay, so you’ve accidentally adding a bunch of files to SVN.  Or, you need to copy a bunch of files but you don’t want to take the .svn folders with you.  How to get rid of these?  On any *nix machine (Mac included) you can run the following command: rm -rf `find . -type d [...]

Comments (1)

yum fails: Fixing Fedora Core 5 yum repositories

Fedora Core 5 is currently EOL – it’s not supported any more.  As a result, you might find you can’t use yum to install packages any more – you get an error message about this file not existing: http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os/repodata/repomd.xml This is because the repositories that yum uses aren’t there anymore.  However you can modify the [...]

Comments (6)

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

Comments (1)

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 (2)

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

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

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

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

Comments (3)

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 (2)

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

Comments (4)

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