Categories
Linux

how to disable RHN in linux – red hat or centos

What I did to disable it was go to: /etc/sysconfig/rhn

and delete all of the files in it. If you want to re-enabled it after, you can just copy the files back, so you may want to copy them to a location you want to keep them at.

Categories
Linux

How to get external ip via linux command line

wget -O - -q icanhazip.com

you will get a very easy looking readout

example:

root@madhost419 [~]# wget -O - -q icanhazip.com
74.122.196.130
root@madhost419 [~]#

or via curl:

curl http://www.cPanel.net/showip.cgi

Categories
Linux

removing the limit of 100 rows in squirrel

Using the squirrel app: http://www.squirrelsql.org/ I had issues with only seeing 100 rows in a table. I fixed this by going to File -> New Sessions Properties -> Object Tree -> Contents -> limit rows. The default is 100, but you can uncheck it and you should be good.

If not, you can also do the same under New Sessions Properties -> SQL -> SQL Results – limit rows. Then uncheck it and hit OK.

That worked for me!

Categories
nagios

Could not open external command file for reading via open(): (13) -> Permission denied in nagios v4.01

I ended up getting this in my nagios.log, the fix was to change the permissions on the rw file!

chmod 777 /usr/local/nagios/var/rw/nagios.cmd

Categories
nagios

Directory index forbidden by Options directive: /var/www/html/

I was receiving this error in my nagios apache log:

Directory index forbidden by Options directive: /var/www/html/

to fix this, I just did touch index.html to /var/www/html It creates a file in the directory that is empty. I found this safer then turning on indexes for my nagios install.

Categories
Linux

internal server error with CSF (Config Server Firewall) in cPanel after upgrade in cPanel

So I was receiving this error after cPanel upgraded:

Internal Server Error

500

No response from subprocess (/usr/local/cpanel/whostmgr/docroot/cgi/addon_csf.cgi): subprocess exited with status 2

 

This did not fix it:

 

/usr/sbin/csf -x
/scripts/perlinstaller --force URI
/usr/sbin/csf -e
/usr/sbin/csf -u


If that doesn’t work this will:

 

curl -s configserver.com/free/csupdate | perl

 

 

Categories
Linux

How to move files that are older then x days in linux

I found this useful:
sudo find ./* -mtime +2 -exec mv {} /hosting/dropbox/ops/user/client/ \;
breakdown…
./* is the current directory, including all files, but you could use full path.
mtime +2 is 2 days old
mv is the command being executed
and after the brackets is the directory the files are moving to
Categories
Linux

Installing ImageMagick/Imagick on a cPanel Server

I was having issues with my Zen install not being able to handle large images, so I read around and decided to move image cache’ing over to ImageMagick, instead of the GD library. This is what you need to do to install/enble ImageMagick on your cPanel server :

You’ll need to be logged in as root on your VPS/Server :

1. Log into your server as root
2. Create a new directory as below :
mkdir /home/cpimins
3. cd /home/cpimins
4. wget http://layer1.cpanel.net/magick.tar.gz
5. tar zxvf magick.tar.gz
6. cd magick
7. /scripts/installrpm ImageMagick
8. /scripts/installrpm ImageMagick-devel
9. sh ./install

Now we need to get the module for PHP installed :

Log into WHM >> Software >> Module Installers >> PHP Pecl and install imagick to get it binding to PHP properly.

After you do that, restart HTTPD/Apache service and you’re golden!

known issue with transferred domains :

If you do not see this in your php.ini file, or it not functioning properly, then you should go to the directory of the issue’d domain example : /home/domainuser/ and rename php.ini to php.ini.bak

Enjoy!