Skip to content

Instantly share code, notes, and snippets.

View tzach's full-sized avatar

Tzach Livyatan tzach

View GitHub Profile
@tzach
tzach / Demo Scylla Alternator TTL with Docker
Created November 21, 2022 12:16
Demo Scylla Alternator TTL with Docker
## Start Scylla
docker run --name some-scylla -d scylladb/scylla:5.1.0-rc4 --alternator-port 8000 --alternator-write-isolation=always
## Download config
docker cp some-scylla:/etc/scylla/scylla.yaml .
## Config updates
# Uncomment to enable experimental features
experimental_features:
git reset $(git merge-base master $(git branch --show-current))
git add -A
git commit -m "docs: elaborate on Scylla admin REST API"
git push --force origin $(git branch --show-current)
// source https://stackoverflow.com/questions/25356810/git-how-to-squash-all-commits-on-branch
@tzach
tzach / Google Apps Script
Created October 6, 2022 20:11
convert string to cento seconds (second / 100) and back
function csecs_from_str(str) {
var arr = [{}];
var str1 = str + ""
arr = str1.split(":")
if (arr.length > 1) {
var min = parseInt(arr[0])
var sec = parseFloat(arr[1])
return ((min * 60.0) + sec) * 100
}
else {
git log scylla-3.0.0..scylla-4.0.0 | grep -E -i '(fixes|fix|close|closes|closed|fixed|resolve|resolved|resolved) #' | wc -l
@tzach
tzach / cschart.json
Last active September 12, 2021 07:37
{
"nodes": [
{
"id": 1,
"name": "A",
"state": "Up"
},
{
"id": 2,
"name": "B",
### Install
dnf install git emacs yum-utils
sudo dnf install git emacs yum-utils
sudo yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo groupadd docker
sudo usermod -aG docker $USER
{
"nodes": [
{
"id": 1,
"name": "A",
"state": "Up"
},
{
"id": 2,
"name": "B",
@tzach
tzach / Advance_Data_Modeling.cql
Last active December 5, 2023 15:56
Advance Data Modeling
DROP KEYSPACE mykeyspace ;
CREATE KEYSPACE mykeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor' : 3} AND durable_writes = true;
USE mykeyspace;
CREATE TABLE heartrate_v10 (
pet_chip_id uuid,
owner uuid,
time timestamp,
heart_rate int,
@tzach
tzach / LWT example
Last active December 27, 2020 15:39
CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'} AND durable_writes = true;
USE mykeyspace;
CREATE TABLE guards (firstname text, lastname text, state boolean, room_temp int, PRIMARY KEY ((firstname, lastname)));
INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('tzach', 'livyatan', false, 25);
INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('tzach', 'livyatan', false, 24);
INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('guy', 'Guy Shtub', false, 25);
INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('laura', 'novich', false, 23);
INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('avishai', 'Ish Shalom', true, 24);
INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('ivan', 'Prisyazhnyy', true, 25);
(custom-set-faces
;; custom-set-faces 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.
)
(let ((default-directory "~/emacs/"))
(normal-top-level-add-subdirs-to-load-path))
(require 'better-defaults)