python判断身份证的合法性

python李魔佛 发表了文章 • 0 个评论 • 6082 次浏览 • 2018-08-10 13:56 • 来自相关话题

输入身份证号码, 判断18位身份证号码是否合法, 并查询信息(性别, 年龄, 所在地)

验证原理

将前面的身份证号码17位数分别乘以不同的系数, 从第一位到第十七位的系数分别为: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
将这17位数字和系数相乘的结果相加.
用加出来和除以11, 看余数是多少?
余数只可能有<0 1 2 3 4 5 6 7 8 9 10>这11个数字, 其分别对应的最后一位身份证的号码为<1 0 X 9 8 7 6 5 4 3 2>.
通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2.

例如: 某男性的身份证号码是34052419800101001X, 我们要看看这个身份证是不是合法的身份证.

首先: 我们得出, 前17位的乘积和是189.

然后: 用189除以11得出的余数是2.

最后: 通过对应规则就可以知道余数2对应的数字是x. 所以, 这是一个合格的身份证号码.
 
代码如下:#!/bin/env python
# -*- coding: utf-8 -*-

from sys import platform
import json
import codecs

with codecs.open('data.json', 'r', encoding='utf8') as json_data:
city = json.load(json_data)

def check_valid(idcard):
# 城市编码, 出生日期, 归属地
city_id = idcard[:6]
print(city_id)
birth = idcard[6:14]

city_name = city.get(city_id,'Not found')

# 根据规则校验身份证是否符合规则
idcard_tuple = [int(num) for num in list(idcard[:-1])]
coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
sum_value = sum([idcard_tuple[i] * coefficient[i] for i in range(17)])

remainder = sum_value % 11

maptable = {0: '1', 1: '0', 2: 'x', 3: '9', 4: '8', 5: '7', 6: '6', 7: '5', 8: '4', 9: '3', 10: '2'}

if maptable[remainder] == idcard[17]:
print('<身份证合法>')
sex = int(idcard[16]) % 2
sex = '男' if sex == 1 else '女'
print('性别:' + sex)
birth_format="{}年{}月{}日".format(birth[:4],birth[4:6],birth[6:8])
print('出生日期:' + birth_format)
print('归属地:' + city_name)
return True
else:
print('<身份证不合法>')
return False


if __name__=='__main__':
idcard = str(input('请输入身份证号码:'))
check_valid(idcard)[/i]

github源码:https://github.com/Rockyzsu/IdentityCheck
原创文章,转载请注明 
http://30daydo.com/article/340
  查看全部
输入身份证号码, 判断18位身份证号码是否合法, 并查询信息(性别, 年龄, 所在地)

验证原理

将前面的身份证号码17位数分别乘以不同的系数, 从第一位到第十七位的系数分别为: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
将这17位数字和系数相乘的结果相加.
用加出来和除以11, 看余数是多少?
余数只可能有<0 1 2 3 4 5 6 7 8 9 10>这11个数字, 其分别对应的最后一位身份证的号码为<1 0 X 9 8 7 6 5 4 3 2>.
通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数是10,身份证的最后一位号码就是2.

例如: 某男性的身份证号码是34052419800101001X, 我们要看看这个身份证是不是合法的身份证.

首先: 我们得出, 前17位的乘积和是189.

然后: 用189除以11得出的余数是2.

最后: 通过对应规则就可以知道余数2对应的数字是x. 所以, 这是一个合格的身份证号码.
 
代码如下:
#!/bin/env python
# -*- coding: utf-8 -*-

from sys import platform
import json
import codecs

with codecs.open('data.json', 'r', encoding='utf8') as json_data:
city = json.load(json_data)

def check_valid(idcard):
# 城市编码, 出生日期, 归属地
city_id = idcard[:6]
print(city_id)
birth = idcard[6:14]

city_name = city.get(city_id,'Not found')

# 根据规则校验身份证是否符合规则
idcard_tuple = [int(num) for num in list(idcard[:-1])]
coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
sum_value = sum([idcard_tuple[i] * coefficient[i] for i in range(17)])

remainder = sum_value % 11

maptable = {0: '1', 1: '0', 2: 'x', 3: '9', 4: '8', 5: '7', 6: '6', 7: '5', 8: '4', 9: '3', 10: '2'}

if maptable[remainder] == idcard[17]:
print('<身份证合法>')
sex = int(idcard[16]) % 2
sex = '男' if sex == 1 else '女'
print('性别:' + sex)
birth_format="{}年{}月{}日".format(birth[:4],birth[4:6],birth[6:8])
print('出生日期:' + birth_format)
print('归属地:' + city_name)
return True
else:
print('<身份证不合法>')
return False


if __name__=='__main__':
idcard = str(input('请输入身份证号码:'))
check_valid(idcard)[/i]


github源码:https://github.com/Rockyzsu/IdentityCheck
原创文章,转载请注明 
http://30daydo.com/article/340
 

pymysql.err.InternalError: Packet sequence number wrong - got 4 expected 1

网络安全李魔佛 发表了文章 • 0 个评论 • 13561 次浏览 • 2018-07-19 13:59 • 来自相关话题

在django里面使用pymysql的方式进行链接, 结果就悲剧了.
 
PyMySQL is not thread safty to share connections as we did (we shared the class instance between multiple files as a global instance - in the class there is only one connection), it is labled as 1:

threadsafety = 1

According to PEP 249:

1 - Threads may share the module, but not connections.

One of the comments in PyMySQL github issue:

you need one pysql.connect() for each process/thread. As far as I know that's the only way to fix it. PyMySQL is not thread safe, so the same connection can't be used across multiple threads.

Any way if you were thinking of using other python package called MySQLdb for your threading application, notice to MySQLdb message:

Don't share connections between threads. It's really not worth your effort or mine, and in the end, will probably hurt performance, since the MySQL server runs a separate thread for each connection. You can certainly do things like cache connections in a pool, and give those connections to one thread at a time. If you let two threads use a connection simultaneously, the MySQL client library will probably upchuck and die. You have been warned. For threaded applications, try using a connection pool. This can be done using the Pool module.

Eventually we managed to use Django ORM and we are writing only for our specific table, managed by using inspectdb. 查看全部
在django里面使用pymysql的方式进行链接, 结果就悲剧了.
 
PyMySQL is not thread safty to share connections as we did (we shared the class instance between multiple files as a global instance - in the class there is only one connection), it is labled as 1:

threadsafety = 1

According to PEP 249:

1 - Threads may share the module, but not connections.

One of the comments in PyMySQL github issue:

you need one pysql.connect() for each process/thread. As far as I know that's the only way to fix it. PyMySQL is not thread safe, so the same connection can't be used across multiple threads.

Any way if you were thinking of using other python package called MySQLdb for your threading application, notice to MySQLdb message:

Don't share connections between threads. It's really not worth your effort or mine, and in the end, will probably hurt performance, since the MySQL server runs a separate thread for each connection. You can certainly do things like cache connections in a pool, and give those connections to one thread at a time. If you let two threads use a connection simultaneously, the MySQL client library will probably upchuck and die. You have been warned. For threaded applications, try using a connection pool. This can be done using the Pool module.

