Skip to content

{ Monthly Archives } October 2009

Secure Directory with HtAccces

Step1 Create htaccess file htpasswd -c passfile selim I wish to secure /usr/share/phpmyadmin < Directory "/usr/share/phpmyadmin" > Options -Indexes FollowSymLinks DirectoryIndex index.php AuthType Basic AuthName “Gesicherte Bereich” AuthUserFile /etc/phpmyadmin/passfile require valid-user < /Directory >

Backup MySQL with Python

#!/usr/bin/python #purpose: backup mysql database usin mysqldump # date: 05.07.2009 # S.Kraneis import os import time DESTDIR=’/home/kraneis/python/backup/’ USERNAME=’root’ PASSWORD=’testpw’ DATE= time.strftime(“%Y-%m-%d”) DBLIST = [“testdb”] def DUMP_CMD(x): # cmd = “mysqldump –add-drop-table -u %s -p%s %s > %s%s-%s.sql” % (USERNAME,PASSWORD,x,DESTDIR,x,DATE) cmd1 = “mysqldump –add-drop-table -u ” + USERNAME + ” -p” + PASSWORD + ” ” […]

Tagged ,

APC ‘unsupported protocol’

I want to install php-extension APC over PECL. I get this error: is using a unsupported protocal – This should never happen. install failed I found on this solution: Some PEAR installations on PHP 5.2.9 and 5.2.10 seem to be corrupted. When trying to install something, you will get the error: is […]

Tagged ,

List all Directories and file in Python

I want list all directories and files in python. here is short code: #!/usr/bin/python import os COUNT=0 for root, dirs, files in os.walk(‘/home/kraneis/python/’): for name in files: filename = os.path.join(root,name) print filename COUNT +=1 TOTAL=COUNT print “Es gibt insgesamt ” + str(TOTAL) + ” files” …. …. /home/kraneis/python/examples/xml/languages.xml /home/kraneis/python/examples/numbers/ /home/kraneis/python/examples/numbers/ /home/kraneis/python/examples/lists/ /home/kraneis/python/examples/lists/ Es gibt insgesamt […]