This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Usage: check `--help`. | |
| # | |
| # This script works by storing the diff base commit of each entry in file | |
| # (`.git/stacking`). The benefit of this is, each entry is isolated. You can | |
| # bypass the script and add/delete entries manually without breaking others. | |
| # But, this also means you cannot modify commits before the entry diff (such as | |
| # `git rebase`). That would invalidate the base commit stored in file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # magic-wormhole in disguise | |
| # | |
| # Example usage: | |
| # | |
| # $ curl -sf <url>/eloh.sh | bash -s -- x | |
| # -rwxr-xr-x@ 1 user staff 1952 Apr 17 22:51 x | |
| # -rwxr-xr-x@ 1 user staff 1952 Apr 17 22:51 57-disbelief-exceed.txt | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::{ | |
| collections::{BTreeMap, HashMap, HashSet}, | |
| error::Error as StdError, | |
| future::Future, | |
| ops::Bound::{Included, Unbounded}, | |
| pin::Pin, | |
| sync::Arc, | |
| task::{Context, Poll}, | |
| time::{Duration, Instant}, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ## basic spec report | |
| function _io_test() | |
| { | |
| local rw="${1}" | |
| local bs="${2}" | |
| local sec="${3}" | |
| local jobs="${4}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export CACHE_SIZE=$((8*1024*1024*1024)) | |
| export FILE_SIZE=$((8*1024*1024)) | |
| export NUM_DBS=20 | |
| export NUM_KEYS=2000000 # ~2GB each DB | |
| # export EXTRAS=--db_write_buffer_size=134217728 # 1/10 of write_buffer_size(64M)*num_dbs | |
| export SUFFIX=vanilla | |
| ./db_bench --db=$(pwd)/dbbench --num=${NUM_KEYS} --num_multi_db=${NUM_DBS} --cache_size=${CACHE_SIZE} --key_size=20 --value_size=400 --max_background_jobs=8 --cache_index_and_filter_blocks=true --level_compaction_dynamic_level_bytes=true --target_file_size_base=${FILE_SIZE} --compression_type=lz4 --seed=777 --benchmarks=fillrandom --use_existing_db=0 --sync=0 --threads=${NUM_DBS} --allow_concurrent_memtable_write=false --disable_wal=1 ${EXTRAS} > load.${SUFFIX}.log | |
| du -d1 -h $(pwd)/dbbench >> load.${SUFFIX}.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| if test $# -ne 1; then | |
| echo "Usage: `basename $0 .sh` <process-id>" 1>&2 | |
| exit 1 | |
| fi | |
| if test ! -r /proc/$1; then | |
| echo "Process $1 not found." 1>&2 | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [2021/12/03 10:58:15.059 +08:00] [Info] [raft.rs:1200] ["became leader at term 7"] [term=7] [raft_id=97957681] [region_id=97957472] | |
| [2021/12/03 10:58:15.059 +08:00] [Info] [peer.rs:3771] ["require updating max ts"] [initial_status=30064791044] [region_id=97957472] | |
| [2021/12/03 10:58:15.059 +08:00] [Info] [pd.rs:1271] ["succeed to update max timestamp"] [region_id=97957472] | |
| [2021/12/03 10:58:15.059 +08:00] [Info] [pd.rs:1108] ["try to change peer"] [kind=EnterJoint] [changes="[peer { id: 97957752 store_id: 80511561 }, peer { id: 97957473 store_id: 80511562 role: Learner } change_type: AddLearnerNode]"] [region_id=97957472] | |
| [2021/12/03 10:58:15.062 +08:00] [Info] [pd.rs:1108] ["try to change peer"] [kind=EnterJoint] [changes="[peer { id: 97957752 store_id: 80511561 }, peer { id: 97957473 store_id: 80511562 role: Learner } change_type: AddLearnerNode]"] [region_id=97957472] | |
| [2021/12/03 10:58:15.062 +08:00] [Info] [pd.rs:1108] ["try to change peer"] [kind=EnterJoint] [changes="[peer { id: 97957752 store_id: 805115 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| USER_NAME=root | |
| CLUSTER_NAME="tidb-test" | |
| NODES_ADDR=("172.16.6.211" "172.16.6.213" "172.16.6.159" "172.16.4.203" "172.16.5.213") | |
| TIKV_PORT=20160 | |
| CLUSTER_STATE="r" | |
| NODES_STATE=( "r" "r" "r" "r" "r" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Usage: killer.sh 1s "./do_some_job --some_args" | |
| INTERVAL=$1 | |
| COMMAND=$2 | |
| i=1 | |
| while : ; do | |
| echo "$((i++)) run" | |
| nohup $COMMAND > killee.log 2>&1 & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // nix = "0.18.0" | |
| use nix::{ | |
| errno::Errno, | |
| fcntl::{self, OFlag}, | |
| sys::{stat::Mode, uio::pwrite}, | |
| unistd::{close, fsync}, | |
| }; | |
| use std::{ | |
| alloc::{self, Layout}, | |
| mem, |
NewerOlder