Çarşamba, Eylül 26, 2007

VirtualBox Vista(Guest) network driver sorunu

cd ~/install_files
wget http://www.amd.com/us-en/assets/content_type/utilities/V4.51.zip
unzip V4.51.zip -d driver
mkisofs -o driver.iso -R -J driver

iso dosyasını  VirtualBox a mount ettikten sonra

Control Panel > Hardware and Sound > Device Manager. Sağ klik
Ethernet Controller > Update Driver Software

diyerek yükleyebilirsiniz...

Salı, Eylül 04, 2007

plesk için domain yedekleme

import zipfile
import sys, os, shutil, string

plesk_vhost_yolu = "/var/www/vhosts/"
yedeklenecek_yol = "/yedeklenecek/yol/"

class RecursiveFileIterator:
#http://www.faqts.com/knowledge_base/view.phtml/aid/6000
def __init__ (self, *rootDirs):
self.dirQueue = list (rootDirs)
self.includeDirs = None
self.fileQueue = []

def __getitem__ (self, index):
while len (self.fileQueue) == 0:
self.nextDir ()
result = self.fileQueue [0]
del self.fileQueue [0]
return result

def nextDir (self):
dir = self.dirQueue [0]   # fails with IndexError, which is fine
# for iterator interface
del self.dirQueue [0]
list = os.listdir (dir)
join = os.path.join
isdir = os.path.isdir
for basename in list:
fullPath = join (dir, basename)
if isdir (fullPath):
self.dirQueue.append (fullPath)
if self.includeDirs:
self.fileQueue.append (fullPath)
else:
self.fileQueue.append (fullPath)

domain_listesi = os.listdir(plesk_vhost_yolu)
for domain in domain_listesi:
print "%s icin yedekleme basliyor "%domain
file = zipfile.ZipFile(yedeklenecek_yol+domain+".zip", "w")
directory = plesk_vhost_yolu+domain+"/httpdocs/"

for name in RecursiveFileIterator(directory):
if os.path.isfile(name):
file.write(name, name, zipfile.ZIP_DEFLATED)

file.close()
print "%s icin yedekleme tamamlandi "%domain