Monthly Archives: December 2009
Cpanel overwrites config files
Cpanel is a great control panel. However, one drawback is that configuration changes and/or customizations are often overwritten after every upgrade. In order to stop cpanel from overwriting your configuration files you must use the following file: vi /etc/cpanelsync.exclude The format for this file is one file per line. i.e. /etc/exim.conf Then save the file …
Restrict FTP access by IP
You can restrict FTP access by IP through a .ftpaccess file. # # Simple .ftpaccess file to control which IPs # can access this directory structure # Allow 212.32.5.0/26 Allow 158.152.0.0/16 DenyAll # # end # If this method doesn’t work you can also use iptables. However, this is only a valid option if you …
Hello World test script
CGI-PERL Hello World #!/usr/local/bin/perl print “Content-type: text/htmlnn”; print “Hello, world from Server Sitters!n”; ASP Hello World <HTML> <HEAD> <Title>Server Sitters Hello World! ASP Example</title> </HEAD> <BODY background=”” bgColor=#ffffff> <P>From all of the Server Sitter’s Staff we would like to say,</P> <h2> <% Response.Write (“Hello World!”) %> </h2> </BODY> </HTML> PHP Hello World <HTML> <HEAD> <Title>Server …
Argument list too long
In Linux there is a maximum number of files that can be removed from a folder using: rm -rf /home/$foldername/* Instead, you can use the find command which will find each file in a specific folder and then remove it. This is extremely helpful when you have to remove thousands of files from a mail …
obfuscate PHP version
To hide your php version edit your php.ini flie: Change the following option expose_php = On to expose_php = Off or: expose_php = 1 to expose_php = 0 Then restart apache.
Get CPU speed in Linux
cat /proc/cpuinfo This will show you the number of processors/cores and the speed/memory capabilities of them.
Sending e-mail with CDO
CDONTs Microsoft has discontinued the use of CDONTs on Windows 2000, Windows XP and Windows 2003. If you have used CDONTs in your ASP applications, you should update the code and use the new CDO technology. Sending e-mail with CDO CDO (Collaboration Data Objects) is a Microsoft technology that is designed to simplify the creation …
Make a file read only
To make a file on a Linux system read only use the following: #add protection chattr +i filename This will ensure nothing can change the file unless it removes the chattr bit prior to writing to the file. If you need to update the file run: #remove protection chattr -i filename This will enable editing …
disable selinux
selinux often breaks applications or scripts and it’s necessary to disable selinux. To disable selinux: echo 0 > /selinux/enforce
sed string replacement
Here’s how you can replace a string in a file with sed: perl -pi -e ‘s/replaceme/reoplacewith/g’ filename.txt This is a VERY basic replacement without and special characters. Be VERY careful if you have special characters that you’re trying to replace. If you have characters like: / you will have to proceed them with a to …
- English Support
- 24/7 x 365
- Branded Support
- Reduced Overhead
- Linux Experts
- Friendly Staff