Eventually we managed to use Django ORM and we are writing only for our specific table, managed by using inspectdb.

mongodb sort: Executor error during find command: OperationFailed: Sort operation used more than

网络李魔佛 发表了文章 • 0 个评论 • 7594 次浏览 • 2018-07-09 10:31 • 来自相关话题

mongodb 排序出现内存溢出:
 Error: error: {
"ok" : 0,
"errmsg" : "Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.",
"code" : 96,
"codeName" : "OperationFailed"
}
使用limit函数限制其输出就可以了:
 
db.getCollection('老布').find({}).sort({'created_at':-1}).limit(1000) 查看全部
mongodb 排序出现内存溢出:
 
Error: error: {
"ok" : 0,
"errmsg" : "Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.",
"code" : 96,
"codeName" : "OperationFailed"
}

使用limit函数限制其输出就可以了:
 
db.getCollection('老布').find({}).sort({'created_at':-1}).limit(1000)

每天给小孩子看英语视频可以让小孩学到什么?

闲聊绫波丽 发表了文章 • 0 个评论 • 3268 次浏览 • 2018-07-07 11:10 • 来自相关话题

结论是Nothing。
 
没有互动,没有实际使用,语言没有用武之地,最终只是当做一种娱乐消遣。
那么多看美剧的,问问他们的英语水平,会不会比7岁的在国外长大的小孩的英语水平高? 不会,至少他们连流畅沟通都做不到。
 
结论是Nothing。
 
没有互动,没有实际使用,语言没有用武之地,最终只是当做一种娱乐消遣。
那么多看美剧的,问问他们的英语水平,会不会比7岁的在国外长大的小孩的英语水平高? 不会,至少他们连流畅沟通都做不到。
 

最新版的chrome中info lite居然不支持了

python爬虫李魔佛 发表了文章 • 0 个评论 • 3064 次浏览 • 2018-06-25 18:58 • 来自相关话题

更新到了v67版本后,info lite居然不见了. 我晕.
只好降级......
 
版本 65.0.3325.162(正式版本) (64 位)
这个版本最新且支持info lite的。
 
 
更新到了v67版本后,info lite居然不见了. 我晕.
只好降级......
 
版本 65.0.3325.162(正式版本) (64 位)
这个版本最新且支持info lite的。
 
 

python sqlalchemy ORM 添加注释

python李魔佛 发表了文章 • 0 个评论 • 3974 次浏览 • 2018-06-25 16:17 • 来自相关话题

需要更新sqlalchemy到最新版本,旧版本会不支持。
 
在定义ORM对象的时候,
class CreditRecord(Base):
__tablename__ = 'tb_PersonPunishment'

id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(180),comment='名字')
添加一个comment参数即可。
 
  查看全部
需要更新sqlalchemy到最新版本,旧版本会不支持。
 
在定义ORM对象的时候,
class CreditRecord(Base):
__tablename__ = 'tb_PersonPunishment'

id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(180),comment='名字')

添加一个comment参数即可。
 
 

windows 7 python3 安装MySQLdb 库

python李魔佛 发表了文章 • 0 个评论 • 2769 次浏览 • 2018-06-20 18:04 • 来自相关话题

python3下没有MySQLdb的库,可以直接到这里下载mysqlclient库来替代。https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
 
python3下没有MySQLdb的库,可以直接到这里下载mysqlclient库来替代。https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
 

工行的app实在是烂到家了,怎么点击都打不开

闲聊量化大师 发表了文章 • 0 个评论 • 2692 次浏览 • 2018-06-20 00:12 • 来自相关话题

都什么年代了,完全和招行这些app无法比,而且看起来就跟网页的网银时代一模一样的垃圾作风(只兼容IE,页面杂乱),垃圾的研发延续到app端,实在无法忍,十次九次打开失败,有导致整个系统假死的,或者系统突然极其卡顿,或者没有任何反应。
都什么年代了,完全和招行这些app无法比,而且看起来就跟网页的网银时代一模一样的垃圾作风(只兼容IE,页面杂乱),垃圾的研发延续到app端,实在无法忍,十次九次打开失败,有导致整个系统假死的,或者系统突然极其卡顿,或者没有任何反应。

赢呗DDW转账失败,一直显示 0 of 12 确认区块

量化交易量化大师 发表了文章 • 0 个评论 • 4956 次浏览 • 2018-06-17 14:39 • 来自相关话题

斐讯开通了天天牛后,需要用电脑端转账到官方的天天牛账户进行确认,后期也需要充值DDW才能参与世界杯的竞猜活动,购买其他的天天牛。 具体教程【斐讯 天天牛绑定教程】
 
刚开始是可以转账成功的,可是后面最近今天却一直卡在0 of 12 确认区块, 无论你选择了多转账费用还是选择少的转账费用,都无法转账成功。




点击查看大图
 
后来咨询了客户后才知道,原来最近斐讯在打击黄牛(刷天天牛),所以天天链的邀请码系统关闭了,而且转账是因为网络拥堵的原因,导致转账卡住了。 而且客服说了,当前转账失败的金额,等到DDW网络正常后会正常转入到天天牛的账号。所以不用担心金额会消失,只需要耐心等待网络修复。
  查看全部
斐讯开通了天天牛后,需要用电脑端转账到官方的天天牛账户进行确认,后期也需要充值DDW才能参与世界杯的竞猜活动,购买其他的天天牛。 具体教程【斐讯 天天牛绑定教程
 
刚开始是可以转账成功的,可是后面最近今天却一直卡在0 of 12 确认区块, 无论你选择了多转账费用还是选择少的转账费用,都无法转账成功。
send.PNG

点击查看大图
 
后来咨询了客户后才知道,原来最近斐讯在打击黄牛(刷天天牛),所以天天链的邀请码系统关闭了,而且转账是因为网络拥堵的原因,导致转账卡住了。 而且客服说了,当前转账失败的金额,等到DDW网络正常后会正常转入到天天牛的账号。所以不用担心金额会消失,只需要耐心等待网络修复。
 

CDR最近风头火势

股票量化大师 发表了文章 • 0 个评论 • 3053 次浏览 • 2018-06-10 22:48 • 来自相关话题

2007年,时值美股高峰,证监会顺势推出QDII。当时购买也要排队摇号。
 
当年成立的南方全球,到现在,净值都低于1。现在,证监会又推出CDR。
 
银行和券商卖力吆喝,号称1元起售,普惠金融。农民都明白,指导种啥就亏啥。
 
China Southern Fund's QDII products still lose money after 11 years.















 
  查看全部
2007年,时值美股高峰,证监会顺势推出QDII。当时购买也要排队摇号。
 
当年成立的南方全球,到现在,净值都低于1。现在,证监会又推出CDR。
 
银行和券商卖力吆喝,号称1元起售,普惠金融。农民都明白,指导种啥就亏啥。
 
China Southern Fund's QDII products still lose money after 11 years.

DfJNO1XUYAIXEZG.jpeg


DfJNb7DU8AAPzHQ.jpeg


DfJNdw6UYAEWLnd.jpeg

 
 

