Skip to content

Instantly share code, notes, and snippets.

View aburan28's full-sized avatar

Adam Buran aburan28

  • San Francisco Bay Area
View GitHub Profile
zookeeper.ssl.keyStore.location="/path/to/your/keystore"
zookeeper.ssl.keyStore.password="keystore_password"
zookeeper.ssl.trustStore.location="/path/to/your/truststore"
zookeeper.ssl.trustStore.password="truststore_password"
zookeeper.client.secure=true
zookeeper.clientCnxnSocket="org.apache.zookeeper.ClientCnxnSocketNetty"
zookeeper.serverCnxnFactory="org.apache.zookeeper.server.NettyServerCnxnFactory"
secureClientPort=2281
/proc/sys/net/ipv4/* Variables:
ip_forward - BOOLEAN
0 - disabled (default)
not 0 - enabled
Forward Packets between interfaces.
This variable is special, its change resets all configuration
parameters to their default state (RFC1122 for hosts, RFC1812
- name: create zookeeper user
user: name=zookeeper uid=1000 gid=1000 shell=/sbin/nologin
- name: create zookeeper directories
file: state=directory path={{item}} user=zookeeper group=zookeeper
with_items:
- /var/run/zookeeper
- /var/lib/zookeeper
../configure --enable-libevent --enable-ssl
SSL_ENABLED=1 SSL_KEY_FILE=key SSL_CERT_FILE=cert opt-flags binary
SSL_ENABLED=1 SSL_KEY_FILE=key SSL_CERT_FILE=cert SSL_REQUIRE_CERT=1 SSL_ENABLE_TLS_V1_1=true master.sh
SSL_ENABLED=1 SSL_SUPPORT_DOWNGRADE=1 SSL_KEY_FILE=key SSL_CERT_FILE=cert opt-flags binary
SSL_ENABLED=true SSL_SUPPORT_DOWNGRADE=false SSL_KEY_FILE=key SSL_CERT_FILE=cert opt-flags binary
@aburan28
aburan28 / sysctl.conf
Created May 29, 2017 11:02
optimized sysctl.conf
ARCH=$(uname -m)
which bc
if [ $? -ne 0 ]; then
echo "This script require GNU bc, cf. http://www.gnu.org/software/bc/"
echo "On Linux Debian/Ubuntu you can install it by doing : apt-get install bc"
fi
echo "Update sysctl for $host"
@aburan28
aburan28 / sync_brick.sh
Created May 10, 2017 09:03 — forked from alanorth/sync_brick.sh
Parallel rsync script for copying failed GlusterFS bricks (self-heal daemon is too slow!)
#!/bin/env bash
# borrowed / adapted from: https://wiki.ncsa.illinois.edu/display/~wglick/Parallel+Rsync
# RSYNC SETUP
RSYNC_PROG=/usr/bin/rsync
# note the important use of --relative to use relative paths so we don't have to specify the exact path on dest
RSYNC_OPTS="-aAXv --numeric-ids --progress --human-readable --delete --exclude=.glusterfs --relative"
export RSYNC_RSH="ssh -T -c arcfour -o Compression=no -x"
# ENV SETUP
docker-compose build
# ...or just build one piece of it
docker-compose build [app|db|etc]
# Start your Docker Compose project
docker-compose up -d
# View the logs for this docker-compose proejct
docker-compose logs
# Stop running containers
docker-compose stop
# remove stopped containers
void iter_threads(int start, int end, void (*func)(int n))
{
int n = start;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void *thread_body(void *ptr)
{
double start = now();
for (;;) {
pthread_mutex_lock( &mutex );
int rdseed16_step (uint16_t *seed)
{
unsigned char ok;
asm volatile ("rdseed %0; setc %1"
: "=r" (*seed), "=qm" (ok));
return (int) ok;
}
curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.5.1/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/