Skip to content

Instantly share code, notes, and snippets.

@guoruibiao
guoruibiao / redis_key_sizes.sh
Created July 17, 2019 07:00 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@guoruibiao
guoruibiao / anchorlevel.json
Created November 3, 2018 08:32
multifiles for gist
{
"level": 25,
"title": "实力歌手5",
"nextlevelexp": 80000000,
"curlevelexp": 70000000,
"experience": 70001093
}
@guoruibiao
guoruibiao / config.json
Created November 3, 2018 08:24
this is the description of gist usage.
1. add hidden errors.
2. design daily upset for each error.