donderdag 28 augustus 2008

ssh X forwarding on your server

If you have an ubuntu/debian server running and want to run X apps through ssh -X you should "apt-get install xauth" for this to work.

woensdag 27 augustus 2008

tortoise SVN

In some cases tortoise svn (windows svn client) can't do checkouts of your repository and the following message is displayed:

"Not authorized to open root of edit operation"

Adding the following line to your svnserve.conf solved the problem for me:

"anon-access=none"

woensdag 13 augustus 2008

Hollandse hitmachines

Voor al uw nederlandse artiesten en hollandse hitmachines

http://www.watzitjenoutekijken.nl

convert int to a separate bytes

def intToBytes(self,n, bytecount):
""" returns the binary of integer n, using count number of digits """
str = ""

i=bytecount-1
#8 bit mask
mask = ~(sys.maxint^(pow(2,8)-1))
while i >= 0:
str = str + chr((n>>(i*8))&mask)
i-=1

return str

dinsdag 12 augustus 2008

convert bytes to an integer in python

ran into a situation where i had to convert some bytes to an integer value in python. This func does the trick. The mask is only used to have a counter of the same length counting backwards (hence the negation).
def bytesToInt ( self, bytes ):
""" convert certain amount of bytes to an integer """
size=0
i=0

mask = sys.maxint&(len(bytes)-1)
while i < len(bytes):
size = size|ord(bytes[i])<<((~i)&mask)*8
i+=1

return size