$ uname -r
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add
deb http://apt.kubernetes.io/ kubernetes-xenial main
This file contains 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 | |
docker run --name CasDC1SeedOne \ | |
-e WEAVE_CIDR=10.10.10.5/16 \ | |
-e CASSANDRA_CLUSTER_NAME=CPUT \ | |
-e CASSANDRA_DC=DC1 \ | |
-e CASSANDRA_RACK=RC1 \ | |
-e CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch \ | |
-v /data/cassandra/node1:/var/lib/cassandra \ | |
-e CASSANDRA_SEEDS=10.10.10.5,10.10.10.15 \ |
This file contains 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
This file contains 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
-XX:MaxPermSize=384M | |
-Dhttps.proxyHost=10.18.8.9 | |
-Dhttps.proxyPort=3128 | |
-Dhttps.proxyUser=user | |
-Dhttps.proxyPassword=pass | |
-Dhttp.proxyHost=10.18.8.9 | |
-Dhttp.proxyPort=3128 | |
-Dhttp.proxyUser=user | |
-Dhttp.proxyPassword=passwd |
This file contains 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
docker build -t bonifacekabaso/cassandrad:2.2.6 \ | |
--build-arg http_proxy="http://[USER]:[PASSWD]@[IP]:[PORT]" \ | |
--build-arg https_proxy="http://[USER]:[PASSWD]@[IP]:[PORT]" \ | |
. |
This file contains 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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.oldsite.com', 'http://www.newsite.com'); |
This file contains 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
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux | |
# Log in as root | |
# Mount ramdisk folder in RAM | |
mkdir /tmp/ramdisk | |
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/ | |
# Move MySQL data | |
mv /var/lib/mysql /tmp/ramdisk/mysql | |
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql |