Docker Dev

December 2, 2019

commons installs RUN export DEBIAN_FRONTEND=noninteractive && \ apt update && apt install -y --no-install-recommends \ sudo curl iputils-ping gcc make build-essential git vim openssh-client ca-certificates wget curl sudo gnupg vim iputils-ping && \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false RUN mkdir -p /root/.ssh && \ ssh-keygen -A && \ chmod 0700 /root/.ssh && \ ssh-keyscan github.com > /root/.ssh/known_hosts chmod 600 /root/.ssh/id_rsa RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers RUN groupadd --gid 999 docker && \ useradd -u 1000 -g users -G sudo,docker dev

Init_mac

May 26, 2018

REMIDNER copy your previous terminal history Set up byronz.github.com ssh-keygen -t rsa -b 4096 -C "byron.zhu.xq@gmail.com" cat ~/.ssh/id_rsa.pub | pbcopy add ssh key in github git clone git@github.com:byronz/blog.git if you have public, need to readd as submodule git rm -f public git submodule add -b master git@github.com:byronz/byronz.github.io.git public cd themes git submodule add -b master git@github.com:mgjohansen/hucore.git hucore install hugo brew install hugo https://gohugo.io/hosting-and-deployment/hosting-on-github/ Python brew install python3 cd /tmp && curl https://bootstrap. ... Read more

Tech Tips

April 20, 2018

Mongo console pretty echo DBQuery.prototype._prettyShell = true >> ~/.mongorc.js

Riak

February 22, 2018

Riak KV Note: I think the official documentation quality is very poor, a lot of links are 404 and not updated Query option Riak search via Apache Solr Secondary Index Map Reduce Riak TS CREATE TABLE GeoCheckin ( region VARCHAR NOT NULL, - state VARCHAR NOT NULL, | time TIMESTAMP NOT NULL, | --> Column Definitions weather VARCHAR NOT NULL, | temperature DOUBLE, _ PRIMARY KEY ( (region, state, QUANTUM(time, 15, 'm')), <-- Partition Key => group data that will be queried together in the same physical part of the cluster region, state, time <-- Local Key => ) ) Note: Only one quantum function may be specified and it must be the last element of the partition key. ... Read more

Mongo

February 22, 2018

Replication Set A replica set in MongoDB is a group of mongod processes that maintain the same data set A replica set can have only one primary capable of confirming writes with { w: “majority” } write concern election new leader takes about 10-30s before, after v3.2 ~2s Shared Cluster https://docs.mongodb.com/manual/tutorial/deploy-shard-cluster/ shard: Each shard contains a subset of the sharded data. Each shard can be deployed as a replica set. ... Read more

Cassandra

February 21, 2018

Data Model Map<RowKey, SortedMap<ColumnKey, ColumnValue>> CREATE KEYSPACE sports WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'datacenter1' : 2}; # you can tune the r/w consistency level with keyspace Availability versus Consistency CREATE TABLE crossfit_gyms_by_city ( country_code text, state_province text, city text, gym_name text, opening_date timestamp, PRIMARY KEY ((country_code, state_province, city), opening_date, gym_name) ) WITH CLUSTERING ORDER BY ( opening_data ASC, gym_name ASC ); Cassandra RDBMS Keyspace Database Column Family Table Partition Key Primary Key Partitioner A partitioner determines how data is distributed across the nodes in the cluster (including replicas). ... Read more

Bai XianYong

February 19, 2018

遊園驚夢 白先勇 錢夫人到達臺北近郊天母竇公館的時候,竇公館門前兩旁的汽車已經排滿了,大多是官家的黑色小轎車,錢夫人坐的計程車開到門口她便命令司 ... Read more

Mac Unicode

February 15, 2018

Switch to Unicode Hex Input and Type ⌥ +{unicode val} Tab U+21E5 ⇥ Option U+2325 ⌥ Command U+2318 ⌘ Control U+2303 ⌃ Shift U+21E7 ⇧ Clear U+2327 ⌧ Escape U+238B ⎋

NOSQL DB

February 9, 2018

Cassandra Cassandra’s data model consists of keyspaces, column families, keys, and columns. Data Model Map<RowKey, SortedMap<ColumnKey, ColumnValue>> CREATE TABLE crossfit_gyms_by_city ( country_code text, state_province text, city text, gym_name text, opening_date timestamp, PRIMARY KEY ((country_code, state_province, city), opening_date, gym_name) ) WITH CLUSTERING ORDER BY ( opening_data ASC, gym_name ASC ); Partitioner A partitioner determines how data is distributed across the nodes in the cluster (including replicas). Murmur3Partitioner (default): uniformly distributes data across the cluster based on MurmurHash hash values. ... Read more

© 2018 | 朱曉清 | powered by Hugo