Install node.js

Here’s how to install node.js on your cPanel server

yum install openssl-devel
cd /usr/local/src
wget http://nodejs.org/dist/v0.6.8/node-v0.6.8.tar.gz
tar zxvf node-v0.6.8.tar.gz
cd node-v0.6.8
./configure
make
make install

If you get the error:

File "./configure", line 433
fpu = 'vfpv3' if armv7 else 'vfpv2'
^
SyntaxError: invalid syntax

the python script may be attempting to run the configure file with the default cPanel Python 2.4. So, install Python 2.7 alongside python 2.4 and re-run the script again using:

python2.7 ./configure

Then it ran correctly.

The purpose of this was to test to see if node.js could deliver the same functionality as python3 -m http.server or python -m SimpleHTTPServer.

prettyping.sh

From CrazyTerabyte Blog

prettyping.sh – A better UI for watching ping responses

Do you run ping tool very often? Do you find yourself squeezing your eyes to see if a packet has been lost? Do you want to have a better view of the latency and of the lost packets over time? Then you need prettyping.sh, a wrapper around the standard ping tool with the objective to make the output prettier, by making it colorful, more compact, and easier to read. How? Look at the following animated GIF (being played at 4× the actual speed):

Continue reading “prettyping.sh”

Cpanel / SuPHP fix permissions

Here are a few one liners to change the perms needed when switching to suphp. The following commands will look in every user’s html folder and make the appropriate chmod to allow php to properly execute under SuPHP.

* For Directories
find /home/*/public_html/ -type d -print0 | xargs -0 chmod 0755
* For Files
find /home/*/public_html/ -type f -not -name "*.pl" -not -name "*.cgi" -not -name "*.sh" -print0 | xargs -0 chmod 0644
* For CGI/Scripts
find /home/*/public_html/ -type f -name "*.cgi" -print0 -o -name "*.pl" -print0 -o -name "*.sh" -print0 | xargs -0 chmod 0755
  
Don’t forget to check for files owned by ‘nobody’ or ‘root’ — they will also fail with a 500 error. The following Perl script will eliminate nobody/root ownership. Place the Perl script into your /home directory and execute it.

#!/usr/bin/perl -w

my @dirs = grep -d,< *>;

foreach my $user (@dirs) {
`chown -R $user:$user $user/public_html/*`;
}