I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
| <?php | |
| /* | |
| Updated version, 2016-12-02: fixed shellcode so it *actually* works on QEMU | |
| usermode emulation (seems I pushed an old version), and removed debug output. | |
| ------------------------- | |
| NB: THIS PoC ONLY WORKS IN QEMU USERMODE EMULATION! | |
| If anyone wants to fix this, go ahead (no pun intended). | |
| However, I don't have a vulnerable product and am unwilling to acquire one. |
| # coding: utf8 | |
| ''' | |
| 对于图片相似度比较有很多方法,我们这以RGB直方图为例。 | |
| 我们以一种规则,使得每个图片生成一组描述的特征向量。 | |
| opencv的直方图比较函数我们可以巧妙的利用,其有若干比较规则,但只支持直方图的数据结构,我们可以将特征向量拟合成直方图的数据结构,然后使用其的相似度比较函数。 | |
| 具体的数学计算方法有兴趣的可以看opencv的官方教程,这里我们期望生成百分比形式的相似度参数,所以使用CV_COMP_CORREL | |
| 以下是代码,以python编写 | |
| ''' | |
| import cv2.cv as cv |
| /* | |
| * define file about portable socket class. | |
| * description:this sock is suit both windows and linux | |
| * design:odison | |
| * e-mail:odison@126.com> | |
| * | |
| */ | |
| #ifndef _ODSOCKET_H_ | |
| #define _ODSOCKET_H_ |
| #ifndef __CSocket__ | |
| #define __CSocket__ | |
| #if CC_TARGET_PLATFORM==CC_PLATFORM_WIN32 | |
| #include <winsock.h> | |
| #elif CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <netdb.h> | |
| #include <arpa/inet.h> |
| local skynet = require "skynet" | |
| local socket = require "socket" | |
| local mode = ... | |
| if mode == "agent" then | |
| skynet.start(function() | |
| skynet.dispatch("lua", function(_,_,id) | |
| socket.start(id) |
| #include "lua.h" | |
| #include "lauxlib.h" | |
| #include <stdio.h> | |
| int | |
| dylib_add(lua_State* L) { | |
| int a = lua_tonumber(L,1); | |
| int b = lua_tonumber(L,2); | |
| int c = a+b; |
| local skynet = require "skynet" | |
| local mongo = require "mongo" | |
| skynet.start(function() | |
| local db = mongo.client { host = "127.0.0.1" , username = "user", password = "pass" } | |
| local r = db:runCommand "listDatabases" | |
| for k,v in ipairs(r.databases) do | |
| print(v.name) | |
| end |
| --[[ config | |
| root = "./" | |
| listen = "127.0.0.1:8786" | |
| redisaddr = "127.0.0.1:6379[1]" | |
| dbfile = root .. "backup.db" | |
| thread = 4 | |
| logger = nil | |
| harbor = 1 |