fedora21防火墙图形界面
2015年5月21日 17:49
fedora21默认未安装firewall的图形界面,需要自己安装
sudo yum install firewall-config
启动
sudo firewall-config
sudo yum install firewall-config
sudo firewall-config
The path "/bin/gcc" appears to be a valid path to the gcc binary. Would you like to change it? [no] Searching for a valid kernel header path... The path "" is not a valid path to the 3.19.7-200.fc21.x86_64 kernel headers. Would you like to change it? [yes]
sudo yum install kernel-devel
[root@wyq-vserver-vm-master ~]# python Python 2.6.6 (r266:84292, Jun 3 2012, 00:16:45) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a=3.4 >>> a 3.3999999999999999 #输出不正常 >>> b=2 >>> b 2 >>> a*b 6.7999999999999998 #输出不正常 >>> print a*b 6.8 #输出正常并且数值正确 >>>
# static目录url路径 STATIC_URL = '/static/' #static目录磁盘路径 STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'mysite/static'), )
STATIC_ROOT = '/homew/wyq/mysite/mysite/static'
from django.conf import settings if settings.DEBUG is False: urlpatterns += patterns('', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.STATIC_ROOT, }), )
RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
service sshd restart
May 9 15:25:17 localhost sshd[54931]: Authentication refused: bad ownership or modes for directory /root
drwxrwxrwx 9 root root 4096 5月 9 15:38 root
drw-xr-r. 1 root root 942 5月 7 16:57 anaconda-ks.cfg
➜ ~ ssh -v root@192.168.8.11 ... Agent admitted failure to sign using the key ...
➜ ~ ssh-add Identity added: /home/wyq/.ssh/id_rsa (/home/wyq/.ssh/id_rsa)
:<<标记 ...代码 标记
:<<EOF echo "hello world" ... EOF
:<<BLOCK echo "hello world" .... BLOCK
sqliteman是sqlite数据库的图形化管理工具
sudo yum install sqliteman
sqliteman
https://github.com/addywaddy/jquery.tagcloud.js
<script type="text/javascript" src="{{ site.baseurl }}/static/js/jquery.tagcloud.js"></script> <div id='category_cloud'> <h3>分类</h3> <div class="categories"> {% for cat in site.categories\%} <a href="/categories.html#{{cat | first}}" rel="{{ cat|last|size }}">{{cat | first}}</a> {% endfor \%} </div> </div> <script> $.fn.tagcloud.defaults = { size: {start: 14, end: 18, unit: 'pt'}, color: {start: '#555', end: '#428bca'} }; $(function () { $('.categories a').tagcloud(); }); </script>
<div class="well"> {% include category_cloud.html %} </div>
https://github.com/blueimp/jQuery-File-Upload
https://github.c➜ flask-demo tree . ├── app.py ├── static │ ├── 123.txt │ └── file-upload │ ├── angularjs.html │ ├── basic.html │ ├── basic-plus.html │ ├── blueimp-file-upload.jquery.json │ ├── bower.json │ ├── CONTRIBUTING.md │ ├── cors │ │ ├── postmessage.html │ │ └── result.html │ ├── css │ │ ├── demo.css │ │ ├── demo-ie8.css │ │ ├── jquery.fileupload.css │ │ ├── jquery.fileupload-noscript.css │ │ ├── jquery.fileupload-ui.css │ │ ├── jquery.fileupload-ui-noscript.css │ │ └── style.css │ ├── Gruntfile.js │ ├── img │ │ ├── loading.gif │ │ └── progressbar.gif │ ├── index.html │ ├── jquery-ui.html │ ├── js │ │ ├── app.js │ │ ├── cors │ │ │ ├── jquery.postmessage-transport.js │ │ │ └── jquery.xdr-transport.js │ │ ├── jquery.fileupload-angular.js │ │ ├── jquery.fileupload-audio.js │ │ ├── jquery.fileupload-image.js │ │ ├── jquery.fileupload-jquery-ui.js │ │ ├── jquery.fileupload.js │ │ ├── jquery.fileupload-process.js │ │ ├── jquery.fileupload-ui.js │ │ ├── jquery.fileupload-validate.js │ │ ├── jquery.fileupload-video.js │ │ ├── jquery.iframe-transport.js │ │ ├── jquery.min.js │ │ ├── main.js │ │ └── vendor │ │ └── jquery.ui.widget.js │ ├── package.json │ ├── README.md │ ├── server │ │ ├── gae-go │ │ │ ├── app │ │ │ │ └── main.go │ │ │ ├── app.yaml │ │ │ └── static │ │ │ ├── favicon.ico │ │ │ └── robots.txt │ │ ├── gae-python │ │ │ ├── app.yaml │ │ │ ├── main.py │ │ │ └── static │ │ │ ├── favicon.ico │ │ │ └── robots.txt │ │ ├── node │ │ │ ├── package.json │ │ │ ├── public │ │ │ │ └── files │ │ │ │ └── thumbnail │ │ │ ├── server.js │ │ │ └── tmp │ │ └── php │ │ ├── files │ │ ├── index.php │ │ └── UploadHandler.php │ ├── test │ │ ├── index.html │ │ └── test.js │ └── test.html └── templates └── index.html 23 directories, 57 filesom/blueimp/jQuery-File-Upload
#encoding=utf-8 from flask import Flask from flask import request from flask import abort, redirect, url_for from flask import render_template import json app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/upload', methods=['GET', 'POST']) def upload_file(): if request.method == 'POST': f = request.files['files[]'] filename = f.filename minetype = f.content_type f.save('static/' + filename) return json.dumps({"files": [{"name": filename, "minetype": minetype}]}) if __name__ == '__main__': app.run(host="0.0.0.0", port=7000, debug=True)
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>jQuery File Upload 示例</title> </head> <body> <input id="fileupload" type="file" name="files[]" data-url="/upload" multiple> <script src="/static/file-upload/js/jquery.min.js"></script> <script src="/static/file-upload/js/vendor/jquery.ui.widget.js"></script> <script src="/static/file-upload/js/jquery.iframe-transport.js"></script> <script src="/static/file-upload/js/jquery.fileupload.js"></script> <script> $(function () { $('#fileupload').fileupload({ dataType: 'json', done: function (e, data) { $.each(data.result.files, function (index, file) { $('<p/>').text(file.name).appendTo(document.body); }); } }); }); </script> </body> </html>
python使用pillow模块生成缩略图
pip install Pillow
from PIL import Image im = Image.open("logo.png") im.thumbnail((32, 32)) im.save("thumbnail.png", "png")