View .emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(erc-nick "tzach")
'(package-selected-packages
(quote
(wc-mode arduino-mode magithub magit helm cider emacsql-mysql twittering-mode ## yaml-mode starter-kit-ruby starter-kit-js starter-kit-eshell starter-kit-bindings scss-mode scala-mode markdown-preview-mode markdown-preview-eww less-css-mode langtool json-mode json js2-mode es-windows emstar clojure-project-mode)))
'(show-paren-mode t))
View CQL counters example
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
use mykeyspace;
CREATE TABLE counts (value counter, name varchar, PRIMARY KEY (name));
UPDATE mykeyspace.counts set value = value + 3 WHERE name = 'tzach';
select * from mykeyspace.counts;
View robo.car.v01
/***************************/
/* simple robot car */
/***************************/
// engine part from
// http://www.instructables.com/id/Control-DC-and-stepper-motors-with-L298N-Dual-Moto/?ALLSTEPS
// sndor part from
// http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/?ALLSTEPS
/*
View my .emacs file
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(erc-nick "tzach")
'(package-selected-packages
(quote
(magithub magit helm cider emacsql-mysql twittering-mode ## yaml-mode starter-kit-ruby starter-kit-js starter-kit-eshell starter-kit-bindings scss-mode scala-mode markdown-preview-mode markdown-preview-eww less-css-mode langtool json-mode json js2-mode es-windows emstar clojure-project-mode)))
'(show-paren-mode t))
View Scylla CQL and Presto SQL examples
;; CQL
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
use mykeyspace ;
CREATE TABLE users (user_id int PRIMARY KEY, fname text, lname text);
insert into users (user_id , fname, lname) values (1, 'tzach', 'livyatan');
insert into users (user_id , fname, lname) values (2, 'dor', 'laor');
insert into users (user_id , fname, lname) values (3, 'shlomi', 'laor');
insert into users (user_id , fname, lname) values (4, 'shlomi', 'livne');
insert into users (user_id , fname, lname) values (6, 'avi', 'kivity');
View scylla in a box
#########
This is a step by step instruction for running a cluster of 3 Scylla nodes and a Scylla monitoring servers, all as Docker images on the same box.
#########
# prerequisites (centos 7)
sudo yum install tmux emacs git wget -y
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
View collect-runtime-info.sh
#!/bin/bash -e
mkdir report
rpm -qa > ./report/rpm.txt
journalctl -b > ./report/journalctl.txt
df -k > ./report/df.txt
netstat > ./report/netstat.txt
sar -P ALL > ./report/sar.txt
iostat -d 1 10 > ./report/iostat.txt
View scyllatop-to-list.sh
cat scylla.1.2.1.metrics.txt | sed 's/.$//' | sed 's/^.//' | cut -d"/" -f2- | sed 's/.$//' | sort
View provision-ec2-volume.yaml
## This Ansible script start a cluster of 3 nodes on EC2
## And attach 10 ESB, 100G each
- name: Provision voulums
hosts: localhost
connection: local
vars:
region: us-east-1
cluster_nodes: 3
user_data: "--clustername test-cluster --totalnodes {{cluster_nodes}}"
View Presto Scylla example
cqlsh>
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
use mykeyspace ;
CREATE TABLE users (user_id int PRIMARY KEY, fname text, lname text);
insert into users (user_id , fname, lname) values (1, 'tzach', 'livyatan');
insert into users (user_id , fname, lname) values (2, 'dor', 'laor');
insert into users (user_id , fname, lname) values (3, 'shlomi', 'laor');
insert into users (user_id , fname, lname) values (4, 'shlomi', 'livne');
insert into users (user_id , fname, lname) values (6, 'avi', 'kivity');