預設安裝Ubuntu時,安裝vsftpd伺服器
於/var/log/vsftpd.log 不會自動產生log輪轉的問題!!
解決方式:
apt-get install logrotate
logrotate -vf /etc/logrotate.conf
2010年2月1日 星期一
Vsftpd.log 不輪轉的問題
2010年1月19日 星期二
iscsitarget make error block-io.c
link: http://www.l4l.be/index.php/linuxdocs/46-storage/112-iscsi-enterprise-target-installatie
Installatie
Zorg er voor dat de compiler en bijbehorende tools geinstalleerd staan, ook is openssl-dev nodig. Onder Ubuntu doe je dit met:
apt-get install build-essential libssl-dev
Download IETd, also-known-as iscsitarget:
wget http://downloads.sourceforge.net/project/iscsitarget/iscsitarget/0.4.17/iscsitarget-0.4.17.tar.gz
Pak het uit:
tar xzvf iscsitarget-0.4.17.tar.gz
cd iscsitarget-0.4.17
Als je nu zou willen compileren, dan loop je tegen het volgende probleem op:
iscsitarget-0.4.17/kernel/block-io.c: In function ‘blockio_open_path’:
iscsitarget-0.4.17/kernel/block-io.c:164: error: implicit declaration of function ‘open_bdev_excl’
iscsitarget-0.4.17/kernel/block-io.c:164: warning: assignment makes pointer from integer without a cast
iscsitarget-0.4.17/kernel/block-io.c: In function ‘blockio_detach’:
iscsitarget-0.4.17/kernel/block-io.c:328: error: implicit declaration of function ‘close_bdev_excl’
iscsitarget-0.4.17/kernel/block-io.o] Error 1
iscsitarget-0.4.17/kernel] Error 2
Met andere woorden er is een probleem... Open het bestand block-io.c in je favoriete editor, en ga naar regel 164. Daar staat:
bdev = open_bdev_excl(path, flags, THIS_MODULE);
Verander dit in:
bdev = open_bdev_exclusive(path, flags, THIS_MODULE);
Ook is er een verandering nodig in regel 328, voor het gemak geef ik hier de volledige verandering weer:
static void
blockio_detach(struct iet_volume *volume)
{
struct blockio_data *bio_data = volume->private;
int flags = FMODE_READ | (LUReadonly(volume) ? 0 : FMODE_WRITE);
if (bio_data->bdev)
close_bdev_exclusive(bio_data->bdev, flags);
kfree(bio_data->path);
kfree(volume->private);
}
Nu kun je compileren/installeren:
make
sudo make install
2010年1月1日 星期五
lo: Disabled Privacy Extensions 錯誤on ubuntu 9.04
dmesg
lo: Disabled Privacy Extensions
lo: Disabled Privacy Extensions
lo: Disabled Privacy Extensions
lo: Disabled Privacy Extensions
........ more
修改 vim /etc/default/grub
於GRUB_CMDLINE_LINUX="" 加入 ipv6.disable=1
GRUB_CMDLINE_LINUX="ipv6.disable=1"
存檔後
執行 update-grub
reboot
2009年12月21日 星期一
Google App Engine文件 備份下載
Link from: http://www.manatlan.com/blog/zipme___download_sources_of_your_gae_website__as_a_zip_file
注意事項:
www.google.coma/a/mydomain 的用戶沒有辦法登入GAE
所以請另外開一個app帳戶, 請mydomain的管理者邀請
Administration
Developers <== Invite a Developer to Collaborate on this Application:
Enter a complete email address
修改app.yaml加入下列二行 :
- url: /zipme
script: zipme.py
以下存檔為zipme.py放置於根目錄下 例:http://gae-id.appspot.com/zipme
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
##########################################################################
ZipMe : GAE Content Downloader
##########################################################################
Just add this lines in your app.yaml :
- url: /zipme
script: zipme.py
##########################################################################
""" # manatlan
from google.appengine.ext import webapp
from google.appengine.api import users
import wsgiref.handlers
import zipfile
import os,re,sys,stat
from cStringIO import StringIO
def createZip(path):
def walktree (top = ".", depthfirst = True):
names = os.listdir(top)
if not depthfirst:
yield top, names
for name in names:
try:
st = os.lstat(os.path.join(top, name))
except os.error:
continue
if stat.S_ISDIR(st.st_mode):
for (newtop, children) in walktree (os.path.join(top, name),
depthfirst):
yield newtop, children
if depthfirst:
yield top, names
list=[]
for (basepath, children) in walktree(path,False):
for child in children:
f=os.path.join(basepath,child)
if os.path.isfile(f):
f = f.encode(sys.getfilesystemencoding())
list.append( f )
f=StringIO()
file = zipfile.ZipFile(f, "w")
for fname in list:
nfname=os.path.join(os.path.basename(path),fname[len(path)+1:])
file.write(fname, nfname , zipfile.ZIP_DEFLATED)
file.close()
f.seek(0)
return f
class ZipMaker(webapp.RequestHandler):
def get(self):
if users.is_current_user_admin():
folder = os.path.dirname(__file__)
self.response.headers['Content-Type'] = 'application/zip'
self.response.headers['Content-Disposition'] = \
'attachment; filename="%s.zip"' % os.path.basename(folder)
fid=createZip(folder)
while True:
buf=fid.read(2048)
if buf=="": break
self.response.out.write(buf)
fid.close()
else:
self.response.headers['Content-Type'] = 'text/html'
self.response.out.write("<a href=\"%s\">You must be admin</a>." %
users.create_login_url("/zipme"))
def main():
application = webapp.WSGIApplication(
[('/zipme', ZipMaker)],
debug=False)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
main()
注意事項:
www.google.coma/a/mydomain 的用戶沒有辦法登入GAE
所以請另外開一個app帳戶, 請mydomain的管理者邀請
Administration
Developers <== Invite a Developer to Collaborate on this Application:
Enter a complete email address
2009年11月30日 星期一
訂閱:
文章 (Atom)