python3中定义抽象类的方法在python2中不兼容

python李魔佛 发表了文章 • 0 个评论 • 4531 次浏览 • 2018-06-10 20:54 • 来自相关话题

在python3中新式的定义抽象类的方法如下:from abc import ABCMeta,abstractmethod

class Server(metaclass=ABCMeta):

@abstractmethod
def __init__(self):
pass

def __str__(self):
return self.name

@abstractmethod
def boot(self):
pass

@abstractmethod
def kill(self):
pass
 
但是这个方法在python2中会提示语法错误。
 
在python2中只能像下面这种方式定义抽象类:
 from abc import ABCMeta,abstractmethod

class Server(object):
__metaclass__=ABCMeta
@abstractmethod
def __init__(self):
pass

def __str__(self):
return self.name

@abstractmethod
def boot(self):
pass

@abstractmethod
def kill(self):
pass
这种方式不仅在python2中可以正常运行,在python3中也可以。但是python3的方法只能兼容python3,无法在python2中运行。
 
原创地址:
http://30daydo.com/article/326
欢迎转载,请注明出处。 查看全部
在python3中新式的定义抽象类的方法如下:
from abc import ABCMeta,abstractmethod

class Server(metaclass=ABCMeta):

@abstractmethod
def __init__(self):
pass

def __str__(self):
return self.name

@abstractmethod
def boot(self):
pass

@abstractmethod
def kill(self):
pass

 
但是这个方法在python2中会提示语法错误。
 
在python2中只能像下面这种方式定义抽象类:
 
from abc import ABCMeta,abstractmethod

class Server(object):
__metaclass__=ABCMeta
@abstractmethod
def __init__(self):
pass

def __str__(self):
return self.name

@abstractmethod
def boot(self):
pass

@abstractmethod
def kill(self):
pass

这种方式不仅在python2中可以正常运行,在python3中也可以。但是python3的方法只能兼容python3,无法在python2中运行。
 
原创地址:
http://30daydo.com/article/326
欢迎转载,请注明出处。

sklearn中的Bunch数据类型

深度学习李魔佛 发表了文章 • 0 个评论 • 15731 次浏览 • 2018-06-07 19:10 • 来自相关话题

在sklearn中自带部分数据 如 datasets 包中




 
那么这个
<class 'sklearn.utils.Bunch'>
是什么数据格式 ?
 
打印一下:




好吧,原来就是一个字典结构。可以像调用字典一样使用Bunch。
比如 data['image'] 就获取 key为image的内容。
 

原创地址:http://30daydo.com/article/325 
欢迎转载,请注明出处。 查看全部
在sklearn中自带部分数据 如 datasets 包中
k1.PNG

 
那么这个
<class 'sklearn.utils.Bunch'>
是什么数据格式 ?
 
打印一下:
k3.PNG

好吧,原来就是一个字典结构。可以像调用字典一样使用Bunch。
比如 data['image'] 就获取 key为image的内容。
 

原创地址:http://30daydo.com/article/325 
欢迎转载,请注明出处。

招行信用卡的账单日当天消费算下一个月还吗?

闲聊量化大师 发表了文章 • 0 个评论 • 5990 次浏览 • 2018-06-07 17:50 • 来自相关话题

比如某人的招行信用卡的账单日是20号,那么在20号当天消费,是算入下一个的还款周期里面的。
举个例子:
5月20日是账单日,那么根据招行的规定,那么在6月9就是还款日。 
如果在5月20日当天用信用卡消费了,那么这一笔是算入到下个月的还款周期,也就是到7月9日还款。
因为这一笔会记到6月20的月账单里面。而6月20的账单是到7月9日才还款的。 查看全部
比如某人的招行信用卡的账单日是20号,那么在20号当天消费,是算入下一个的还款周期里面的。
举个例子:
5月20日是账单日,那么根据招行的规定,那么在6月9就是还款日。 
如果在5月20日当天用信用卡消费了,那么这一笔是算入到下个月的还款周期,也就是到7月9日还款。
因为这一笔会记到6月20的月账单里面。而6月20的账单是到7月9日才还款的。

sklearn中SGDClassifier分类器每次得到的结果都不一样?

深度学习李魔佛 发表了文章 • 0 个评论 • 7400 次浏览 • 2018-06-07 17:14 • 来自相关话题

如下代码:sgdc = SGDClassifier()
sgdc.fit(X_train,y_train)
sgdc_predict_y = sgdc.predict(X_test)
print 'Accuary of SGD classifier ', sgdc.score(X_test,y_test)
print classification_report(y_test,sgdc_predict_y,target_names=['Benign','Malignant'])
每次输出的结果都不一样? WHY
 
 
因为你使用了一个默认参数:
SGDClassifier(random_state = None)
 
所以这个随机种子每次不一样,所以得到的结果就可能不一样,如果你指定随机种子值,那么每次得到的结果都是一样的了。
 

原创地址:http://30daydo.com/article/323 
欢迎转载,请注明出处。 查看全部
如下代码:
sgdc = SGDClassifier()
sgdc.fit(X_train,y_train)
sgdc_predict_y = sgdc.predict(X_test)
print 'Accuary of SGD classifier ', sgdc.score(X_test,y_test)
print classification_report(y_test,sgdc_predict_y,target_names=['Benign','Malignant'])

每次输出的结果都不一样? WHY
 
 
因为你使用了一个默认参数:
SGDClassifier(random_state = None)
 
所以这个随机种子每次不一样,所以得到的结果就可能不一样,如果你指定随机种子值,那么每次得到的结果都是一样的了。
 

原创地址:http://30daydo.com/article/323 
欢迎转载,请注明出处。

可转债2018 下半年策略

股票李魔佛 发表了文章 • 0 个评论 • 2618 次浏览 • 2018-06-05 01:28 • 来自相关话题

平摊10至20个转债,一个转债解决至少130,在90以下的转债到成功赎回收益率在50%以上,就是10个转债不幸有一个违约,那你还是赚的,转债的最终目的还是促成转股,下有保底债券收益!
我现在只建了一成仓,跌到88以下开始慢慢摊,不急!!
不要被表象所迷,转债毕竟是债,是有底的东西 跟那时的A类也一样,吐弃不等于烂!
慢慢吃!! 查看全部
平摊10至20个转债,一个转债解决至少130,在90以下的转债到成功赎回收益率在50%以上,就是10个转债不幸有一个违约,那你还是赚的,转债的最终目的还是促成转股,下有保底债券收益!
我现在只建了一成仓,跌到88以下开始慢慢摊,不急!!
不要被表象所迷,转债毕竟是债,是有底的东西 跟那时的A类也一样,吐弃不等于烂!
慢慢吃!!

斐讯天天链挖矿每天有多少个? 用的联通网络

量化交易量化大师 发表了文章 • 0 个评论 • 7726 次浏览 • 2018-06-05 00:56 • 来自相关话题

上个月撸了个斐讯天天链N1和一个移动硬盘H1,然后激活了白金会员。 准备挖矿之旅。
 
家里接的是小区垄断的宽带,上网检测了下IP,是联通的网络,正常速度8M左右。 






