Posts Tagged ‘cpanel’

Frontpage can DIAF.

If you are still using Frontpage in 2010, please set your computer on fire. Seriously.

All day, people email in with problems with Frontpage Extensions under cPanel.. they have no idea that this support is largely a hack. They don’t know that we are praying for it to be removed in the next version.

The fact of the matter is, the functionality barely works, and our troubleshooting is limited to remove and reinstall. Most of the time we get lucky and this works.

Sometimes, not so much. Frontpage Extensions haven’t been updated since 2002. There’s a reason for this, and it’s not because Microsoft got it perfect. Just sayin’.

OMG WALL HAX

So, I was trying to figure out who filled up /home today. Believe it or not, running `du -h –max-depth=1` on a 1TB drive under heavy use takes a while. Luckily, on a cPanel server, there is a .ftpquota file in each user’s home directory. This is not updated in real time, but it’s generally close enough.  So I cheated and wrote this little hack.

#!/usr/bin/perl
@files = `ls /var/cpanel/users`;
foreach $user (@files) {
        chomp $user;
        $quotafile = "/home/$user/.ftpquota";
        if (-e $quotafile) {
                $quota = `cat $quotafile`;
                chomp $quota;
                ($spam, $ham) = split/ /,$quota;
                $gb = sprintf("%.2f",$ham / 1024 / 1024 / 1024);
                if ($gb < 1) { next; }
                print "$user: $gb\n";
        }
}

Let me know if you’ve got a better way to do this.  I’m interested to learn new dirty hacks.

Oh, and by the way, one user was consuming 863GB.