cpedialog的login.py中的小问题
google app engine 中import yaml问题的解决
转自:http://bluedusk.javaeye.com/blog/341832
通过代理上传Google App Engine 应用
这个是Google app engine的一个issue:
Seems to be no support for proxy in appcfg.py
http://code.google.com/p/googleappengine/issues/detail?id=126
解决方案:[Windows]
1、在命令行中Set evironment variables:
set http_proxy=http://proxy.blah.com.au:3128
set https_proxy=https://proxy.blah.com.au:31
C:\PROGRA~1\Google\GOOGLE~3>set https_proxy=https://proxy.blah.com.au:3128/
http_proxy=http://proxy.blah.com.au:3128/
2、下载Change the appcfg.py file:
http://googleappengine.googlecode.com/issues/attachment?aid=-622907771208491476&name=appcfg.py
替换掉:
C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py
appcfg.py
59.6 KB Download
3、如果替换后出现如下错误:
I replaced the appcfg.py file and now i get this error…
Traceback
File “C:\Program Files\Google\google_appengine\appcfg.py”, line 53, in
from google.appengine.api import appinfo
File “C:\Program Files\Google\google_appengine\google\appengine\api\appinfo.py”,
line 31, in
from google.appengine.api import validation
File “C:\Program Files\Google\google_appengine\google\appengine\api\validation.py”,
line 44, in
import yaml
ImportError: No module named yaml
就要安装yaml:
C:\Program Files\Google\google_appengine\lib\yaml>python setup.py install
[To solve the yaml trouble you have to install yaml, as described in
4、如果还有认证的问题:
Then to solve the authenticated proxy trouble, I used the arthurfreeman’s appcfg.py
and I’ve tried to modify it according to elspoono suggestion, but I still had
troubles with my corporate NTLM authenticated proxy, then I’ve installed and
configured ntlmaps proxy and finally solved! (using the original arthurfreeman’s
appcfg.py)
http://ntlmaps.sourceforge.net/
This Python proxy hides every issue about authenticated NTLM proxy, before running it
you have to input some infos in server.cfg file:
- port for ntlmaps listener
- your real proxy address
- your real proxy authentication domain/account/password
- your machine’s nt_hostname
- friendly ips (in this case your machine ip)
Then , running the ntlmaps proxy on port 5865, I’ve configured the environment
variables in this way:
set https_proxy=https://localhost:5865
set http_proxy=http://localhost:5865
and finally succeed in uploading my first application in google app engine!
5、这下该可以了吧!!:)
ubuntu下tty的zhcon配置
原文章地址:http://www.casparant.com/tty-configuration-under-ubuntu.html
解决了的问题:1.tty下显示中文,2.支持中文输入,3.合适的分辨率,4.关闭终端响铃
第一步:打开FrameBuffer模块
参考网址:http://blog.chinaunix.net/u/12679/showart_513111.html
编辑文件:
sudo vi /etc/initramfs-tools/modules
加入三行内容:
fbcon
vesafb
vga16fb
编辑文件:
sudo vi /etc/modprobe.d/blacklist-framebuffer
把以下两行给注释掉:
blacklist vesafb
blacklist vga16fb
编辑文件:
sudo vi /boot/grub/menu.lst
在启动条目的内核项后面加入vga=xxx参数
xxx所代表的值可以用下面的方法来查看:
sudo hwinfo –framebuffer | grep ‘1280 ‘
这是我机子上的结果: Mode 0×0307: 1280×1024 (+1280), 8 bits
Mode 0×031a: 1280×1024 (+2560), 16 bits
Mode 0×031b: 1280×1024 (+5120), 24 bits
Mode 0×0379: 1280×768 (+1280), 8 bits
Mode 0×037a: 1280×768 (+2560), 16 bits
Mode 0×037b: 1280×768 (+5120), 24 bits
选择1280×1024的分辨率,16位色,所以应该在vga=后面加上0×031a
恩,你要用时要去网上查下自己显示器的最佳分辨率
在选择
第二步,安装支持中文的控制台zhcon并启动
sudo apt-get install zhcon
引用
chenjihua说:这里缺少了一步:
sudo update-initramfs -u
如果不做这一步,重启后会无法正常显示控制台。
重启后,
在tty状态下输入命令
zhcon –utf8 –drv=fb
在很多网页上提到使用–drv=vga参数来启动zhcon,这样做在我的机子上显示的分辨率是640×480,我希望有一个我看着比较舒服的大分辨率,所以我使用–drv=fb参数来启动zhcon
第三步,优化
化简zhcon启动的参数:
在~/.bashrc中增加一行,
alias zhcon=’zhcon –utf8 –drv=fb’
这样在启动zhcon时只需要输入zhcon即可。
设置zhcon开机自动启动:
在~/.bashrc中增加一行,
[[ $(tty) == /dev/tty[0-9]* ]] && zhcon
不过这个方法只针对当前用户,即对tty登入时的帐户下的~/.bashrc设置这行才有效。
第四步,中文输入法支持
zhcon中可以输入中文。Ctrl+Space即可。
第五步,关闭终端响铃
因为有时候电脑要在课上用,所以关闭system bell还是很有必要的。
网上找了半天,找到一个softbeep的软件,摆弄半天还是没成功。
狗狗告诉我,把pcspeaker这个模块给-r掉,我找了一下,Ubuntu没这个模块。
继续google,发现Ubuntu这个模块名字叫pcspkr,给它blacklist了算了。
sudo vi /etc/modprobe.d/blacklist
添加一行
blacklist pcspkr
搞定。
python socket.error: (98, 'Address already in use')
Traceback (most recent call last):
File “google_appengine/dev_appserver.py”, line 60, in <module>
run_file(__file__, globals())
File “google_appengine/dev_appserver.py”, line 57, in run_file
execfile(script_path, globals_)
File “/home/a/google_appengine/google/appengine/tools/dev_appserver_main.py”, line 474, in <module>
sys.exit(main(sys.argv))
File “/home/a/google_appengine/google/appengine/tools/dev_appserver_main.py”, line 453, in main
static_caching=static_caching)
File “/home/a/google_appengine/google/appengine/tools/dev_appserver.py”, line 3209, in CreateServer
return BaseHTTPServer.HTTPServer((serve_address, port), handler_class)
File “/usr/lib/python2.5/SocketServer.py”, line 330, in __init__
self.server_bind()
File “/usr/lib/python2.5/BaseHTTPServer.py”, line 101, in server_bind
SocketServer.TCPServer.server_bind(self)
File “/usr/lib/python2.5/SocketServer.py”, line 341, in server_bind
self.socket.bind(self.server_address)
File “<string>”, line 1, in bind
socket.error: (98, ‘Address already in use’)
这个问题,主要是没把上一个项目关闭
解决方法,把终端关了,再开,或者把用户注销下下