按照教程,注册激活,把硬盘格式化,然后开着天天链。每天都开着,一直在线,指示灯保持常亮。
然后每天打开日日盈app查看收益,少的可怜,平均一天0.8个,1个都不到。 目前木鸡上天天链的虚拟币DDW价格才0.4元一个,也就是4毛钱一个币,然后每天只能赚3毛钱,我去,电费都亏了。





挖了29天,才25个币。 而且现在是每天越挖越少。 币价越来越低。搞得家里的wifi网络和有线网络也变得卡了。
 
所以果断关掉天天链,真是费电不讨好。
 
附一张4月的币价:






 
原创文章,转载请注明
http://www.30daydo.com/article/262 查看全部
上个月撸了个斐讯天天链N1和一个移动硬盘H1,然后激活了白金会员。 准备挖矿之旅。
 
家里接的是小区垄断的宽带,上网检测了下IP,是联通的网络,正常速度8M左右。 

联通.PNG


按照教程,注册激活,把硬盘格式化,然后开着天天链。每天都开着,一直在线,指示灯保持常亮。
然后每天打开日日盈app查看收益,少的可怜,平均一天0.8个,1个都不到。 目前木鸡上天天链的虚拟币DDW价格才0.4元一个,也就是4毛钱一个币,然后每天只能赚3毛钱,我去,电费都亏了。

1Screenshot_2018-06-05-00-47-41-376_日日赢.png

挖了29天,才25个币。 而且现在是每天越挖越少。 币价越来越低。搞得家里的wifi网络和有线网络也变得卡了。
 
所以果断关掉天天链,真是费电不讨好。
 
附一张4月的币价:

code11.PNG


 
原创文章,转载请注明
http://www.30daydo.com/article/262

51jb 脚本之家真逆天

每日总结李魔佛 发表了文章 • 0 个评论 • 6176 次浏览 • 2018-06-04 17:51 • 来自相关话题

几乎所有IT类的pdf电子书都可以在这个脚本之家获取的到,比很多专业的电子书网站都要强!
前列推荐!!!
几乎所有IT类的pdf电子书都可以在这个脚本之家获取的到,比很多专业的电子书网站都要强!
前列推荐!!!

ubuntu samba连接斐讯天天链N1 提示 Host is down.

Linux李魔佛 发表了文章 • 0 个评论 • 5846 次浏览 • 2018-06-02 16:48 • 来自相关话题

配置:
斐讯天天链N1 + 斐讯硬盘H1
ubuntu 和天天链在同一个内网中。
 平时个人在ubuntu下使用的mount命令不管用。 提示 Host is down
如果直接用gui连接,是没问题的(打开文件夹,选择连接服务器,然后服务器地址填 smb://192.168.1.1 ) 然后就可以访问天天链的硬盘。 
但是为什么使用mount命令就不行了呢 ?
 
通过不断更改参数,发现问题出在斐讯samba的版本用的是老旧的vers 1.0. 这时需要你在mount命令中制定版本。
 sudo mount -t cifs -o username=root,password=xxxxx,uid=1000,gid=1000,vers=1.0,_netdev //192.168.1.88/HDisk /home/use/net
通过上述的命令, 就可以把斐讯的硬盘mount到本地,并且有权限可以读写。
记得加上
uid=1000,gid=1000, 不然会没有权限读写,只能一直使用sudo 才能读写哦。
 
 
原创文章
转载请注明出处:http://30daydo.com/article/317
  查看全部
配置:
斐讯天天链N1 + 斐讯硬盘H1
ubuntu 和天天链在同一个内网中。
 平时个人在ubuntu下使用的mount命令不管用。 提示 Host is down
如果直接用gui连接,是没问题的(打开文件夹,选择连接服务器,然后服务器地址填 smb://192.168.1.1 ) 然后就可以访问天天链的硬盘。 
但是为什么使用mount命令就不行了呢 ?
 
通过不断更改参数,发现问题出在斐讯samba的版本用的是老旧的vers 1.0. 这时需要你在mount命令中制定版本。
 
sudo mount -t cifs -o username=root,password=xxxxx,uid=1000,gid=1000,vers=1.0,_netdev //192.168.1.88/HDisk /home/use/net

通过上述的命令, 就可以把斐讯的硬盘mount到本地,并且有权限可以读写。
记得加上
uid=1000,gid=1000, 不然会没有权限读写,只能一直使用sudo 才能读写哦。
 
 
原创文章
转载请注明出处:http://30daydo.com/article/317
 

股票涨停数量求助~~

回复

股票老叔叔 发起了问题 • 1 人关注 • 0 个回复 • 3973 次浏览 • 2018-06-01 17:10 • 来自相关话题

numpy数组四舍五入

python李魔佛 发表了文章 • 0 个评论 • 14007 次浏览 • 2018-05-21 09:17 • 来自相关话题

numpy.around(nlist, number)
传入一个np的数组和需要保留的位数作为参数
 
例子:import numpy as np
x = np.arange(10)
x=x/77.0
print x
输出结果为:[b][0. 0.01298701 0.02597403 0.03896104 0.05194805 0.06493506
0.07792208 0.09090909 0.1038961 0.11688312][/b] [b]np.around(x, 3) #保存为3位小数[/b]
array([0. , 0.013, 0.026, 0.039, 0.052, 0.065, 0.078, 0.091, 0.104, 0.117]) 查看全部
numpy.around(nlist, number)
传入一个np的数组和需要保留的位数作为参数
 
例子:
import numpy as np
x = np.arange(10)
x=x/77.0
print x

输出结果为:
[b][0.         0.01298701 0.02597403 0.03896104 0.05194805 0.06493506
0.07792208 0.09090909 0.1038961 0.11688312][/b]
 
[b]np.around(x, 3)   #保存为3位小数[/b]

array([0. , 0.013, 0.026, 0.039, 0.052, 0.065, 0.078, 0.091, 0.104, 0.117])

mongo服务器因为mongod.lock 被锁定无法正常运行

网络安全李魔佛 发表了文章 • 0 个评论 • 7883 次浏览 • 2018-05-20 18:33 • 来自相关话题

看log文件:
Sun May 20 18:26:04.630 [initandlisten] MongoDB starting : pid=2343 port=27017 dbpath=/home/pi/mongo/db/ 32-bit host=raspberrypi
Sun May 20 18:26:04.631 [initandlisten]
Sun May 20 18:26:04.631 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sun May 20 18:26:04.631 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Sun May 20 18:26:04.631 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Sun May 20 18:26:04.631 [initandlisten]
Sun May 20 18:26:04.631 [initandlisten] db version v2.4.10
Sun May 20 18:26:04.632 [initandlisten] git version: nogitversion
Sun May 20 18:26:04.632 [initandlisten] build info: Linux bm-wb-04 3.19.0-trunk-armmp #1 SMP Debian 3.19.1-1~exp1+plugwash1 (2015-03-28) armv7l BOOST_LIB_VERSION=1_55
Sun May 20 18:26:04.632 [initandlisten] allocator: system
Sun May 20 18:26:04.632 [initandlisten] options: { dbpath: "/home/pi/mongo/db/", journal: true, logpath: "/home/pi/mongo/mongod.log" }
Sun May 20 18:26:05.956 [initandlisten] journal dir=/home/pi/mongo/db/journal
Sun May 20 18:26:05.957 [initandlisten] recover : no journal files present, no recovery needed
Sun May 20 18:26:06.023 [initandlisten] ERROR: mmap private failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64
Sun May 20 18:26:06.023 [initandlisten] Assertion: 13636:file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
0x662fa8 0x63527c 0x6196c0 0x6197bc 0x409d5c 0x4414fc 0x2ea634 0x2eaa3c 0x2eb55c 0x2ebd98 0x26f998 0x26fb94 0x175a20 0x177bf4 0x152bf0 0x7660e294
mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x662fa8]
mongod(_ZN5mongo10logContextEPKc+0x110) [0x63527c]
mongod(_ZN5mongo11msgassertedEiPKc+0xc0) [0x6196c0]
mongod(_ZN5mongo18msgassertedNoTraceEiPKc+0) [0x6197bc]
mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x308) [0x409d5c]
mongod(_ZN5mongo13MongoDataFile12openExistingEPKc+0x9c) [0x4414fc]
mongod(_ZN5mongo8Database16openExistingFileEi+0x23c) [0x2ea634]
mongod(_ZN5mongo8Database12openAllFilesEv+0x24) [0x2eaa3c]
mongod(_ZN5mongo8DatabaseC2EPKcRbRKSs+0x158) [0x2eb55c]
mongod(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x500) [0x2ebd98]
mongod(_ZN5mongo6Client7Context11_finishInitEv+0x34) [0x26f998]
mongod(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x78) [0x26fb94]
mongod(_ZN5mongo14_initAndListenEi+0xb00) [0x175a20]
mongod(_ZN5mongo13initAndListenEi+0x14) [0x177bf4]
mongod(main+0x2b8) [0x152bf0]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0x7660e294]
Sun May 20 18:26:06.035 [initandlisten] warning database /home/pi/mongo/db/ xueqiu could not be opened
Sun May 20 18:26:06.035 [initandlisten] DBException 13636: file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
Sun May 20 18:26:06.036 [initandlisten] exception in initAndListen: 13636 file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information), terminating
Sun May 20 18:26:06.036 dbexit:
Sun May 20 18:26:06.036 [initandlisten] shutdown: going to close listening sockets...
Sun May 20 18:26:06.036 [initandlisten] shutdown: going to flush diaglog...
Sun May 20 18:26:06.036 [initandlisten] shutdown: going to close sockets...
Sun May 20 18:26:06.036 [initandlisten] shutdown: waiting for fs preallocator...
Sun May 20 18:26:06.036 [initandlisten] shutdown: lock for final commit...
Sun May 20 18:26:06.036 [initandlisten] shutdown: final commit...
Sun May 20 18:26:06.036 [initandlisten] shutdown: closing all files...
Sun May 20 18:26:06.037 [initandlisten] closeAllFiles() finished
Sun May 20 18:26:06.037 [initandlisten] journalCleanup...
Sun May 20 18:26:06.037 [initandlisten] removeJournalFiles
Sun May 20 18:26:06.050 [initandlisten] shutdown: removing fs lock...
Sun May 20 18:26:06.050 dbexit: really exiting now

