Categories Archives: Linux

Vanilla Kernel on CentOS

If compiling a Vanilla kernel for CentOS, you may encounter the following after rebooting: Setuproot: moving /dev failed: No such file or directory Setuproot: error mounting /proc: No such file or directory Setuproot: error mounting /sys: No such file or directory […] Kernel panic – not syncing: Attempted to kill init! To resolve the booting […]

Cpanel: Error invalid maildir size file

Sometimes an email account goes over quota and the quota can’t be adjusted due to the following error: Error invalid maildir size file The following commands ran as root will resolve most email quota issues for a Cpanel account, including incorrect quota calculations. Substitute <cpaneluser> with the Cpanel user which owns the email account having […]

Copy one disk to another using Linux and DD

The following will copy two disks, partition table and all, with forensic quality, and pad the destination disk with zeroes if any data is unreadable on the source disk. Be sure you’ve identified which disk is which using combinations of dmesg and ‘fdisk -l’. The destination disk must also be equal or greater in size. […]

Linux: Shutdown/Poweroff command

The other day I was surprised to find the ‘shutdown -h now’ command on the Redhat/Centos rescue CD doesn’t work. I’ve since discovered a few other ways to get a Linux OS to power off, each should accomplish the same thing – gracefully power down. shutdown -h now halt poweroff init 0

Cpanel: Install mod_geoip for PHP

First, install the Maxmind GeoIP database. mkdir /usr/local/share/GeoIP cd /usr/local/share/GeoIP wget gzip -d GeoIP.dat.gz wget gzip -d GeoLiteCity.dat.gz wget tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf custom_opt_mod-mod_geoip.tar.gz Then, recompile Apache and PHP. /scripts/easyapache

Cpanel: Clear out catch-all and default email

Cpanel creates a default address inbox for each domain consisting of the Cpanel user’s primary username. This address is not used for normal email, rather as a catch-all (if enabled) or a sink-hole for delivery failures or auto-generated mail from scripts. It is fairly safe to regularly empty out these mailboxes, and it will free […]

Linux: Sort disk usage with awk

Sort the output of ‘du’ in human readable format (similar to the -h switch). du -k | sort -nr | awk ‘ BEGIN { split(“KB,MB,GB,TB”, Units, “,”); } { u = 1; while ($1 >= 1024) { $1 = $1 / 1024; u += 1 } $1 = sprintf(“%.1f %s”, $1, Units[u]); print $0; } […]

Asterisk: Call rejected, CallToken Support required.

When connected with peers running older versions of Asterisk, the following error might come up and inbound calls from the peer are rejected: ERROR[xxxxx] chan_iax2.c: Call rejected, CallToken Support required. If unexpected, resolve by placing address x.x.x.x in the calltokenoptional list or setting user guest requirecalltoken=no To resolve this, place the following in iax_custom.conf and […]

Cpanel: Undefined subroutine &Compress::Zlib::gzopen

On a particular Cpanel box I occasionally receive the following when attempting to install or update any Perl module — whether initiated by myself or by Cpanel: Undefined subroutine &Compress::Zlib::gzopen The fix is to remove all traces of Compress:Zlib with the following command: rm -rf `find /usr/lib/perl5/ | grep Compress | grep Zlib` When this […]