sqlite3

Linux上安装sqlite3

我的梦境 提交于 2019-12-05 11:17:44
tar -zxvf sqlite-snapshot-201905091837.tar.gz cd sqlite-snapshot-201905091837 make /usr/local/sqlite3 ./configure --prefix=/usr/local/sqlite3 make make install #ln -s /usr/local/sqlite3/bin/sqlite3 /usr/bin/sqlite3#可以不做 vi /etc/profile export LD_LIBRARY_PATH=/usr/local/sqlite3/lib 查看版本 [root@redaht69 bin]# /opt/sqlite3/bin/sqlite3 --version 3.29.0 2019-05-09 18:37:37 1dfc95b8673b0e8c9ef5040c2fa0fbe9846e430d104e9b83f3f1f3ad63446380 [root@redaht69 bin]# python3 Python 3.6.2 (default, Nov 22 2019, 19:59:09) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or

iOS开发-代码混淆

我怕爱的太早我们不能终老 提交于 2019-12-05 05:56:25
点击上方“ iOS开发 ”,选择“置顶公众号” 关键时刻,第一时间送达! 作者:张囧瑞 來源:简书 文:https://www.jianshu.com/p/864ce7dc9c25 iOS开发整理发布,转载请联系作者获得授权 iOS表面上看来是比android安全的多的,在网络上针对android的加密保护也比iOS多得多,但是这并不意味着iOS就是很安全的,如果在正常的设备上还好,但是在越狱的设备上,我们的代码信息就会暴露的一干二净,不仅可以被别人看到我们的方法是如何调用的,就连我们那些写的很垃圾的代码也会被人看的一清二楚,想想就是很丢人的事情,我这个菜鸡对iOS安全了解的也并不是很多,这篇文章也就仅根据念茜女神的博客对iOS中的代码混淆做一些初步的处理,如果你是稍微知道一点点iOS安全的东西,这时候就可以cmd+w拜拜了。 好了,开始正文。 class-dump This is a command-line utility for examining the Objective-C runtime information stored in Mach-O files.It generates declarations for the classes,categories and protocols.This is the same information provided by

iOS攻防 - (三)iOS应用的代码打包前混淆,不影响源代码

99封情书 提交于 2019-12-05 05:52:23
iOS攻防 - (三)iOS应用的代码打包前混淆,不影响源代码 出于iOS应用的安全考虑,如:银行类型APP, 金融相关APP, 登录功能,支付功能等; 某些时候,我们需要对iOS应用的重要函数或名称进行混淆,因为即使是App Store下载的应用亦可以使用class-dump进行导出应用的所有头文件,这就太不安全了。为了加大程序结构的逆向或破解难度,此文讲解如何对iOS应用的源代码进行混淆处理 1.混淆的常规思路 花指令,花代码,在程序中加入迷惑人的代码指令 易读字符替换 此文讲解对易读字符替换 Objective-C/Swift的方法名、属性名或类名混淆 混淆的时机是在编译前 混淆后,不影响源代码 混淆生成的规则,可以是随机不重复的字符串 混淆后,为了方便后续排查问题,需要使用SQLite3进行记录 混淆脚本,需要加入 ProjectName --> Build Phases --> Run Script --> 添加你要混淆脚本文件的完整路径 方法selector,如 无参数函数,直接通过#define funcName 方法selector,如 有一个参数,直接通过#define funcName 方法selector,如 有多个参数,分别通过#define funcNameA、funcNameB、funcNameC 2.脚本代码如下: #!/bin/bash #

Django开发简单博客流程

这一生的挚爱 提交于 2019-12-04 19:56:52
什么是 Django? Django是一个基于python的高级web开发框架 它能够让开发人员进行高效且快速的开发 高度集成(不用自己造轮子), 免费并且开源 当前路径创建工程 django-admin startproject myblog    目录名称不建议修改 Wsgi.py python服务器网关接口(python应用与web服务器之间的接口) Urls.py Django项目中所有地址(页面)都需要自己去配置URL Settings.py 数据库等等配置 __init_模块化,可以导入 创建应用 : 打开命令行,进入项目中manage.py同级目录   命令行输入: python manage.py startapp blog 添加应用名到settings.py中的Insalled_APPS里    migrations数据移植(迁移)模块 admin.py :该应用的后台管理系统配置(Django自带的后台管理系统) apps.py :当前应用的一些配置,Django-1.9以后自动生成 models.py : 数据模块,使用了ORM框架.类似于MVC结构中的Models(模型) views.py :执行相应的代码所在模块,代码逻辑处理的主要地点,项目中的大部分代码均这里编写 代码开始 项目中第二种URl 配置 在根urls.py中引入include

Python操作SQLite/MySQL/LMDB

痴心易碎 提交于 2019-12-03 23:20:21
1.概述 1.1前言   最近在存储字模图像集的时候,需要学习LMDB,趁此机会复习了SQLite和MySQL的使用,一起整理在此。 1.2环境   使用win7,Python 3.5.2。 2.SQLite 2.1准备   SQLite是一种嵌入式数据库,它的数据库就是一个文件。Python 2.5x以上版本内置了SQLite3,使用时直接import sqlite3即可。 2.2操作流程   概括地讲,操作SQLite的流程是:     ·通过sqlite3.open()创建与数据库文件的连接对象connection     ·通过connection.cursor()创建光标对象cursor     ·通过cursor.execute()执行SQL语句     ·通过connection.commit()提交当前的事务,或者通过cursor.fetchall()获得查询结果     ·通过connection.close()关闭与数据库文件的连接   详细的sqlite3模块API可以看这里: SQLite - Python   总结起来就是用cursor.execute()执行SQL语句,改变数据(插入、删除、修改)时用connection.commit()提交变更,查询数据时用cursor.fetchall()得到查询结果。 2.3操作实例 2.3.1建立数据库与建立表

How can I mock sqlite3.Cursor

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been pulling my hair out trying to figure out how to mock the sqlite3.Cursor class specifically the fetchall method. Consider the following code sample import sqlite3 from mock import Mock, patch from nose.tools import assert_false class Foo: def check_name(name): conn = sqlite3.connect('temp.db') c = conn.cursor() c.execute('SELECT * FROM foo where name = ?', name) if len(c.fetchall()) > 0: return True return False @patch('sqlite3.Cursor.fetchall', Mock(return_value=['John', 'Bob'])) def test_foo(): foo = Foo() assert_false(foo.check

sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using SQLite3 in Python, I am trying to store a compressed version of a snippet of UTF-8 HTML code. Code looks like this: ... c = connection.cursor() c.execute('create table blah (cid integer primary key,html blob)') ... c.execute('insert or ignore into blah values (?, ?)',(cid, zlib.compress(html))) At which point at get the error: sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch

sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 74 supplied

匿名 (未验证) 提交于 2019-12-03 02:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: def insert(array): connection=sqlite3.connect('images.db') cursor=connection.cursor() cnt=0 while cnt != len(array): img = array[cnt] print(array[cnt]) cursor.execute('INSERT INTO images VALUES(?)', (img)) cnt+= 1 connection.commit() connection.close() I cannot figure out why this is giving me the error, The actual string I am trying to insert is 74 chars long, it's: "/gifs/epic-fail-photos-there-i-fixed-it-aww-man-the-tire-pressures-low.gif" I've tried to str(array[cnt]) before inserting it, but the same issue is happening, the database