Skip to content

Instantly share code, notes, and snippets.

View mk-qi's full-sized avatar
💭
I may be slow to respond.

mkqi mk-qi

💭
I may be slow to respond.
View GitHub Profile
@mk-qi
mk-qi / History|-17ae3888|entries.json
Last active June 27, 2022 13:10
my vscode settings for settings sync
{"version":1,"resource":"file:///Users/mark/codes/gin_vue/sr-cloud-actions/config/config.yaml","entries":[{"id":"MV2x.yaml","timestamp":1649683354848},{"id":"TK0M.yaml","timestamp":1649684856268},{"id":"SCxJ.yaml","timestamp":1649686153318},{"id":"1c2k.yaml","timestamp":1649686614844},{"id":"cvB3.yaml","timestamp":1649686654427},{"id":"bLW3.yaml","timestamp":1649768499126},{"id":"sa0X.yaml","timestamp":1649768750563},{"id":"QlfS.yaml","timestamp":1649768937791},{"id":"hPNh.yaml","timestamp":1649768961137},{"id":"5JMu.yaml","source":"undoRedo.source","timestamp":1649768965686},{"id":"TKHe.yaml","timestamp":1649768969062},{"id":"LSqt.yaml","timestamp":1649768993186},{"id":"cDi0.yaml","source":"undoRedo.source","timestamp":1649769002794},{"id":"tfXq.yaml","timestamp":1649769197620}]}
@mk-qi
mk-qi / deployment-tool-ansible-puppet-chef-salt.md
Created May 16, 2017 09:48 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@mk-qi
mk-qi / redis_json_marshal_eval_benchmarks.rb
Created March 14, 2016 14:31 — forked from shilov/redis_json_marshal_eval_benchmarks.rb
Ruby Redis benchmarks for JSON vs Marshal vs String
# http://forrst.com/posts/JSON_vs_Marshal_vs_eval_Which_is_the_fastest_fo-6Qy
require 'benchmark'
require 'json'
require 'redis'
# -----------------
puts "Initialize variables.."
@mk-qi
mk-qi / download-progress.rb
Created January 12, 2016 14:19 — forked from Burgestrand/download-progress.rb
Ruby HTTP file download with progress measurement
require 'net/http'
require 'uri'
def download(url)
Thread.new do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response|
@mk-qi
mk-qi / gist:e0d8d5e769c846a97bec
Created October 28, 2015 02:42 — forked from hiroaki/gist:ad55b38be8701f25eb93
Real-time monitor (Server-Sent Events)
#!/usr/bin/env ruby
require 'sinatra/base'
SECONDS_INTERVAL = 1.0
URL_STREAM = '/stream'
NAME_EVENT = 'ldavg'
NUMBER_MAX_PLOT = 180
SEPARATOR_OF_DATA = ' '
DESCRIPTION
logstat.pl and logtop.pl
These scripts show current and average request-per-second counts based on
apache access logs in real-time.
You can see the total requests-per-second as well as a breakdown by:
* vhost
* URL
@mk-qi
mk-qi / ocp.php
Last active August 29, 2015 14:22 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@mk-qi
mk-qi / http.init
Created January 14, 2014 02:19
http.init
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#!/usr/bin/env ruby
require 'rubygems'
require 'redis'
require 'terminal-table'
host = "192.168.2.164"
ports = [6381]
def entries(slowlog)
@mk-qi
mk-qi / perlmysql_with_query_timeout.pl
Last active December 27, 2015 08:49
带有query timeout 版的perl 连接mysql,直接改GLOBLE CONFIG 部份,MYSQL 若返回成功,代码返回0 .否则返回1
#!/usr/bin/perl
#
use DBI;
use strict;
use warnings;
use Socket;
use Time::HiRes;
use DateTime;
#require 'sys/ioctl.ph'; # ioctl($socket)(Linux)