Sic transit gloria mundi

Welcome


  • 首页

  • 标签

  • 分类

  • 归档

python SQLite3 插入数据问题

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 Experience

今天想用beautifulsoup写一个小爬虫爬爬Twitter上的推文,结果在sqlite数据库insert的时候出了一点小问题,一开始我用的是传统的python string substitution如下:

1
2
3
sql = '''insert into Tweets (num, content) values ("%s","%s")''' %(i,content)
c.execute(sql)
coon.commit()

由于推文上的字符是非常多的符号。。。结果没有经过转义,也不知道sqlite内部的转义为什么没起作用,应该是由于还有空行的关系,所以果断采用sqlite内部的参数传递方法如下:

1
2
3
sql = '''insert into Tweets (num, content) values (?,?)''' ,(i,content)
c.execute(sql)
coon.commit()

会出现ValueError: operation parameter must be str这个错误,查了一些stackoverflow的解答,最后得到正确形式:

1
2
3
4
sql = '''insert into Tweets (num, content) values (?,?)'''
para = (i,content)
c.execute(sql,para)
coon.commit()

windows 下 Git push 出错

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 Experience

错误信息:remote: Permission to ProHiryu/Coursera-test.git denied to forever-cactus.
fatal: unable to access ‘https://git@github.com/ProHiryu/Coursera-test.git/‘: The requested URL returned error: 403

其中ProHiryu是我的用户名。

在网上查了很久,大多就是吧Github上面的英文翻译了一下,我折腾了一下午,都快要放弃了,在一个英文网站上看到了一个正确回答,就搞定了。

首先这篇文章的前提是,你已经在Windows上正确配置了Git,这个网上有大把教程可以查。

然后你需要在github上已经将公钥导入,具体参考:https://help.github.com/articles/error-permission-to-user-repo-denied-to-user-other-repo/

阅读全文 »

eclipse 安装 aptana 插件 很愚蠢的问题

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 Experience

今天想重新配一下Web开发环境

在Eclipse上自动安装http://download.aptana.com/studio3/plugin/install的插件,结果发现不管怎么样都不成功,一直有bug出现,后来也试过各种离线方法,都不成功,才发现是自己开了VPN,导致连不上更新网站,希望以后安装插件不要出现这种问题。

false positive 与 false negative

发表于 2016-11-03 | 更新于 2017-05-31 | 分类于 SIEM

本文针对 ROC 曲线相关的各种概念进行基本阐述,以供日后查阅

基本概念

二元分类模型的个案预测有四种结局:

  • 真阳性(TP):诊断为有,实际上也有高血压。
  • 伪阳性(FP):诊断为有,实际却没有高血压。
  • 真阴性(TN):诊断为没有,实际上也没有高血压。
  • 伪阴性(FN):诊断为没有,实际却有高血压。
Confusion matrix 实际为 True 实际为 False
检测为 True TP FP
检测为 False FN TN

以上定义来自 wiki,从表中可以很清晰地看出对应的关系,注意 TP 等概念指的是对应的项目个数,同样的,这里并不涉及到各种检测率的概念,只是单纯的程序是否判断正确的个数统计。注意,涉及到多类问题的时候,应该将每一类分开计算,其余类别均属于错误范围内。

阅读全文 »

security information and event management 学习初探(四)

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 SIEM

虽然是和上一篇一起看的,以防混淆我还是分开来写吧
另:大佬们不给事情做真的让我很心痛啊/(ㄒoㄒ)/~~

今天主要讲的是第三部分,SIEM的工具

PART III SIEM Tools

CHAPTER 8 AlienVault OSSIM Implementation

OSSIM:Open Source Security Information Management

The concept of OSSIM is simple—don’t reinvent the wheel

阅读全文 »

security information and event management 学习初探(三)

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 SIEM

今天直接捡重点的讲吧,不重要的部分都跳过去了
今天主要内容是SIEM的整个架构

PART II IT Threat Intelligence Using SIEM Systems

CHAPTER 5 The Anatomy of a SIEM

首先是整个SIEM的流程图:
这里写图片描述

阅读全文 »

security information and event management 学习初探(二)

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 SIEM

上次勉强看完了第一本关于关联分析的书
今天来看下一本真正讲到SIEM当中有关概念以及实现的书

PART I Introduction to SIEM: Threat Intelligence for IT Systems

CHAPTER 1 Business Models

商业模式分为三种: Government Commercial Universities

首先是一个概念,学过安全的人都知道:CIA -> Confidentiality、Integrity、Availability
Three-Letter Agencies
Central Intelligence Agency (CIA)
Federal Bureau of Investigations (FBI)
National Security Agency (NSA)
Britain’s MI5
Iran’s Ministry of Security (MOIS/VEVAK)
Germany’s Federal Intelligence Service(Bundesnachrichtendienst)

principles of system security:categorization of data、need to know、the principle of least privilege

阅读全文 »

security information and event management 学习初探(一)

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 SIEM

参考资料:
intrusion detection and correlation
security information and event management implementation
Gartner magic quadrant for security information and event management(年报)

由于是上班第一天,大佬们比较忙,所以可能需要自己查阅很多资料,虽然是很粗略的看了上面关于警报关联分析的那一本书,还是在这里稍微总结一下:
首先是一个最基本的概念:
A successful intrusion into a computer:
1.surveillance stage 监控阶段
2.exploitation stage
3.masquerading stage 伪装阶段

阅读全文 »

MySQL 服务无法启动

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 Experience

在网上查了很多资料大多都是瞎扯,事实上文档当中写了,应该用以下语句
mysqld —initialize 先初始化data目录
然后就可以启动了

MATLAB拟合曲线

发表于 2016-11-03 | 更新于 2017-05-05 | 分类于 Data Visualizaion

今天想帮朋友做一个简单的数据拟合,然后画图,结果发现网上都没有现成的模板,只能自己摸索了,最后搜到了一个简单的方法,将多条曲线放到一个图上。
以下是数据:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
X1 =
0 0.8800
4.0000 1.0400
8.0000 1.0200
12.0000 1.1000
x1 =
0 4 8 12
y1 =
0.8800 1.0400 1.0200 1.1000
X2 =
0 2.1600
4.0000 3.0500
8.0000 3.2400
12.0000 3.9500
x2 =
0 4 8 12
y2 =
2.1600 3.0500 3.2400 3.9500
X3 =
0 4.2900
4.0000 3.2300
8.0000 2.8600
12.0000 3.3200
16.0000 4.7900
x3 =
0 4 8 12 16
y3 =
4.2900 3.2300 2.8600 3.3200 4.7900
阅读全文 »
1…345
Augustus

Augustus

The rest is silence
41 日志
17 分类
39 标签
GitHub E-Mail Weibo Twitter
© 2016 – 2019 Augustus