首页 文章 精选 留言 我的

精选列表

搜索[借贷反欺诈],共5301篇文章
优秀的个人博客,低调大师

Nginx代MySQL案例

案例:一个朋友要用Nginx代理MySQL(MySQL局域网),不用×××,不用NAT映射等,好吧,做个笔记。 Nginx版本:1.9.x(持tcp的负载均衡,nginx_tcp_proxy_module(姚伟斌阿里团队也可以实现)) Nginx官方模块:ngx_stream_core_module --with-stream_ssl_module(ssl协议支持,比如MySQL ssl) 官网:http://nginx.org/en/docs/stream/ngx_stream_core_module.html 1、查看现有编译 --user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-http_flv_module--with-http_mp4_module--with-http_gzip_static_module 2、重新编译: http://nginx.org/download/ --user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-http_flv_module--with-http_mp4_module--with-http_gzip_static_module--with-stream--with-stream_ssl_module 注意:--with-stream --with-stream_ssl_module 3、配置、检测、重启nginx: 配置: stream{ upstreammysql{ zonemyapp164k; serverlocalhost:3306weight=1max_fails=3fail_timeout=30s; #server192.168.1.221:3306weight=1max_fails=2fail_timeout=30s; } server{ listen2188; proxy_connect_timeout1s; proxy_timeout3s; proxy_passmysql; } } 检测: [root@autoCentos67X64conf]#nginx-t nginx:theconfigurationfile/usr/local/nginx/conf/nginx.confsyntaxisok nginx:configurationfile/usr/local/nginx/conf/nginx.conftestissuccessful [root@autoCentos67X64conf]# 启动: [root@autoCentos67X64conf]#netstat-atupn|grepnginx tcp000.0.0.0:21880.0.0.0:*LISTEN2359/nginx [root@autoCentos67X64conf]# 4、验证:(转载请保留:renzhiyuan.blog.51cto.com) [root@log~]#mysql-uroot-prenzhiyuan-h192.168.1.11-P2188 WelcometotheMySQLmonitor.Commandsendwith;or\g. YourMySQLconnectionidis3 Serverversion:5.6.21-logMySQLCommunityServer(GPL) Copyright(c)2000,2013,Oracleand/oritsaffiliates.Allrightsreserved. OracleisaregisteredtrademarkofOracleCorporationand/orits affiliates.Othernamesmaybetrademarksoftheirrespective owners. Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement. mysql> 注意:2188可是Nginx的端口,代理(负载)后端的MySQL。其它玩法大家可自己研究。

优秀的个人博客,低调大师

Veilid —— 数据收集开源框架

Veilid(读作 "Vay-Lid",源自 "Valid and Veiled Identification"),是一个点对点网络,用于轻松共享各种数据。 Veilid 允许任何人创建分布式私人应用程序,许用户选择退出数据收集和在线跟踪。Veilid 以用户体验、隐私和安全为首要任务。 Veilid 在设计时考虑到了社交维度,因此每个用户都可以在网络上存储个人内容,也可以与自己选择的其他人共享这些内容,如果愿意,还可以与全世界共享。 Veilid 网络的主要目的是为特定类型的共享数据提供基础设施:各种形式的社交媒体。这包括轻量级内容(例如 Twitter 的 tweets 或 Mastodon 的 toots)、中等量级内容(例如图像和歌曲)以及重量级内容(例如视频)。个人订阅、回复、私人消息等 Meta-content 也旨在在 Veilid 上运行。 Veilid 超越了现有的隐私技术,有可能彻底改变人们使用互联网的方式。Veilid 没有盈利动机,可以在不损害资本主义的情况下促进理想的实现。

优秀的个人博客,低调大师

iOS骚扰电话-CallKit