应该是之前没有正常被关闭,导致文件本锁住了。
 
解决办法:
 
1. 先把数据文件备份, --dbpath 的路径整个备份一下, 不然接下来的操作误操作了数据就丢失了
 
2. 运行修复命令:

mongod --dbpath /data/db --repair
 
替换上面的db为您自己的本地路径 查看全部
看log文件:
Sun May 20 18:26:04.630 [initandlisten] MongoDB starting : pid=2343 port=27017 dbpath=/home/pi/mongo/db/ 32-bit host=raspberrypi
Sun May 20 18:26:04.631 [initandlisten]
Sun May 20 18:26:04.631 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sun May 20 18:26:04.631 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Sun May 20 18:26:04.631 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Sun May 20 18:26:04.631 [initandlisten]
Sun May 20 18:26:04.631 [initandlisten] db version v2.4.10
Sun May 20 18:26:04.632 [initandlisten] git version: nogitversion
Sun May 20 18:26:04.632 [initandlisten] build info: Linux bm-wb-04 3.19.0-trunk-armmp #1 SMP Debian 3.19.1-1~exp1+plugwash1 (2015-03-28) armv7l BOOST_LIB_VERSION=1_55
Sun May 20 18:26:04.632 [initandlisten] allocator: system
Sun May 20 18:26:04.632 [initandlisten] options: { dbpath: "/home/pi/mongo/db/", journal: true, logpath: "/home/pi/mongo/mongod.log" }
Sun May 20 18:26:05.956 [initandlisten] journal dir=/home/pi/mongo/db/journal
Sun May 20 18:26:05.957 [initandlisten] recover : no journal files present, no recovery needed
Sun May 20 18:26:06.023 [initandlisten] ERROR: mmap private failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64
Sun May 20 18:26:06.023 [initandlisten] Assertion: 13636:file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
0x662fa8 0x63527c 0x6196c0 0x6197bc 0x409d5c 0x4414fc 0x2ea634 0x2eaa3c 0x2eb55c 0x2ebd98 0x26f998 0x26fb94 0x175a20 0x177bf4 0x152bf0 0x7660e294
mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x662fa8]
mongod(_ZN5mongo10logContextEPKc+0x110) [0x63527c]
mongod(_ZN5mongo11msgassertedEiPKc+0xc0) [0x6196c0]
mongod(_ZN5mongo18msgassertedNoTraceEiPKc+0) [0x6197bc]
mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x308) [0x409d5c]
mongod(_ZN5mongo13MongoDataFile12openExistingEPKc+0x9c) [0x4414fc]
mongod(_ZN5mongo8Database16openExistingFileEi+0x23c) [0x2ea634]
mongod(_ZN5mongo8Database12openAllFilesEv+0x24) [0x2eaa3c]
mongod(_ZN5mongo8DatabaseC2EPKcRbRKSs+0x158) [0x2eb55c]
mongod(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x500) [0x2ebd98]
mongod(_ZN5mongo6Client7Context11_finishInitEv+0x34) [0x26f998]
mongod(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x78) [0x26fb94]
mongod(_ZN5mongo14_initAndListenEi+0xb00) [0x175a20]
mongod(_ZN5mongo13initAndListenEi+0x14) [0x177bf4]
mongod(main+0x2b8) [0x152bf0]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0x7660e294]
Sun May 20 18:26:06.035 [initandlisten] warning database /home/pi/mongo/db/ xueqiu could not be opened
Sun May 20 18:26:06.035 [initandlisten] DBException 13636: file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
Sun May 20 18:26:06.036 [initandlisten] exception in initAndListen: 13636 file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information), terminating
Sun May 20 18:26:06.036 dbexit:
Sun May 20 18:26:06.036 [initandlisten] shutdown: going to close listening sockets...
Sun May 20 18:26:06.036 [initandlisten] shutdown: going to flush diaglog...
Sun May 20 18:26:06.036 [initandlisten] shutdown: going to close sockets...
Sun May 20 18:26:06.036 [initandlisten] shutdown: waiting for fs preallocator...
Sun May 20 18:26:06.036 [initandlisten] shutdown: lock for final commit...
Sun May 20 18:26:06.036 [initandlisten] shutdown: final commit...
Sun May 20 18:26:06.036 [initandlisten] shutdown: closing all files...
Sun May 20 18:26:06.037 [initandlisten] closeAllFiles() finished
Sun May 20 18:26:06.037 [initandlisten] journalCleanup...
Sun May 20 18:26:06.037 [initandlisten] removeJournalFiles
Sun May 20 18:26:06.050 [initandlisten] shutdown: removing fs lock...
Sun May 20 18:26:06.050 dbexit: really exiting now

