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
Verifying my Blockstack ID is secured with the address 16nkM86wpv7W3BKgTA5qfQQtGEdZECNVgr https://explorer.blockstack.org/address/16nkM86wpv7W3BKgTA5qfQQtGEdZECNVgr |
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
0x8616e6270e14ff16dbbf1ea0a46ea3dc0d84ce1d |
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 | |
#./rmServices.sh redis-cluster-m- | |
readonly FILTER=${1:-"redis-cluster-m-"} | |
docker service ls | grep "$FILTER" | awk '{print $1}' | xargs docker service rm | |
exit 0 |
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 | |
#./forEach.sh 7001 5 redis-cluster-m- CLUSTER INFO | |
readonly STARTING_PORT=$1 | |
readonly NUM_MASTERS=$2 | |
readonly NAME_PREFIX=$3 | |
readonly REDIS_CMD=("${@:4}") | |
readonly LOCAL_CONTAINER_ID=$(docker ps -f name="$NAME_PREFIX" -q | head -n 1) | |
readonly LOCAL_PORT=$(docker inspect --format='{{index .Config.Labels "com.docker.swarm.service.name"}}' "$LOCAL_CONTAINER_ID" | sed 's|.*-||') | |
for ((port = STARTING_PORT, endPort = port + NUM_MASTERS; port < endPort; port++)) do | |
host=$([ "$LOCAL_PORT" == $port ] && echo "127.0.0.1" || echo "$NAME_PREFIX$port") |
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 | |
#./assignSlots.sh 7001 5 redis-cluster-m- | |
readonly STARTING_PORT=${1:-0} | |
readonly NUM_MASTERS=${2:-0} | |
readonly NAME_PREFIX=${3:-"redis-cluster-m-"} | |
readonly MAX_SLOT=$((16383)) | |
readonly SLOT_RANGE=$(((MAX_SLOT + NUM_MASTERS - 1) / NUM_MASTERS)) | |
readonly LOCAL_CONTAINER_ID=$(docker ps -f name="$NAME_PREFIX" -q | head -n 1) | |
readonly LOCAL_PORT=$(docker inspect --format='{{index .Config.Labels "com.docker.swarm.service.name"}}' "$LOCAL_CONTAINER_ID" | sed 's|.*-||') | |
for ((port = STARTING_PORT, endPort = STARTING_PORT + NUM_MASTERS, slot = 0; port < endPort; port++)) do |
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 | |
#./meetNodes.sh 7001 5 redis-cluster-m- | |
readonly STARTING_PORT=${1:-0} | |
readonly NUM_MASTERS=${2:-0} | |
readonly NAME_PREFIX=${3:-"redis-cluster-m-"} | |
readonly LOCAL_CONTAINER_ID=$(docker ps -f name="$NAME_PREFIX" -q | head -n 1) | |
readonly LOCAL_PORT=$(docker inspect --format='{{index .Config.Labels "com.docker.swarm.service.name"}}' "$LOCAL_CONTAINER_ID" | sed 's|.*-||') | |
# From local service task, meet all other nodes | |
for ((port = STARTING_PORT, endPort = STARTING_PORT + NUM_MASTERS; port < endPort; port++)) do | |
if [ "$LOCAL_PORT" == $port ]; then |
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 | |
#./createMasters.sh 7001 5 redis-cluster-m- comodal/alpine-redis | |
readonly STARTING_PORT=${1:-0} | |
readonly NUM_MASTERS=${2:-0} | |
readonly NAME_PREFIX=${3:-"redis-cluster-m-"} | |
readonly IMAGE=${4:-"comodal/alpine-redis"} | |
for ((port = STARTING_PORT, endPort = port + NUM_MASTERS; port < endPort; port++)) do | |
name="$NAME_PREFIX$port" | |
docker service create\ | |
--name "$name"\ |
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
import javax.servlet.http.HttpServletRequest; | |
public class RequestUtil { | |
public static String getRequestIp(final HttpServletRequest request) { | |
String ip = request.getHeader("X-Forwarded-For"); | |
if (ip == null) { | |
return request.getRemoteAddr(); | |
} | |
ip = ip.trim(); |
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
package systems.comodal.collision.cache; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.VarHandle; | |
import java.util.concurrent.ThreadLocalRandom; | |
/** | |
* Provides atomic operations for 8-bit logarithmic counters backed by a byte array. | |
* | |
* @author James P. Edwards |
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
import java.util.PrimitiveIterator; | |
import static java.lang.Character.digit; | |
public final class Hex { | |
private Hex() {} | |
private static final char[] HEX_CHARS = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', | |
'9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
NewerOlder