Tech Thought

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

Entries Tagged ‘Linux’

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)

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

Comments (1)

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

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: 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: 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

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