Modified for Litecoin (this is not the pool-x version but a work repo)