应该是之前没有正常被关闭,导致文件本锁住了。
 
解决办法:
 
1. 先把数据文件备份, --dbpath 的路径整个备份一下, 不然接下来的操作误操作了数据就丢失了
 
2. 运行修复命令:

mongod --dbpath /data/db --repair
 
替换上面的db为您自己的本地路径

斐讯商城积分兑换的鼠标

每日总结李魔佛 发表了文章 • 0 个评论 • 3425 次浏览 • 2018-05-19 18:41 • 来自相关话题

虽然不用钱,用积分兑换的(1万多的积分)。 
实在是被惊艳了。





 
渣渣的手感,地摊货色。 轻飘飘的鼠标,表面的漆面也不均匀。滚轮像挪动在有沙子的路面的轮子一样,及其不流畅。
 
通电后,几乎无法再书桌上操作,需要贴上一块平滑的鼠标垫才行,不然简直就是无法操作, 鼠标根本无法定位。
请原谅我这么直接吧。  查看全部
虽然不用钱,用积分兑换的(1万多的积分)。 
实在是被惊艳了。

IMG_20180519_183123R_副本.jpg

 
渣渣的手感,地摊货色。 轻飘飘的鼠标,表面的漆面也不均匀。滚轮像挪动在有沙子的路面的轮子一样,及其不流畅。
 
通电后,几乎无法再书桌上操作,需要贴上一块平滑的鼠标垫才行,不然简直就是无法操作, 鼠标根本无法定位。
请原谅我这么直接吧。 

求找网站管理员

回复

默认分类hebi919 发起了问题 • 1 人关注 • 0 个回复 • 3199 次浏览 • 2018-05-16 12:15 • 来自相关话题

mongo服务启动失败: ERROR: mmap private failed with out of memory

树莓派李魔佛 发表了文章 • 0 个评论 • 4067 次浏览 • 2018-05-13 12:23 • 来自相关话题

平时在树莓派上开机自动执行以下命令,启动mongo服务
sudo mongod --fork --dbpath /home/pi/mongo/db/ --smallfiles --journal --logpath /home/pi/mongo/log.txt
突然今天发现mongo的服务连不上,看log发现mongo在启动后马上关闭了,提示的错误是在加载一个大的数据文件的时候提示内存不足(坑爹的,树莓派自身内存才1GB,无法扩容)。 
 
错误日志:
Sun May 13 12:08:11.185 [initandlisten] MongoDB starting : pid=1929 port=27017 dbpath=/home/pi/mongo/db/ 32-bit host=raspberrypi
Sun May 13 12:08:11.186 [initandlisten]
Sun May 13 12:08:11.186 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sun May 13 12:08:11.186 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Sun May 13 12:08:11.186 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Sun May 13 12:08:11.187 [initandlisten]
Sun May 13 12:08:11.187 [initandlisten] db version v2.4.10
Sun May 13 12:08:11.187 [initandlisten] git version: nogitversion
Sun May 13 12:08:11.187 [initandlisten] build info: Linux bm-wb-04 3.19.0-trunk-armmp #1 SMP Debian 3.19.1-1~exp1+plugwash1 (2015-03-28) armv7l BOOST_LIB_VERSION=1_55
Sun May 13 12:08:11.187 [initandlisten] allocator: system
Sun May 13 12:08:11.187 [initandlisten] options: { dbpath: "/home/pi/mongo/db/", fork: true, journal: true, logpath: "/home/pi/mongo/mongod.log" }
Sun May 13 12:08:11.198 [initandlisten] journal dir=/home/pi/mongo/db/journal
Sun May 13 12:08:11.198 [initandlisten] recover : no journal files present, no recovery needed
Sun May 13 12:08:11.238 [initandlisten] ERROR: mmap private failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64
Sun May 13 12:08:11.239 [initandlisten] Assertion: 13636:file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
0x662fa8 0x63527c 0x6196c0 0x6197bc 0x409d5c 0x4414fc 0x2ea634 0x2eaa3c 0x2eb55c 0x2ebd98 0x26f998 0x26fb94 0x175a20 0x177bf4 0x152bf0 0x76556294
mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x662fa8]
mongod(_ZN5mongo10logContextEPKc+0x110) [0x63527c]
mongod(_ZN5mongo11msgassertedEiPKc+0xc0) [0x6196c0]
mongod(_ZN5mongo18msgassertedNoTraceEiPKc+0) [0x6197bc]
mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x308) [0x409d5c]
mongod(_ZN5mongo13MongoDataFile12openExistingEPKc+0x9c) [0x4414fc]
mongod(_ZN5mongo8Database16openExistingFileEi+0x23c) [0x2ea634]
mongod(_ZN5mongo8Database12openAllFilesEv+0x24) [0x2eaa3c]
mongod(_ZN5mongo8DatabaseC2EPKcRbRKSs+0x158) [0x2eb55c]
mongod(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x500) [0x2ebd98]
mongod(_ZN5mongo6Client7Context11_finishInitEv+0x34) [0x26f998]
mongod(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x78) [0x26fb94]
mongod(_ZN5mongo14_initAndListenEi+0xb00) [0x175a20]
mongod(_ZN5mongo13initAndListenEi+0x14) [0x177bf4]
mongod(main+0x2b8) [0x152bf0]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0x76556294]
Sun May 13 12:08:11.250 [initandlisten] warning database /home/pi/mongo/db/ xueqiu could not be opened
Sun May 13 12:08:11.251 [initandlisten] DBException 13636: file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
Sun May 13 12:08:11.251 [initandlisten] exception in initAndListen: 13636 file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information), terminating
Sun May 13 12:08:11.251 dbexit:
Sun May 13 12:08:11.252 [initandlisten] shutdown: going to close listening sockets...
Sun May 13 12:08:11.252 [initandlisten] shutdown: going to flush diaglog...
Sun May 13 12:08:11.252 [initandlisten] shutdown: going to close sockets...
Sun May 13 12:08:11.252 [initandlisten] shutdown: waiting for fs preallocator...
Sun May 13 12:08:11.252 [initandlisten] shutdown: lock for final commit...
Sun May 13 12:08:11.252 [initandlisten] shutdown: final commit...
Sun May 13 12:08:11.252 [initandlisten] shutdown: closing all files...
Sun May 13 12:08:11.252 [initandlisten] closeAllFiles() finished
Sun May 13 12:08:11.252 [initandlisten] journalCleanup...
Sun May 13 12:08:11.253 [initandlisten] removeJournalFiles
Sun May 13 12:08:11.263 [initandlisten] shutdown: removing fs lock...
Sun May 13 12:08:11.264 dbexit: really exiting now
看了下mongod的用法,尝试把参数 --journal,去掉,重新运行,然后就可以了。
 
