使用python实现简易的文件共享

Posted by 4Aiur on 01/21/2011 in Python |

使用python实现简易的文件共享 可以利用python的SimpleHTTPServer共享自己的文件给其他人 python -m SimpleHTTPServer 8000 需要从其他人那拷贝东西到自己机器上时可以用python的CGIHTTPServer这个模块,写一个CGI程序来接收文件。 # alias alias cgiserver=”ifconfig | grep –color -o ‘inet 1[79]2[^ ]*’; python -m CGIHTTPServer 8000″ # cgi_directories [‘/cgi-bin’, ‘/htbin’] # Create directory mkdir incoming/ cd incoming/ mkdir cgi-bin/ files # Create save file CGI program cat > cgi-bin/save_file.py %s cgiserver 其他人通过访问http://uripaddress:8000/upload.html来上传文件。

Tags: ,

修改gb2312网页编码为utf-8

Posted by 4Aiur on 01/10/2011 in Shell |

修改gb2312网页编码为utf-8 find html/ -type f -name “*.html” | \ while read line do mkdir -p foo/dirname $line/ iconv -f GB18030 -t UTF-8 $line 2>/dev/null | \ sed /charset=gb2312/’s/charset=gb2312/charset=utf-8/’ \ > foo/$line done

Tags:

Install GetBundles

Posted by 4Aiur on 01/10/2011 in MacOSX |

Install GetBundles 管理TextMate Bundle的工具,方便查找、安装、更新TextMate Bundle的工具。 mkdir -p ~/Library/Application\ Support/TextMate/Bundles cd !$ svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/ osascript -e ‘tell app “TextMate” to reload bundles’

Tags: ,

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.