摘要: 假如生活欺骗了你不要悲伤 不要心急忧郁的日子里须要镇静相信吧 快乐的日子将会来临心儿永远向往着未来现在却常是忧郁一切都是瞬息一切都将会过去而那过去了的就会成为亲切的回忆 阅读全文
posted @ 2019-04-13 18:32 琵琶真的行 阅读(162) 评论(0) 推荐(0)
摘要: #views.py from django.shortcuts import render_to_response, RequestContext from django.views.decorators.csrf import csrf_protect @csrf_protect def index(request): if request.method == "GET... 阅读全文
posted @ 2019-04-13 18:30 琵琶真的行 阅读(660) 评论(0) 推荐(0)
摘要: #settings.py import os from mongoengine import * BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) DEBUG = False ALLOWED_HOSTS = ['*'] # Database # https://docs.djangoproject... 阅读全文
posted @ 2019-04-13 18:21 琵琶真的行 阅读(1880) 评论(0) 推荐(0)
摘要: LOG_LEVEL = 'DEBUG' LOGGING = { 'version' : 1, 'disable_existing_loggers' : True, 'formatters' : { 'standard' : { 'format' : '%(asctime)s [%(threadNam 阅读全文
posted @ 2019-04-13 18:20 琵琶真的行 阅读(223) 评论(0) 推荐(0)
摘要: sed -i 's/\(^.*\)/http:\/\/www.blutmagie.de\/img\/flags\//g' cc.txt sed -i 's/\($\)/.gif/g' cc.txt 阅读全文
posted @ 2019-04-13 18:19 琵琶真的行 阅读(1249) 评论(0) 推荐(0)
摘要: (1)sed: cat file | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' (2)tr: cat file | tr a-z A-Z cat file | tr "[:lower:]" "[:upper:]" ( 阅读全文
posted @ 2019-04-13 18:18 琵琶真的行 阅读(3055) 评论(0) 推荐(1)
摘要: $# 是传给脚本的参数个数 $0 是脚本本身的名字 $1 是传递给该shell脚本的第一个参数 $2 是传递给该shell脚本的第二个参数 $@ 是传给脚本的所有参数的列表 $* 是以一个单字符串显示所有向脚本传递的参数,与位置变量不同,参数可超过9个 $$ 是脚本运行的当前进程ID号 $? 是显示 阅读全文
posted @ 2019-04-13 18:15 琵琶真的行 阅读(1245) 评论(0) 推荐(0)
摘要: create database zblog default character set utf8; alter database da_name default character set 'charset' ’or’=’or’这是一个可以连接SQL的语名句.可以直接进入后台。我收集了一下。类似的还 阅读全文
posted @ 2019-04-13 18:08 琵琶真的行 阅读(380) 评论(0) 推荐(0)
摘要: #coding=utf-8 import time import sys # 生产者 def produce(l): i=0 while 1: if i < 5: l.append(i) yield i i=i+1 time.sleep(1) else: return # 消费者 def consu 阅读全文
posted @ 2019-04-13 18:03 琵琶真的行 阅读(233) 评论(0) 推荐(0)
摘要: #!/usr/bin/env python #coding: utf-8 import smtplib from email.mime.text import MIMEText from email.header import Header sender = 'tom' receiver = ['john@sina.com', 'lili@163.co... 阅读全文
posted @ 2019-04-13 18:01 琵琶真的行 阅读(447) 评论(0) 推荐(0)
摘要: 使用索引的注意事项 使用索引时,有以下一些技巧和注意事项: 1.索引不会包含有NULL值的列 只要列中包含有NULL值都将不会被包含在索引中,复合索引中只要有一列含有NULL值,那么这一列对于此复合索引就是无效的。所以我们在数据库设计时不要让字段的默认值为NULL。 2.使用短索引 对串列进行索引, 阅读全文
posted @ 2019-04-13 17:57 琵琶真的行 阅读(1493) 评论(0) 推荐(0)
摘要: 需要先删除PIL再进行安装 sudo pip uninstall -y PIL 删除PIL相关文件夹:/usr/local/bin/pil , usr/lib/python2.7/dist-packages/PIL , /usr/share/pyshared/PIL apt-get install 阅读全文
posted @ 2019-04-13 17:55 琵琶真的行 阅读(239) 评论(0) 推荐(0)
摘要: # apt-get update # apt-get install -y python-software-properties software-properties-common # add-apt-repository ppa:chris-lea/node.js # apt-get updat 阅读全文
posted @ 2019-04-13 17:52 琵琶真的行 阅读(974) 评论(0) 推荐(0)
摘要: 查询用户:db.system.users.find() 添加用户:db.addUser('admin', '1234') mongodb导入csv数据 mongoimport -h localhost --port 27017 -u tor_tester -p 123456 -d torstatus 阅读全文
posted @ 2019-04-13 17:48 琵琶真的行 阅读(371) 评论(0) 推荐(0)
摘要: geth --rpc --unlock "3ae88fe370c39384fc16da2c9e768cf5d2495b48,81063419f13cab5ac090cd8329d8fff9feead4a0" --rpcport "8546" --datadir data --keystore "/m 阅读全文
posted @ 2019-04-13 17:46 琵琶真的行 阅读(352) 评论(0) 推荐(0)
摘要: mysql忘记密码 解决: 1)sudo service mysql stop 2)sudo mysqld_safe --skip-grant-tables & 3)mysql -u root 4)修改root用户口令。 mysql> use mysql; Reading table informa 阅读全文
posted @ 2019-04-13 17:42 琵琶真的行 阅读(258) 评论(0) 推荐(0)
摘要: (function ($) { $.getUrlParam = function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).mat 阅读全文
posted @ 2019-04-13 17:40 琵琶真的行 阅读(491) 评论(0) 推荐(0)
摘要: $ sudo awk 'NR%2==1{close(p".txt");++p}{print > p".txt"}' test.txt $ sudo split -d -l 2 test.txt new 阅读全文
posted @ 2019-04-13 17:38 琵琶真的行 阅读(1187) 评论(0) 推荐(0)
摘要: 1、查看sql_mode 查询出来的值为: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUB 阅读全文
posted @ 2019-04-13 17:34 琵琶真的行 阅读(5070) 评论(2) 推荐(0)
摘要: 方法1: 用SET PASSWORD命令 首先登录MySQL。 格式:mysql> set password for 用户名@localhost = password('新密码'); 例子:mysql> set password for root@localhost = password('123' 阅读全文
posted @ 2019-04-13 17:32 琵琶真的行 阅读(27290) 评论(3) 推荐(0)
摘要: 工作流程请求:nova boot --image ttylinux --flavor 1 i-01nova-api 接受请求,一个tcp REST请求.nova-api 发送一个创建虚拟机的请求到消息队列,并会存数据库,带uuid.nova-scheduler 接受这个消息,并进行过滤,根据请求的虚 阅读全文
posted @ 2019-04-13 17:19 琵琶真的行 阅读(1314) 评论(0) 推荐(0)
摘要: https://blog.lab99.org/post/docker-2016-07-14-faq.html 阅读全文
posted @ 2019-04-13 17:18 琵琶真的行 阅读(139) 评论(0) 推荐(0)
摘要: bash和zsh两种shell功能非常相似,只不过zsh的功能比bash更强大一些。这两种shell的快捷键命令也非常相似,对于常用shell的人来说,了解一些快捷键操作将会十分有益,因为使用快捷键将能大大节约操作时间。大部分快捷键是用来快速导航或编辑当前命令行。 移动到当前命令行的行首,使用快捷键 阅读全文
posted @ 2019-04-13 17:08 琵琶真的行 阅读(2373) 评论(0) 推荐(0)
摘要: 1.新建目录,clone源码 2.添加配置,vim /etc/vim/vimrc 阅读全文
posted @ 2019-04-13 17:05 琵琶真的行 阅读(672) 评论(0) 推荐(0)
摘要: from keystoneauth1.identity import v3 from keystoneauth1 import session from nova... 阅读全文
posted @ 2019-04-13 16:57 琵琶真的行 阅读(582) 评论(0) 推荐(0)
摘要: from flask import Flask from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop app = Flask 阅读全文
posted @ 2019-04-13 15:15 琵琶真的行 阅读(183) 评论(0) 推荐(0)
摘要: 方法一、 方法二、 csv格式 方法三、 阅读全文
posted @ 2019-04-13 15:08 琵琶真的行 阅读(570) 评论(0) 推荐(0)
摘要: 1.统计本目录下除`./apps/myapp/migrations`的所有py文件 2.单个文件行数 阅读全文
posted @ 2019-04-13 15:05 琵琶真的行 阅读(416) 评论(0) 推荐(0)