sudo mongod --fork --dbpath /home/pi/mongo/db/ --smallfiles --logpath /home/pi/mongo/log.txt 查看全部
平时在树莓派上开机自动执行以下命令,启动mongo服务
sudo mongod --fork --dbpath /home/pi/mongo/db/ --smallfiles --journal --logpath /home/pi/mongo/log.txt

突然今天发现mongo的服务连不上,看log发现mongo在启动后马上关闭了,提示的错误是在加载一个大的数据文件的时候提示内存不足(坑爹的,树莓派自身内存才1GB,无法扩容)。 
 
错误日志:
Sun May 13 12:08:11.185 [initandlisten] MongoDB starting : pid=1929 port=27017 dbpath=/home/pi/mongo/db/ 32-bit host=raspberrypi
Sun May 13 12:08:11.186 [initandlisten]
Sun May 13 12:08:11.186 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sun May 13 12:08:11.186 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Sun May 13 12:08:11.186 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Sun May 13 12:08:11.187 [initandlisten]
Sun May 13 12:08:11.187 [initandlisten] db version v2.4.10
Sun May 13 12:08:11.187 [initandlisten] git version: nogitversion
Sun May 13 12:08:11.187 [initandlisten] build info: Linux bm-wb-04 3.19.0-trunk-armmp #1 SMP Debian 3.19.1-1~exp1+plugwash1 (2015-03-28) armv7l BOOST_LIB_VERSION=1_55
Sun May 13 12:08:11.187 [initandlisten] allocator: system
Sun May 13 12:08:11.187 [initandlisten] options: { dbpath: "/home/pi/mongo/db/", fork: true, journal: true, logpath: "/home/pi/mongo/mongod.log" }
Sun May 13 12:08:11.198 [initandlisten] journal dir=/home/pi/mongo/db/journal
Sun May 13 12:08:11.198 [initandlisten] recover : no journal files present, no recovery needed
Sun May 13 12:08:11.238 [initandlisten] ERROR: mmap private failed with out of memory. You are using a 32-bit build and probably need to upgrade to 64
Sun May 13 12:08:11.239 [initandlisten] Assertion: 13636:file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
0x662fa8 0x63527c 0x6196c0 0x6197bc 0x409d5c 0x4414fc 0x2ea634 0x2eaa3c 0x2eb55c 0x2ebd98 0x26f998 0x26fb94 0x175a20 0x177bf4 0x152bf0 0x76556294
mongod(_ZN5mongo15printStackTraceERSo+0x1c) [0x662fa8]
mongod(_ZN5mongo10logContextEPKc+0x110) [0x63527c]
mongod(_ZN5mongo11msgassertedEiPKc+0xc0) [0x6196c0]
mongod(_ZN5mongo18msgassertedNoTraceEiPKc+0) [0x6197bc]
mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x308) [0x409d5c]
mongod(_ZN5mongo13MongoDataFile12openExistingEPKc+0x9c) [0x4414fc]
mongod(_ZN5mongo8Database16openExistingFileEi+0x23c) [0x2ea634]
mongod(_ZN5mongo8Database12openAllFilesEv+0x24) [0x2eaa3c]
mongod(_ZN5mongo8DatabaseC2EPKcRbRKSs+0x158) [0x2eb55c]
mongod(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x500) [0x2ebd98]
mongod(_ZN5mongo6Client7Context11_finishInitEv+0x34) [0x26f998]
mongod(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x78) [0x26fb94]
mongod(_ZN5mongo14_initAndListenEi+0xb00) [0x175a20]
mongod(_ZN5mongo13initAndListenEi+0x14) [0x177bf4]
mongod(main+0x2b8) [0x152bf0]
/lib/arm-linux-gnueabihf/libc.so.6(__libc_start_main+0x114) [0x76556294]
Sun May 13 12:08:11.250 [initandlisten] warning database /home/pi/mongo/db/ xueqiu could not be opened
Sun May 13 12:08:11.251 [initandlisten] DBException 13636: file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information)
Sun May 13 12:08:11.251 [initandlisten] exception in initAndListen: 13636 file /home/pi/mongo/db/xueqiu.5 open/create failed in createPrivateMap (look in log for more information), terminating
Sun May 13 12:08:11.251 dbexit:
Sun May 13 12:08:11.252 [initandlisten] shutdown: going to close listening sockets...
Sun May 13 12:08:11.252 [initandlisten] shutdown: going to flush diaglog...
Sun May 13 12:08:11.252 [initandlisten] shutdown: going to close sockets...
Sun May 13 12:08:11.252 [initandlisten] shutdown: waiting for fs preallocator...
Sun May 13 12:08:11.252 [initandlisten] shutdown: lock for final commit...
Sun May 13 12:08:11.252 [initandlisten] shutdown: final commit...
Sun May 13 12:08:11.252 [initandlisten] shutdown: closing all files...
Sun May 13 12:08:11.252 [initandlisten] closeAllFiles() finished
Sun May 13 12:08:11.252 [initandlisten] journalCleanup...
Sun May 13 12:08:11.253 [initandlisten] removeJournalFiles
Sun May 13 12:08:11.263 [initandlisten] shutdown: removing fs lock...
Sun May 13 12:08:11.264 dbexit: really exiting now

看了下mongod的用法,尝试把参数 --journal,去掉,重新运行,然后就可以了。
 
sudo mongod --fork --dbpath /home/pi/mongo/db/ --smallfiles --logpath /home/pi/mongo/log.txt

斐讯天天链H1局域网的传输速度很慢怎么解决?

网络李魔佛 发表了文章 • 0 个评论 • 4063 次浏览 • 2018-05-12 09:46 • 来自相关话题

路由器是斐讯K2,官方宣传的是1200M的传输速度





 
同一个网段内,连接的台式机和天天链硬盘,实际速度只有2~3M每秒,敢问这样做samba(网络共享)的意义何在?





点击查看大图 查看全部
路由器是斐讯K2,官方宣传的是1200M的传输速度

k2.PNG

 
同一个网段内,连接的台式机和天天链硬盘,实际速度只有2~3M每秒,敢问这样做samba(网络共享)的意义何在?

出书速度.PNG

点击查看大图

2018-05-10 操作记录

股票绫波丽 发表了文章 • 0 个评论 • 2836 次浏览 • 2018-05-10 16:36 • 来自相关话题

最近今日操作:
1. 开盘买入了 嘉澳转载 。 因为照片正股涨停开盘。 盘中作了几次T+0. 尾盘继续加仓,因为嘉澳环保 全天都是一字板,所以明天预期也是一字板,至少会高开。 所以明天嘉澳转债也会是高开的。 
明天的计划: 开盘冲高卖出一半嘉澳转债,  观察正股,做T
 
