Author Archives: Randy

Windows 2008: Disable password complexity requirement

Method 1 In Windows Server 2008, there is an option in Local Security Policy. Click on Start and then Administrative Tools and then click on Local Security Policy. In Local Security Policy, click on Account Policies and then click on Password Policy. Under Password Policy, double click on “Password must meet complexity requirements” and then […]

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. […]

Windows: Ignore errors with Xcopy and RoboCopy

To copy entire directory structures as quickly as possible and ignore all disk errors (useful in data recovery) either of the following commands should work with robocopy being the quickest (if you’ve got Vista/7 or XP with the XP Resource Kit installed). Both commands use source -> destination path order. xcopy /C/H/R/S/Y c:\ d:\ /C […]

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 http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz gzip -d GeoIP.dat.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz gzip -d GeoLiteCity.dat.gz wget http://twiki.cpanel.net/twiki/pub/EasyApache3/CustomMods/custom_opt_mod-mod_geoip.tar.gz 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 […]

Fixing RTL8111/8168B kernel module on Debian/Ubuntu

For many years, issues with the r8169 module have plagued Debian and related Linux distributions such as Ubuntu. You’ll see lots of ifconfig errors and stuff like this on desktop mainboards with a Realtek NIC: Oct 29 07:40:32 c1100d335 kernel: [1996163.743022] NETDEV WATCHDOG: eth0: transmit timed out Oct 29 07:40:32 c1100d335 kernel: [1996163.777667] r8169: eth0: […]