CLUSTER INFO
打印集群的信息
CLUSTER NODES
列出集群当前已知的所有节点(node),以及这些节点的相关信息。
#!/bin/bash | |
lines=$(sudo ss -lp | grep $1 | awk '{print $3}' | cut -d: -f2 | sort | wc -l) | |
if [ "$1" == "mongod" ] | |
then | |
portarray=(`sudo ss -lp | grep $1 | awk '{print $3}' | cut -d: -f2 | sort | head -n $(($lines/2)) 2>/dev/null`) | |
else | |
portarray=(`sudo ss -lp | grep $1 | awk '{print $3}' | cut -d: -f2 | sort 2>/dev/null`) | |
fi |
#!/bin/bash | |
# Checkresults are returned as text or integer. | |
# The script expects one parameter: The check you want to perform . | |
# The second paramter, the value you want to grep, is optional. | |
# The third parameter, the adapter number, is optional. If adapter number is missing, ALL is set. | |
# Thanks to https://twiki.cern.ch/twiki/bin/view/FIOgroup/DiskRefPerc | |
# for the nice overview | |
# LSI Logic / Symbios Logic MegaRAID SAS 2208 |
ActiveRecord::ConnectionAdapters::PostgreSQLColumn.class_eval do | |
prepend Module.new { | |
def mpq? | |
type == :mpq | |
end | |
def simplified_type(field_type) | |
field_type == 'mpq' ? :mpq : super | |
end |
openssl s_client -connect github.com:443 -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sed -ne '1,/-END CERTIFICATE-/p' > /tmp/github.com.pem | |
openssl x509 -in /tmp/github.com.pem -sha1 -noout -fingerprint |
#!/usr/bin/tclsh8.5 | |
# | |
# Usage: git-unmerged branch1 branch2 | |
# | |
# Shows all the non-common commits in the two branches, where non-common | |
# commits means simply commits with a unique commit *message*. | |
proc getlog branch { | |
lrange [split [exec git log $branch --oneline] "\n"] 0 400 | |
} |
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Enable at only Preview</name> | |
<item> | |
<name>Use J and K to Up and Down</name> | |
<identifier>remap.app_preview_jk2UpDown</identifier> | |
<only>PREVIEW</only> | |
<autogen>--KeyToKey-- KeyCode::J, KeyCode::CURSOR_DOWN</autogen> | |
<autogen>--KeyToKey-- KeyCode::K, KeyCode::CURSOR_UP</autogen> |
#对non-lock queue的简单分析#
今天看到 @梁斌penny 在打擂:http://coderpk.com
内容如下:
游戏规则: 比赛由pennyliang,就是本人梁斌同志坐庄,我提交baseline代码(可执行程序),和部分代码,方便统一游戏规则。 10亿数据(每个数据看作一个同志),1个队列,10个线程push,10个线程pop,走完一遍,考察总耗时,耗时最短的获胜。我的代码在我自己机器10亿数据排队进出,耗时1分28秒,内存峰值256MB(CPU16核,真8核那种,Intel(R) Xeon(R) CPU E5540 @ 2.53GHz)
-- | |
-- Setup - Add plpgsql, create a parent table, create an initial child table, | |
-- create the trigger and the initial trigger function. | |
-- | |
-- We'll need plpgsql, so create it in your db if it's not already available. | |
CREATE LANGUAGE plpgsql; | |
-- Create a table to act as parent with the appropriate columns for your data. | |
CREATE TABLE my_schema.my_data (name varchar(24), create_date timestamp); |