Archive for the 'Tips & Tricks' Category

rm * - Argument list too long

Going through and cleaning out a temporary folder I came across a problem using rm *. It came back with the error Argument list too long. Turns out it’s some type of limit in how many files can be passed and the 110,000 that were in the folder was too many.
So I wrote [...]

How to delete all email messages in cPanel

I stupidly didn’t set the default email address to :fail: on a couple of accounts on my cPanel server and found, while running a remote backup, that there were a few gigs of spam emails that were just sitting in those accounts.
But after going through about a dozen of the 500+ pages in Horde to [...]

Generating element IDs with JavaScript and counters

The code that I posted in my previous post on creating a unique ID in JavaScript is fairly similar to code that’s all over the internet and seemed like it should work. And to be fair, it did work, although with one major problem. If the code runs too quickly it’s possible for [...]

How to generate a unique id in JavaScript

PHP makes it pretty easy to generate a unique it with the uniqid() command. JavaScript doesn’t have that command, but using the getTime() function of the Date object we can do almost the same thing.
PLAIN TEXT
JavaScript:

function uniqid()

    {

    var newDate = new Date;

    return newDate.getTime();

    }

The function returns [...]

XML Parsing Error: junk after document element

Since I had to go through about 20 pages to find the cause of this error, I figured I’d throw up one more with the cause that I found. Hopefully it’ll help somebody spend less time debugging the problem than I had to spend.
I’ve got a PHP script outputting XML that’s called from an [...]