Paw 设置Header动态请求值

实际开发中, 通常一个API会依赖另一个API的返回值, 比如 Authorization Header, 通常有一个 get access token API
paw 里可以在方便设置 值为另一个API的返回结果

paw 里设置 值为 Response -> Response Parsed Body

可以设置具体json 的key path

请求的时候同时请求依赖request

2019/1/3 posted in  DevOps

GraphQL Rails 笔记 一

2018/12/3 posted in  Rails

使用 sameersbn/docker-gitlab 部署gitlab

https://github.com/sameersbn/docker-gitlab#installation

使用compose

wget https://raw.githubusercontent.com/sameersbn/docker-gitlab/master/docker-compose.yml

aliyun smtp 服务配置

    - SMTP_ENABLED=true
    - SMTP_DOMAIN=smtpdm.aliyun.com
    - SMTP_HOST=smtpdm.aliyun.com
    - SMTP_PORT=80
    - SMTP_USER=master@xxx.com
    - SMTP_PASS=passworld
    - SMTP_STARTTLS=false
    - SMTP_AUTHENTICATION=login

备份

  • GITLAB_BACKUP_SCHEDULE = daily
  • GITLAB_BACKUP_ARCHIVE_PERMISSIONS = 0644
  • GITLAB_BACKUP_DIR = /home/git/data/backups
  • GITLAB_BACKUP_TIME=04:00
2018/10/13

gitlab docker 部署记

https://stackoverflow.com/questions/44056807/gitlab-docker-smtp
https://developer.ibm.com/code/2017/07/13/step-step-guide-running-gitlab-ce-docker/
https://docs.gitlab.com/omnibus/docker/
https://hub.docker.com/r/gitlab/gitlab-ce/

#!/bin/bash

sudo docker run --detach \
      --hostname 192.168.88.244 \
      --publish 80:80 --publish 10022:22 \
      --env "GITLAB_SHELL_SSH_PORT=10022" \
      --name gitlab \
      --restart always \
      --volume /srv/gitlab/config:/etc/gitlab \
      --volume /srv/gitlab/logs:/var/log/gitlab \
      --volume /srv/gitlab/data:/var/opt/gitlab \
      gitlab/gitlab-ce:latest
   
2018/10/9 posted in  DevOps

树莓派 x86 系统安装记

2018/10/6

lede软路由安装

下载地址

http://firmware.koolshare.cn/LEDE_X64_fw867/

mac或者linux直接用dd写入磁盘就行

sudo dd if=./openwrt-koolshare-mod-v2.23-r8972-e25927a06f-x86-64-uefi-gpt-squashfs.img.gz  of=/dev/disk2 bs=1m
2018/10/6

chef-solo knife 使用 tips

  • 初始化项目 knife solo init .
  • 生成cookbook模板chef generate cookbook helloworld
  • 在服务器上执行 knife solo cook lidashuang@10.211.55.6
  • code stype 检查 foodcritic ./site-cookbooks/helloworld/
2018/9/27 posted in  DevOps

2-6 通过explain查询和分析SQL的执行计划

https://www.imooc.com/video/3710

explain 分析执行计划

说明

关于 type 为 index_merge

之前项目一个sql示例

mysql> mysql> explain SELECT COUNT(id) FROM `orders`  WHERE `orders`.`types` = 2 AND `orders`.`status` = 2 AND  `orders`.`pay_type` IN (1, 2);
+----+-------------+--------+------------+-------------+-----------------------------------------------------------------------+----------------------------------------------+---------+------+-------+----------+----------------------------------------------------------------------------+
| id | select_type | table  | partitions | type        | possible_keys                                                         | key                                          | key_len | ref  | rows  | filtered | Extra                                                                      |
+----+-------------+--------+------------+-------------+-----------------------------------------------------------------------+----------------------------------------------+---------+------+-------+----------+----------------------------------------------------------------------------+
|  1 | SIMPLE      | orders | NULL       | index_merge | index_orders_on_types,index_orders_on_status,index_orders_on_pay_type | index_orders_on_types,index_orders_on_status | 5,5     | NULL | 97112 |    14.71 | Using intersect(index_orders_on_types,index_orders_on_status); Using where |
+----+-------------+--------+------------+-------------+-----------------------------------------------------------------------+----------------------------------------------+---------+------+-------+----------+----------------------------------------------------------------------------+

type 为 index_merge

对多个索引分别进行条件扫描,然后将它们各自的结果进行合并(intersect/union)。

links

2018/9/26

3-2 索引优化SQL的方法 笔记

https://www.imooc.com/video/3998

工具

pt-duplicate-key-checke Percona Toolkit 的一部分

sudo apt-get install percona-toolkit

pt-duplicate-key-checke 使用方法简单

$ pt-duplicate-key-checker -h  host -u root -p  password ########################################################################
# shiji_development.daily_shop_statistics
# ########################################################################

# index_daily_shop_statistics_on_date_id is a left-prefix of index_daily_shop_statistics_on_date_id_and_shop_id
# Key definitions:
#   KEY `index_daily_shop_statistics_on_date_id` (`date_id`),
#   UNIQUE KEY `index_daily_shop_statistics_on_date_id_and_shop_id` (`date_id`,`shop_id`),
# Column types:
#     `date_id` int(11) not null
#     `shop_id` int(11) not null
# To remove this duplicate index, execute:
ALTER TABLE `shiji_development`.`daily_shop_statistics` DROP INDEX `index_daily_shop_statistics_on_date_id`;

# ########################################################################
# shiji_migrate_test.daily_shop_statistics
# ########################################################################

# index_daily_shop_statistics_on_date_id is a left-prefix of index_daily_shop_statistics_on_date_id_and_shop_id
# Key definitions:
#   KEY `index_daily_shop_statistics_on_date_id` (`date_id`),
#   UNIQUE KEY `index_daily_shop_statistics_on_date_id_and_shop_id` (`date_id`,`shop_id`),
# Column types:
#     `date_id` int(11) not null
#     `shop_id` int(11) not null
# To remove this duplicate index, execute:
ALTER TABLE `shiji_migrate_test`.`daily_shop_statistics` DROP INDEX `index_daily_shop_statistics_on_date_id`;

# ########################################################################
# Summary of indexes
# ########################################################################

# Size Duplicate Indexes   65360
# Total Duplicate Indexes  2
# Total Indexes            478

查询表的索引状态 SHOW INDEX FROM orders;

Cardinality 表示离散度

links

2018/9/26 posted in  MySQL

HOW TO BUILD A HOME CLIMBING WALL

原文
https://www.rei.com/blog/climb/build-home-climbing-wall

抱石墙的构造方式与木框架房屋的构造方式大致相同:

2018/9/26