Skip to content

Instantly share code, notes, and snippets.

View tzach's full-sized avatar

Tzach Livyatan tzach

View GitHub Profile
@tzach
tzach / gist:73f403bf1dcb4290e4cb65ec818ff3dd
Created February 26, 2024 08:32
Extract all PRs from the last year
gh pr list --state closed --search "created:>2023-03-01" -L 1000
@tzach
tzach / count-double-letters.clj
Last active September 20, 2023 14:13
Find the max number of consecutive double letters in an English words
(defn count-consecutive-doubles [word]
{word
(->> word
(partition-by identity)
(map count)
(filter #(>= % 2))
count
)})
(with-open [rdr (clojure.java.io/reader "/home/tzach/Downloads/words.txt")]
@tzach
tzach / gist:09429d245d2f27080b761fd9351ff3bc
Created July 23, 2023 19:10
Scylla U live 2023 script
# https://gist.github.com/tzach/7486f1a0cc904c52f4514f20f14d2a97
docker run --name some-scylla -d scylladb/scylla:5.2 --smp 1 --memory 750M --overprovisioned 1
SEED=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' some-scylla)
docker run --name some-scylla2 -d scylladb/scylla:5.2 --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --seeds="$SEED"
docker run --name some-scylla3 -d scylladb/scylla:5.2 --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --seeds="$SEED"
docker exec -it some-scylla nodetool status
cd ~/projects/scylla-monitoring/
## update scylla-monitoring/prometheus/scylla_servers.example.yml
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit scylla-5.2.0..
## Scylla
docker cp some-scylla:/etc/scylla/scylla.yaml .
// update scylla.yaml
authenticator: PasswordAuthenticator
authorizer: CassandraAuthorizer
docker cp scylla.yaml some-scylla:/etc/scylla/scylla.yaml
docker exec -it some-scylla supervisorctl restart scylla
@tzach
tzach / docker-compose.yml
Created March 16, 2023 20:46
docker-compose.yml for starting a 3 node scylla cluster
version: "3"
services:
scylla-node1:
container_name: scylla-node1
image: scylladb/scylla:5.1.0
restart: always
command: --seeds=scylla-node1 --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0
volumes:
@tzach
tzach / replace-github-issue-with-links.gs
Created February 8, 2023 19:53
replace github issues with links
@tzach
tzach / extract-github-issue.sh
Created February 8, 2023 12:43
extract issue title and url in one line
gh api -H "Accept: application/vnd.github+json" /repos/scylladb/scylladb/issues/10121 -q ."title",."url" | paste -d " " - -
git log scylla-5.1.0..scylla-5.2.0-rc0 | grep -E -i '(fixes|fix|close|closes|closed|fixed|resolve|resolved|resolved) #' | grep -Eo '#[0-9]*'
terraform {
required_providers {
scylladbcloud = {
source = "registry.terraform.io/scylladb/scylladbcloud"
}
}
}
provider "scylladbcloud" {
token = "your-token"