- 博客(63)
- 资源 (8)
- 问答 (6)
- 收藏
- 关注
原创 python批量mp4转gif
#!/usr/bin/python3# -*- coding: utf-8 -*-# File mp4_to_gif.py# Date 2019-07-03 10:43# Author Medueimport hashlibfrom cv2 import VideoCapturefrom moviepy.editor import *dir_paths = '/Users/ak...
2019-09-25 18:22:07
2178
原创 slim:项目应用(二)数据库
项目应用(二)数据库数据库使用doctrine orm,doctrine的依赖包含了后面会用到的symfony/console组件安装doctrine ormcomposer require doctrine/orm新建cli配置# config/cli-config.php<?phpuse Doctrine\ORM\EntityManager;use Doctr...
2019-09-16 12:38:51
748
原创 slim:项目应用(一)基础结构
项目应用(一)基础结构这些都是基础的,没有复杂的功能为方便调试加入了[symfony debug](https://symfony.com/doc/current/components/debug.html)组件env环境# env文件加载使用了[symfony Dotenv](https://symfony.com/doc/current/components/dotenv.ht...
2019-07-31 18:27:52
543
原创 slim:入门(二)运行slim
入门教程(二)运行slim创建入口文件# public/index.php<?phprequire '../vendor/autoload.php';use \Psr\Http\Message\ServerRequestInterface as Request;use \Psr\Http\Message\ResponseInterface as Response;$a...
2019-07-31 18:26:48
554
原创 slim:入门(一)安装slim
入门教程(一)安装slim创建项目文件夹/User/akio/develop/slim创建composer.json{ "require": { "slim/slim": "3.0" }}安装composer install或composer require slim/slim /User/akio/develop/slim...
2019-07-31 18:26:04
2930
原创 git删除已提交文件
git修改最近一次提交内容https://git-scm.com/book/zh/v1/Git-工具-重写历史# 修改最近一次提交并执行'rm -f document/body'命令,git会在根目录创建.git-Rewrite目录重写,然后提交git filter-branch --tree-filter "rm -f document/body" HEAD# or 通过fin...
2018-06-01 17:27:40
2820
转载 关于symfony4从数据库生成实体到项目
文章来源symfony4从数据库生成实体和源数据sf4目录结构和之前的版本有很大差别,基本MVC结构和Repository。 sf4生成实体和源数据和sf3、2版本的方式差不多。只是bundle在sf4中不在建议管理应用程序。 官方给的建议是临时创建一个bundle,我会试一下。 但是还有别的办法,在symfony issues中有人提出了别的办法数据结构-- ---...
2018-03-31 17:41:58
1647
原创 rabbitmq requeue
文章来源:https://blog.lqsos.com/archives/57.htmlcreatecredentials = pika.PlainCredentials(username='mq', password='654321')connection = pika.BlockingConnection( pika.ConnectionParameters(
2018-01-24 16:35:53
1816
1
转载 php获取sqlite数据表和结构信息
转自:https://blog.lqsos.com/archives/55.html#!/usr/bin/env phpif(PHP_VERSION_ID 70100){ echo "The version is too low";exit;}# data file path$data_file_path = __DIR__.'/../data/blog.sqlite';
2018-01-15 16:36:18
1036
转载 symfony4目录结构
转自:https://blog.lqsos.com/archives/56.htmlsymfony4目录结构- project - d bin 可执行文件目录 - d config 配置 - d public 入口文件 - d src 应用 - d templates 模板 - d
2018-01-15 16:34:56
2802
原创 kong插件之Request Transformer
来源:https://blog.lqsos.com/archives/35.html说明插件实现是根据客户端发送的请求头中的参数,通过请求头参数添加或替换参数内容; 插件执行顺序remove->rename->replace->add->append创建APIcurl -i -X POST \ --url http://localhost:8001/apis/ \ --data '
2017-12-22 10:52:16
6256
1
原创 kong插件之httplog
转载:https://blog.lqsos.com/archives/33.html创建APIcurl -i -X POST \ --url http://localhost:8001/apis/ \ --data 'name=example-api' \ --data 'uris=/user' \ --data 'upstream_url=https://www.b
2017-12-21 17:15:53
7934
1
转载 python生成sitemap格式文件
#!/usr/bin/python3# -*- coding: utf-8 -*-# author=Heimport xml.dom.minidomimport datetimefrom urllib import requestfrom bs4 import BeautifulSoup'''要执行的url'''URL = 'https://blog.lqsos.com''''所有url
2017-12-21 11:50:15
1395
原创 kong 删除oauth2生成的Token
来源:https://blog.lqsos.com/index.php/archives/31/创建APIcurl -i -X POST \ --url http://localhost:8001/apis/ \ --data 'name=example-api' \ --data 'uris=/user' \ --data 'upstream_url=http://
2017-12-20 16:22:16
4772
1
原创 kong插件之Rate Limiting
文章来源:http://blog.youkuaiyun.com/qq_26656329/article/details/78842005关于Response Rate Limiting插件说明插件实现是在每个代理upstream API之前添加header信息,以便正确的拒绝处理该请求; 插件启用的时候,响应时会告诉客户端可以请求多少次、有多少次请求可以用; 比如:X-RateLimi...
2017-12-19 14:04:51
3230
原创 rabbitmq lazy-queues测试
rabbitmq测试懒加载(延迟队列)先创建个测试队列,往里面放100w条消息import pikacredentials = pika.PlainCredentials(username='mq', password='654321')connection = pika.BlockingConnection( pika.ConnectionParameters(
2017-12-18 13:37:25
635
原创 php7.0 SessionUpdateTimestampHandlerInterface接口实现功能
这是一个抽象接口,是php7.0新增的,然而官方没有这个接口的说明。但是源码里面的确是有这个接口https://github.com/php/php-src/blob/PHP-7.0.25/ext/session/session.c#L2616-L2623SessionUpdateTimestampHandlerInterfacestatic const zend_function_entry
2017-12-06 18:18:00
904
转载 Ubuntu完整卸载postgresql
删除相关的安装sudo apt-get --purge remove postgresql\*删除配置及文相关件sudo rm -r /etc/postgresql/sudo rm -r /etc/postgresql-common/sudo rm -r /var/lib/postgresql/删除用户和所在组sudo userdel -r postgressudo groupdel
2017-11-17 15:51:38
23060
1
原创 修改php-fpm和nginx运行用户
(php)项目a是用test用户运行 nginx和php-fpm是www-data用户运行 (python)项目b是用test用户运行项目a通过php函数exec调用python脚本的接口造成了没有权限访问目录直接把项目b的权限切换为www-data可以执行,但是不便于开发,最好是把php、nginx、项目a、项目b都在一个用户、组下面。打个比方test是当前登录用户 修改nginx的运行角色
2017-11-15 15:15:47
12765
原创 kong api可视化管理工具konga安装使用教程
安装这个有些小坑,根据报错信息都可以解决。安装依赖# 我的是Deepin 15.4,其它版本系统自行搜索sudo apt-get install nodejs npm gulpsudo npm install -g bowersudo npm install -g sails安装kongagit clone https://github.com/pantsel/konga.gitcd
2017-11-06 11:47:51
15840
原创 kong api gateway 插件之acl
添加一个APIcurl -i -X POST \ --url http://localhost:8001/apis/ \ --data 'name=example-api' \ --data 'uris=/user' \ --data 'upstream_url=http://test.my'返回值{ "created_at":1509616750000
2017-11-03 10:38:41
3769
翻译 Python 标准
对于这些规范仁者见仁智者见智,我就有很多没遵守的,但是知道这些始终是好的。原文定义exit函数时别忘记传递self, type, value 和 traceback.# 缺少任何一个就会有TypeError: __exit__() takes 3 positional arguments but 4 were givenclass MyClass: def __enter__(self
2017-11-02 17:49:11
1514
原创 php 操作kong&oauth2.0插件
本页地址<?php/** * Created by PhpStorm. * User: he * Date: 17-10-31 * Time: 上午10:36 *//* * ==========================================================================================================
2017-10-31 10:39:17
2262
原创 PHP 请求kong返回no API found with those values
<?php $curl = curl_init('https://localhost:8443'); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,false); // 可以正常访问 curl_setopt($curl,CURL
2017-10-28 17:49:46
3912
1
原创 kong API gateway(五):upstreams&targets
# 官文 --- https://getkong.org/docs/0.11.x/admin-api/#add-upstream# 参数 --- name // 这是一个可以在某个upstream_url字段中引用的名称api。 slots // 可选的 负载均衡器算法中的key(10- 65536,默认为1000)。 orderlist
2017-10-20 17:01:04
2439
1
原创 kong API gateway(四):插件
# 参数 --- id //可选的 插件id name // 可选的 插件名称 api_id // 可选的 基于该api_id字段的列表中的过滤器 consumer_id // 可选的 size // 可选,默认为100 对要返回的对象数量的限制 offset // 可选的 用于分页的光标 offset是一个对象标识符
2017-10-20 15:27:47
2521
原创 kong API gateway(三):consumers
# 官文 --- https://getkong.org/docs/0.11.x/getting-started/adding-consumers/# 通过Dashboard添加 --- http://localhost:8080/#/consumers# 通过Linux的curl命令添加参数: username // 必填 consumers唯一值
2017-10-20 14:51:32
1248
原创 kong start [postgres error] could not retrieve current migrations: [postgres error] connection refus
kong 启动报错:Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:28: [postgres error] could not retrieve current migrations: [postgres error] connection refused Run with --v (verbose) or --vv (debug) for
2017-10-20 14:32:36
4725
原创 kong API gateway(二):添加API
# 可直接通过dashboard添加 --- http://localhost:8080/#/apis/add# 也可以通过Linux curl命令添加 --- curl -i -X POST \ --url http://localhost:8001/apis/ \ --data 'name=example-api' \ --da
2017-10-20 10:53:40
3429
原创 kong API gateway(一):安装
# 下载&安装# git https://github.com/Kong/kong --- wget https://bintray.com/kong/kong-community-edition-deb/download_file?file_path=dists/kong-community-edition-0.11.0.xenial.all.deb sudo apt-g
2017-10-20 10:50:55
2584
原创 Ubuntu安装consul和consul ui
安装consulsudo apt-get install consul检查安装consul versionConsul 0.6.4.devConsul Protocol: 3 (Understands back to: 1)运行consulconsul agent -dev加&后台运行访问http://localhost:8500/ui
2017-10-19 13:57:32
4784
原创 yaf使用入门
1.安装# 创建一个yaf文件夹mkdir ~/yaf# 切换到该文件夹cd ~/yaf# 下载yaf压缩包wget http://pecl.php.net/get/yaf-3.0.5.tgz# 解压压缩包tar -xf yaf-3.0.5.tgz# 切换到yaf文件夹cd yaf-3.0.5# 编译安装,参考:http://php.net/manual/zh/install.pecl.p
2017-10-12 15:02:51
1091
原创 python request请求rabbitmq http api抓取队列列表
import jsonimport requestsres = requests.get(url='http://localhost:15672/api/queues', auth=('test', '123456'))return json.loads(res.content.decode())
2017-09-11 09:45:44
3329
原创 rabbitmq queue_declare arguments参数注释
说明官方文档 在创建queue时可以指定很多参数,可以限制队列的大小、消息的死信时间、优先级等等。queue消息条数限制x-max-length 该参数是非负整数值 官方文档 限制加入queue中消息的条数。先进先出原则,超过10条后面的消息会顶替前面的消息。credentials = pika.PlainCredentials(username='mq', password='654321
2017-09-08 11:11:36
11280
原创 rabbitmq plugins rabbitmq_delayed_message_exchange消息队列延迟消息插件
RabbitMQ实现延迟消息传递的方法
2017-09-08 09:43:15
8392
4
原创 抓取rabbitmq的queues列表
查看详细步骤请移步2017/09/11更新 Python request get 更简单抓取#!/usr/bin/python3# -*- coding: utf-8 -*-# author=Heimport jsonimport subprocessfrom log import log_basefrom config import mqclass Queues: def __
2017-08-19 10:30:09
3244
原创 获取rabbitmq的exchange列表和queue列表
安装有rabbitmq_management(web管理插件)访问web首页(一般是localhost:15672)时在首页底部有个httpAPI链接。 该页面列出来了很多API接口 看一下其中的exchanges和queues 查看api是需要登录认证的 红色框框是延时队列有了API就可以抓取其中的数据 我是通过curl抓取的,下面是一个抓取exchanges列表的例子 抓取que
2017-08-19 10:28:27
9611
可视化管理工具konga
2018-05-10
elasticsearch-analysis-ik-6.2.1
2018-03-08
elasticsearch-6.1.1
2018-01-03
docker 挂载容器时报错
2016-07-11
VMware Workstation 与 Hyper-V 不兼容
2016-07-09
jquery局部刷新接收数据Smarty重新执行
2015-09-30
PHP一个方法根据传递值怎么执行多次?
2015-09-02
Ajax传值和PHP接收,请大神帮忙看下
2015-07-30
页面判断当前位置是那个菜单
2015-06-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人