iOS10增加了识别骚扰电话的API,有三款主流的软件已经实现。也有一些报道分析 前几天查了查资料,动手写了一个Demo. 原理 电话号码是用Call Directory extension事先存在系统里的,当来电时,系统会查询存储的数据, 根据号码绑定的label,决定直接屏蔽还是显示来电。 iOS-CallKit.png When using CallKit's Call Blocking & Identification feature (new in iOS 10), phone numbers to be blocked or identified are loaded by your app's Call Directory extension prior to an incoming call and the phone numbers are stored by the system. Then, when an incoming call arrives, this stored data is consulted by the system and an incoming call may either be blocked or identified in the incoming call UI with the label provided. For privacy and performance reasons, Call Directory app extensions are not launched when incoming calls arrive and an app extension cannot retrieve the phone number for an incoming call http://stackoverflow.com/questions/38098036/how-to-get-the-incoming-call-number-by-using-callkithttps://www.zhihu.com/question/47542405 步骤 1 . 新建一个工程,New 一个 Target,选Call Directory Extension ,会自动生成模版代码。 override func beginRequest(with context: CXCallDirectoryExtensionContext) { context.delegate = self do { try addBlockingPhoneNumbers(to: context) } catch { NSLog("Unable to add blocking phone numbers") let error = NSError(domain: "CallDirectoryHandler", code: 1, userInfo: nil) context.cancelRequest(withError: error) return } do { try addIdentificationPhoneNumbers(to: context) } catch { NSLog("Unable to add identification phone numbers") let error = NSError(domain: "CallDirectoryHandler", code: 2, userInfo: nil) context.cancelRequest(withError: error) return } NSLog("beginRequest context ", context); context.completeRequest() } private func addBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws { // Retrieve phone numbers to block from data store. For optimal performance and memory usage when there are many phone numbers, // consider only loading a subset of numbers at a given time and using autorelease pool(s) to release objects allocated during each batch of numbers which are loaded. // let phoneNumbers: [CXCallDirectoryPhoneNumber] = [ +8618005555555, +8618005555555 ] for phoneNumber in phoneNumbers { context.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber) } } private func addIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws { // Retrieve phone numbers to identify and their identification labels from data store. For optimal performance and memory usage when there are many phone numbers, // consider only loading a subset of numbers at a given time and using autorelease pool(s) to release objects allocated during each batch of numbers which are loaded. // // Numbers must be provided in numerically ascending order. let phoneNumbers: [CXCallDirectoryPhoneNumber] = [ +8618005555555, +8618005555555 ] let labels = [ "骚扰电话", "Local business" ] for (phoneNumber, label) in zip(phoneNumbers, labels) { context.addIdentificationEntry(withNextSequentialPhoneNumber: phoneNumber, label: label) } } 2 . 手工给Extension 生成 一个 CallDirectoryExtension.entitlements 文件。 3 . 运行。在设备的设置 —> 电话 —> Call Blocking & Identification,开启我们的 App。 4 . 打电话 效果 IMG_4610.png API beginRequest 该方法在 Containing App 调用 reload 或者在 设置 —> 电话 —> Call Blocking & Identification里开启权限的时候,会自动被调用。但是打断点的时候,无法进来。 open class CXCallDirectoryProvider : NSObject, NSExtensionRequestHandling { open func beginRequest(with context: CXCallDirectoryExtensionContext) } 给系统数据库增加骚扰电话号码 open func addBlockingEntry(withNextSequentialPhoneNumber phoneNumber: CXCallDirectoryPhoneNumber) 数据量大时,需要分批处理,注意内存问题。consider only loading a subset of numbers at a given time and using autorelease pool(s) to release objects allocated during each batch of numbers which are loaded. 号码升序排列。 Numbers must be provided in numerically ascending order 号码需要加区号。 Edit retrievePhoneNumbersToIdentifyAndLabels() to include the number and label you want. Add +CountryCode at the start (not confirmed yet if this is essential) 给系统数据库增加骚扰电话号码以及提示的文本 open func addIdentificationEntry(withNextSequentialPhoneNumber phoneNumber: CXCallDirectoryPhoneNumber, label: String) 提交 open func completeRequest(completionHandler completion: (@escaping (Bool) -> Swift.Void)? = nil) 苹果开发交流网站上的总结 https://forums.developer.apple.com/thread/48837 I've managed to get this working, here's what I did and some observations: 1) Create a new target of Type Call Directory Extension. 2) Edit retrievePhoneNumbersToIdentifyAndLabels() to include the number and label you want. Add +CountryCode at the start (not confirmed yet if this is essential) 3) Run the containing app target. 4) In setting go to Phone/Call Blocking & IdentificationAnd turn on you extension (or it will automatically be turned on if you run the entension target rather than the containing app target) 5) Make a call Its not possible to hit any breakpoints in the extension if running in XCode regardless of which target you execute. NSLog statements can be viewed via XCode's devices, it indicates that the extension is called in step 4) if the above steps are called. I don't know if/when its called subsequently after that, it has to be otherwise how can an updated list be applied? If you want to make a change to the label, the OS does caching, so turn off the extension, delete the containing app app, clear the call history from the phone app, install and run again.