2. 尾盘买入鼎胜新材
理由:昨天和今天已经错过了宏川智慧,而且下午近端次新都在拉。所以想着鼎盛新材也会跟风拉,不过事与愿违,目前小套0.5%。 
明天: 如果次新集体暴跌,割肉。 只有鼎胜暴跌,加仓。冲高不涨停则全部清掉。 查看全部
最近今日操作:
1. 开盘买入了 嘉澳转载 。 因为照片正股涨停开盘。 盘中作了几次T+0. 尾盘继续加仓,因为嘉澳环保 全天都是一字板,所以明天预期也是一字板,至少会高开。 所以明天嘉澳转债也会是高开的。 
明天的计划: 开盘冲高卖出一半嘉澳转债,  观察正股,做T
 
2. 尾盘买入鼎胜新材
理由:昨天和今天已经错过了宏川智慧,而且下午近端次新都在拉。所以想着鼎盛新材也会跟风拉,不过事与愿违,目前小套0.5%。 
明天: 如果次新集体暴跌,割肉。 只有鼎胜暴跌,加仓。冲高不涨停则全部清掉。

pymongo连接树莓派的mongo server出现错误

树莓派李魔佛 发表了文章 • 0 个评论 • 6532 次浏览 • 2018-05-08 20:44 • 来自相关话题

客户端在ubuntu,安装的是pymongo, 服务端在树莓派,运行的是mongod的服务。
 
出现以下的错误:
 /usr/local/lib/python2.7/dist-packages/pymongo/topology_description.pyc in check_compatible(self)
    119         """
    120         if self._incompatible_err:
--> 121             raise ConfigurationError(self._incompatible_err)
    122 
    123     def has_server(self, address):

ConfigurationError: Server at raspberrypi:27017 reports wire version 0, but this version of PyMongo requires at least 2 (MongoDB 2.6).
 
##################### 问题排除 #####################
因为使用ubuntu连接本机的mongd server,没有出现这个问题。 所以问题应该处在版本上。
然后把pymongo的版本降下去,原来是3.6的版本,然后降到3.2. 重试后问题就解决了。
 
sudo pip install pymongo==3.2
  查看全部
客户端在ubuntu,安装的是pymongo, 服务端在树莓派,运行的是mongod的服务。
 
出现以下的错误:
 /usr/local/lib/python2.7/dist-packages/pymongo/topology_description.pyc in check_compatible(self)
    119         """
    120         if self._incompatible_err:
--> 121             raise ConfigurationError(self._incompatible_err)
    122 
    123     def has_server(self, address):

ConfigurationError: Server at raspberrypi:27017 reports wire version 0, but this version of PyMongo requires at least 2 (MongoDB 2.6).
 
##################### 问题排除 #####################
因为使用ubuntu连接本机的mongd server,没有出现这个问题。 所以问题应该处在版本上。
然后把pymongo的版本降下去,原来是3.6的版本,然后降到3.2. 重试后问题就解决了。
 
sudo pip install pymongo==3.2
 

linux的crontab中每隔一段时间是以什么为准

Linux李魔佛 发表了文章 • 0 个评论 • 5441 次浏览 • 2018-05-07 19:37 • 来自相关话题

*/10 * * * * date >> /home/user/test.log 
比如上面的语句, 每个10分钟运行一次,这个大家都知道(不知道的可以google),可是在运行中,这个10分钟是什么开始的呢? 
从上面运行的test.log记录的文件来看,这个10分钟是以当前的时钟,从0点开始算起的10分钟,比如你刚刚设定的crontab的时间是1点15分,那么脚本运行的时间是1点20分,因为这个时间间隔是0,10,20,30,40,50,0分这种规律执行的,并不是在你配置后crontab的时间(1点15分+10分钟,即1点25分)。所以如果你设定的是
*/40 * * * * date >> /home/user/test.log
那么执行的结果是0点40分,1点20分,2点,2点40分,3点20分。。。。这样的执行顺序。
有点奇葩。 查看全部
*/10 * * * * date >> /home/user/test.log
 
比如上面的语句, 每个10分钟运行一次,这个大家都知道(不知道的可以google),可是在运行中,这个10分钟是什么开始的呢? 
从上面运行的test.log记录的文件来看,这个10分钟是以当前的时钟,从0点开始算起的10分钟,比如你刚刚设定的crontab的时间是1点15分,那么脚本运行的时间是1点20分,因为这个时间间隔是0,10,20,30,40,50,0分这种规律执行的,并不是在你配置后crontab的时间(1点15分+10分钟,即1点25分)。所以如果你设定的是
*/40 * * * * date >> /home/user/test.log

那么执行的结果是0点40分,1点20分,2点,2点40分,3点20分。。。。这样的执行顺序。
有点奇葩。

斐讯赢呗PC端App官方地址

网络绫波丽 发表了文章 • 0 个评论 • 3691 次浏览 • 2018-05-05 19:05 • 来自相关话题

居然藏在这里:





http://www.phicomm.com/cn/index.php/Products/none_details.html

2018-05-02 复盘

股票绫波丽 发表了文章 • 0 个评论 • 2739 次浏览 • 2018-05-02 23:12 • 来自相关话题

今日操作:

1. 万信转债 T+0 操作,因为费率十万分之5,所以操作较为高频。 这个操作其实使用自动化下单来操作。 这样就不需要盯盘或者不断埋单,撤单。

2. 把前期中的可转债的签,利欧转债,岩土转债割肉了,买入了江阴转债,为了今晚江阴会下调转股价。

果不其然,晚上江阴银行发公告,下调了转股价,下调了转股价后,现在的转股价格为95.869,那么明天的可转债价格大概率会在103上面。

明天计划:开盘就卖出江阴转债,然后把资金买入无锡转债(如果无锡转债价格低于100)

3. 尾盘买入了兆日科技,前期芯片连班+超跌。 尾盘看着芯片板块跌不下去了,目前还没有其他热门板块(医药作为防守,容易追高被套),所以还是继续介入芯片板块。

明天计划:高开就卖出(10点前),除非强势涨停。

  查看全部
今日操作:

1. 万信转债 T+0 操作,因为费率十万分之5,所以操作较为高频。 这个操作其实使用自动化下单来操作。 这样就不需要盯盘或者不断埋单,撤单。

2. 把前期中的可转债的签,利欧转债,岩土转债割肉了,买入了江阴转债,为了今晚江阴会下调转股价。

果不其然,晚上江阴银行发公告,下调了转股价,下调了转股价后,现在的转股价格为95.869,那么明天的可转债价格大概率会在103上面。

明天计划:开盘就卖出江阴转债,然后把资金买入无锡转债(如果无锡转债价格低于100)

3. 尾盘买入了兆日科技,前期芯片连班+超跌。 尾盘看着芯片板块跌不下去了,目前还没有其他热门板块(医药作为防守,容易追高被套),所以还是继续介入芯片板块。

明天计划:高开就卖出(10点前),除非强势涨停。