#步骤(How to use it)
- 保存脚本到(Save script as ) redis_size.lua
- 注册脚本 (Load script)
redis-cli -h 192.168.1.1 -p 6371 script load "$(cat redis_size.lua)"
- 调用(Call it)
evalsha 78331e1d4741cad34084d357e19ce6dbca8e202e 0 test_key // 注意与上步返回的一致
var log4js = require('log4js'); | |
var fivebeans = require('fivebeans'); | |
var fetch = require('node-fetch'); | |
log4js.configure({ | |
appenders: [ | |
{ type: 'console', category: 'danmuConsole'}, | |
{ type: 'file', filename: 'monitor.log', category: 'danmuConsole'}, | |
{ type: 'file', filename: 'danmu.log', category: 'danmuFile' } |
{ | |
"vim.disableAnnoyingNeovimMessage": true, | |
"extensions.ignoreRecommendations": true, | |
"editor.renderWhitespace": "all", | |
"python.linting.pylintArgs": ["--errors-only"], | |
"terminal.integrated.shell.windows": "D:\\software\\git\\bin\\bash.exe", | |
"terminal.integrated.shellArgs.windows": ["--login", "-i"] | |
} |
#步骤(How to use it)
redis-cli -h 192.168.1.1 -p 6371 script load "$(cat redis_size.lua)"
evalsha 78331e1d4741cad34084d357e19ce6dbca8e202e 0 test_key // 注意与上步返回的一致
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.nio.channels.SelectionKey; | |
import java.nio.channels.Selector; | |
import java.nio.channels.ServerSocketChannel; | |
import java.util.Iterator; | |
import java.util.Set; | |
/** | |
* Created by weinanli on 13/07/2017. |
function UpdateQueryString(key, value, url) { | |
if (!url) url = window.location.href; | |
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"), | |
hash; | |
if (re.test(url)) { | |
if (typeof value !== 'undefined' && value !== null) | |
return url.replace(re, '$1' + key + "=" + value + '$2$3'); | |
else { | |
hash = url.split('#'); |
//wrong usage of socket.io broadcat | |
//错误的socket.io广播使用实例 | |
var app = require('express')() | |
var server = require('http').createServer(app); | |
var io = require('socket.io')(server); | |
var log4js = require('log4js'); | |
var redis = require('redis') | |
sudo apt-get install libtool | |
wget https://github.com/google/protobuf/archive/v2.6.1.zip | |
unzip v2.6.1.zip | |
cd protobuf-2.6.1 | |
sed -i 's/googletest.googlecode.com\/files\//pkgs.fedoraproject.org\/repo\/pkgs\/gtest\/gtest-1.5.0.tar.bz2\/8b2c3c3f26cb53e64a3109d03a97200a\//g' autogen.sh | |
./autogen.sh | |
./configure | |
make |
#!/bin/bash | |
############################################################ | |
# First, you must build the library files for the protobuf | |
# tool. In order to do this, follow the steps below in the | |
# source directory for protobuf. | |
# | |
# 1. ./autogen.sh | |
# 2. ./configure | |
# 3. make | |
# |
protobuf | |
protobuf-2.6.0 | |
protobuf-2.6.1 | |
protobuf-master |
#!/usr/bin/env python | |
""" | |
Real time log files watcher supporting log rotation. | |
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> | |
License: MIT | |
Link: http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/ | |
""" | |
""" |