优秀的个人博客,低调大师

网骗欺诈?网络裸奔?都是因为 HTTP?

先跟大家讲个故事,我初恋是在初中时谈的,我的后桌的后桌。那个时候没有手机这类的沟通工具,上课交流有三宝,脚踢屁股、笔戳后背以及传纸条,当然我只能是那个屁股和后背,还不是能让初恋踢到的后背。 但是说实话传纸条真的很危险,尤其是这种早恋的纸条,被抓到就是一首《凉凉》。 特别我和初恋中间还隔着一个搞事的狗蛋,常年使用神乎其技的笔迹模仿技术篡改小纸条的内容,往往我写的是“放学一起去逛逛吧”,到了我初恋手里就变成了“放学一起写作业吧”。以至于我常年满怀期待的放学,然后痛苦的畅游作业的海洋。 不过好汉不提当年,我现在已经是一名出色的互联网人了,再也不用传纸条了,也不用再接受狗蛋的支配了。 这样想的我,猝不及防的就发现自己拍摄的美女图片,居然全部变成了如花!这到底是怎么回事? 美女变如花,数据在裸奔!聊聊什么是网络劫持。 在浏览器中输入相同的 URL,有的时候并不会出现同样的内容,比如想我今天遇到的美女变如花一样。 左边是正确响应会出现的图片,而右边则是莫名其妙出现的如花。这是因为 HTTP 被劫持了。 当 HTTP 被劫持时,虽然DNS 解析域名 IP 地址不变,但是在和网站交互过程中劫持了用户的请求。在网站返回用户信息前,就返回了其他的请求,导致正常网站出现弹窗广告,甚至跳转到其他恶意网站。除去网页内容的变化,HTTP 被劫持后还会导致以下问题: 用户输入正常网址跳转到其它地址,导致用户无法正常访问,网站流量受损; 通过泛域名解析生成大量子域名共同指向其它地址,跳转到非法网站,造成网站权重降低; 域名被解析到恶意钓鱼网站,导致用户财产损失,造成客户投诉; 网站经常弹出广告,影响客户体验,造成信誉度下降。 与此同时,HTTP 劫持还有很多类型,详情可以查看《网站莫名跳转,从百度谈什么是网站劫持?》 这些繁杂的手段让人防不胜防,也让网站变得极为不安全。可以偏偏对于现代社会而言安全是第一要素,以致于连浏览器都进化到自带安全监测,可以在你访问网站时给你安全提示。 链接不安全,链接不是私密链接,都是因为链接不是 HTTPS,这你注意到了么? 相信各位互联网人上人在使用1024G网络高强度冲浪的时候肯定见到过下面这个提醒。 啊?什么?你说你没见过?答应我不要再用 IE 了好吗! 咳咳,那么说回正经的,出现这个提示可并不是因为逛了什么让人会心一笑,你懂我也懂的网站,纯粹只是因为当前网站使用的 SSL 证书不是正规证书,或证书已经过期时, HTTPS 协议无法正常请求而已。 从互联网发展至今,HTTP 一直担任互联网传输信息的标准协议。传输的信息可以是互联网内计算机之间的文档,文件,图像,视频等。在 HTTP 请求过程中,客户端与服务器之间没有任何身份确认的过程,数据全部明文传输,“裸奔”在互联网上,所以很容易遭到黑客的攻击。 因此未来保护数据安全,带有 SSL 的 HTTP——HTTPS 诞生了。HTTPS 即 HTTP+SSL/TLS,可以理解为 HTTP 下加入 SSL 层,HTTPS 的安全基础是SSL,因此加密的详细内容就需要 SSL,用于安全的 HTTP数据传输。 整体来看,相比 HTTP,HTTPS拥有以下五个优点: 最大限度地提高 Web 上数据和事务的安全性; 加密用户敏感或者机密信息; 提高搜索引擎中的排名; 避免在浏览器中出现“不安全”的提示; 提升用户对网站的信赖。 安全在现代社会是放在第一位的,所以 HTTPS 在现代互联网中有着举足轻重的地位,它保护着我们在网络上的安全。 HTTPS 比 HTTP 更安全吗?为什么大多数网站还是使用 HTTP? 尽管 HTTP 协议无法加密数据,让所有通信数据都在网络中明文“裸奔”,容易导致数据泄露、数据篡改、流量劫持、钓鱼攻击等安全问题。大家也都知道 HTTPS 是用来解决 HTTP 明文协议的缺陷,它通过在 HTTP 的基础上加入 SSL/TLS 协议,依靠 SSL 证书来验证服务器的身份,为客户端和服务器端之间建立“SSL”通道,确保数据运输安全。 但是大多数网站还是选择使用 HTTP 来进行访问,难道他们不知道 HTTPS 有多好,安全有多重要么?其实不是的,大家都知道 HTTPS 才是现在互联网最需要的形态,特别如果能使用全站 HTTPS 就能保证数据安全,维护用户隐私。但是大部分网站依然使用 HTTP 的原因则是以下三点: SSL 证书费用问题:开启 HTTPS 的必要条件就是要有 SSL 证书,而 SSL 证书是需要申购的,看到“申购”二字,大部分人都会觉得和费用支付离不开,所以网站会因为不想每年在证书上花费不菲的费用选择使用不安全的 HTTP。 服务器资源消耗问题:HTTPS 连接服务器端资源占用高,HTTPS 协议握手费时,为了不增加服务器资源的消耗,部分网站也会选择放弃 HTTPS。 访问速度降低问题:比起 HTTP 而言,HTTPS 需要多几次握手,用户从 HTTP 跳转到 HTTPS 需要一些时间,这会显得网站访问速度变慢了,为了让网站访问更流畅,部分网站也会放弃 HTTPS。 其实如果你更深入的了解一点,就会发现上述的几个问题都不存在,或者说可以通过优化来解决这些问题。而优化的方式也非常简单,想要了解的小伙伴可以点击阅读获取,只需要你读完这篇,你所担心的问题都会迎刃而解~ 推荐阅读 白话科普系列——Chrome 浏览器,你用了么? 技术选型:为什么批处理我们却选择了Flink

优秀的个人博客,低调大师

机器学习帮助您挖掘金融欺诈用户

通过最佳实践帮助您实现上述案例效果 Step1:数据导入MaxCompute 1.1 创建需要上传的本地数据 人员管理表: 字段名 含义 类型 描述 start_point 边的起始节点 string 人 end_point 边的结束节点 string 人 count 关系紧密度 double 数值越大,两人的关系越紧密 源数据:person 已知数据表: 字段名 含义 类型 描述 point 用户名 string 人 point_type 用户类型 string 类型 weight 信用指数 double 指数 源数据:point 1.2 创建MaxCompute表 1.2.1 开通MaxCompute 阿里

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册