Javascript String Replace with Backreferences

There are hundreds of examples of how to use the Javascript String Replace function. However these are often very simple examples and do not fully show the potential power of this easy to use method. So when I came across a more complex real-life problem that required the use of javascript string replace - I thought it might be useful to others to share it.

Linux Hardware Discovery and Performance Tools

Here are some useful utilities to check out what hardware you have installed on your linux server and how it is performing ...

cat /proc/cpuinfo
cat /proc/meminfo
dmesg
lspci

How to Disable SELinux

SELinux can temporarily be disabled on a Linux server using the following command as admin.

echo 0 > /selinux/enforce

The above is very useful for checking whether SELinux is the cause of an issue. To permanently disable SELinux you need to add the following line to /etc/sysconfig/selinux.

SELINUX=disabled

 

Vital Command Line Tools for Linux Server Migration

Here is a crib sheet for the most common and useful commands needed when migrating or backing up a linux server. Thes tools make the work easy and fast. The trouble is that unless you are backing-up manually or migrating servers for a living, must of us only have to deal with these commands occasionally and the exact usage becomes a little hazy over time. below are the basic usage details of tar, wget,mysql and mysqldump ...

Speeding Up DNS Propagation

It can be very frustrating waiting for changes to DNS to propagate across the net. There is little that can be done to actually speed up this process except for this little trick I picked up. Even when propagation has completed, your PC can refuse to see the new IP because it is cached in the DNS Resolver Cache on your PC.

The solution is to flush the DNS Resolver Cache using ipconfig. Open a command console on your PC ( Run as Administrator if using Vista ).

Then execute this command ...

ipconfig /flushdns

Hope this helps someone

Securing a ProFTPD server

If you are looking for ways to lock-down your ProFTPD server without using iptables this may help. I recently had to find a way of securing a VPS without iptables. The ftp server only needed to be accessed by a few known users so I ended up with two reasonable possibilities.

cgi scripts fail SUexec error command not in docroot

I had to track down this problem when I found that my cgi scripts were failing with a 500 Server Error.

The problem is with SUExec which normall requires the cgi scripts to be in the document root.

The fix is to recompile the SUExec with the document root set to /home. Follow these instructions ...

Changing permissions on Files or Directories only in Linux

To change file permissions to 644 use ...

# find . -type f -exec chmod 644 {} \;

To change directory permissions to 755 use ...

# find . -type d -exec chmod 775 {} \;

Troubleshooting QMail toaster installation

QmailToaster is a quick and easy way to install QMail on your server. However when things go wrong there are a few files and techniques you need to know about to track problems down. this post is a simple way for me to document some of the most useful bits of information. Hopefully they will help someone. My system is Fedora 6, different systems may have slightly different  locations. First step is to examine the SMTP log...

Delete Directory Tree in Linux

Every now and then I have needed to delete a whole directory tree.  This is the correct command BUT TAKE WARNING! It will delete the whole directory tree without warning, ALL sub directories and files- so make sure you get it right or you can cause SERIOUS damage to your installation. rm -rf folder_name

Syndicate content