Skip to content

Instantly share code, notes, and snippets.

路费
杭州 - 吉隆坡 往返 3000左右
吉隆坡 - 斗湖 往返 600 左右
马步岛上度假村的住宿费用 (dorm是8张床的,VIP A/C有独立卫生间和私有阳台,Ensuite & Deluxe A/C rooms适合情侣或者3口之家) ,是通过太阳能供热水,天气不好可能没热水,很少
包3餐和下午茶,旺季需要每个人一晚加25马币
Mabul Beach Resort Rates 2017
# tar xvf prometheus-1.6.3.linux-amd64.tar
# cd prometheus-1.6.3.linux-amd64
prometheus表达式使用
获取特定名字的job的http请求数目
http_requests_total{job=~"server$"}
# tar xvf prometheus-1.6.3.linux-amd64.tar
# cd prometheus-1.6.3.linux-amd64
prometheus表达式使用
获取特定名字的job的http请求数目
http_requests_total{job=~"server$"}
grafana模板化
SELECT mean("value") FROM "Momysql_value" WHERE "host" = 'mysqltest' AND "type_instance" = 'bytes_received' AND $timeFilter GROUP BY time($__interval) fill(null)
SELECT mean("value") FROM "Momysql_value" WHERE "host" =~ /^$host$/ AND "type_instance" = 'bytes_received' $timeFilter GROUP BY time($__interval), "host"
@justlooks
justlooks / gist:7a27d3649e41f086ced497aadc1c88d6
Created April 19, 2017 01:55
swarm can not use private registry to create service
i have a 3-node swarm cluster
[root@test_centos7 ~]# docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
i1nt717a0o2g3f1worstjpgpa test_node1 Ready Active
lu9tdaawog8f5tao7bxp372iz * test_centos7.2 Ready Active Leader
rsa7ql94xnrd4hxasxd28y5bx test_node2 Ready Active
and i create a service of my private registry,push local image to my private registry
docker service create --name registry --publish 5000:5000 registry:2
[root@crm_online1 cron.daily]# ls -l /data/mysql/crm_online1-slow.log*
-rw-rw---- 1 mysql mysql 40221798 Jan 7 11:37 /data/mysql/crm_online1-slow.log
-rw-rw---- 1 mysql mysql 14497383 Jan 5 23:52 /data/mysql/crm_online1-slow.log-20160103.gz
-rw-rw---- 1 mysql mysql 111364925 Jan 6 23:52 /data/mysql/crm_online1-slow.log-20160104.gz
-rw-rw---- 1 mysql mysql 65968198 Jan 7 11:10 /data/mysql/crm_online1-slow.log-20160105.gz
-rw-rw---- 1 mysql mysql 179031868 Jan 7 11:10 /data/mysql/crm_online1-slow.log-20160106
@justlooks
justlooks / gist:481e6dd0d2b746c65278
Created March 11, 2015 05:36
can not transfer varchar column to enum column use insert T2 select case.....end from T1
i have two table ,one store old data,another table is new ,old column ordertype data need to move to new table
the old table ordertype use varchar,but the new one use enum type, i get error when i use insert select case when ....
is it a bug?
create table alex1(ordertype varchar(20),itemid int,itemname varchar(20));
insert into alex1 values('online',null,'http://xxxxxx');
insert into alex1 values('back',10,'xxxxxx');
insert into alex1 values('miaofenqi',20,'kkkkk');
create table alex2 (ordertype enum('qw','fqw','mfq'));
MariaDB [test]> create procedure demo()
-> BEGIN
-> DECLARE TARGETID INT ;
-> DECLARE QDTIME DATETIME ;
-> DECLARE done INT DEFAULT FALSE ;
-> DECLARE CUR1 CURSOR FOR SELECT id,qdtime FROM axd_user WHERE authstatus=6;
-> DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
-> OPEN CUR1;
-> judge_loop: LOOP
-> FETCH CUR1 INTO TARGETID, QDTIME;
how can i judge if the transaction is killed after 10 seconds?
MariaDB [test]> show variables like 'innodb_kill%';
+------------------------------+-------+
| Variable_name | Value |
+------------------------------+-------+
| innodb_kill_idle_transaction | 5 |
+------------------------------+-------+
1 row in set (0.00 sec)
#!/bin/bash
echo $@
shift
echo $@