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
(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) |
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 | |
git fetch upstream | |
git checkout master | |
git merge upstream/master |
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 run --name some-scylla-night -d scylladb/scylla-nightly --experimental 1 | |
docker exec -it some-scylla-night cqlsh | |
cqlsh> | |
CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
CREATE TABLE ks.t (pk int, ck int, v int, PRIMARY KEY (pk, ck, v)) WITH cdc = {'enabled':true}; | |
INSERT INTO ks.t (pk,ck,v) VALUES (1,2,3); | |
INSERT INTO ks.t (pk,ck,v) VALUES (1,2,4); |
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
# Installing Guile on Fedoa 30 from source file does not work as documented | |
# here are the extra steps I did | |
# Download tar from https://ftp.gnu.org/gnu/guile/ | |
tar -xvf guile-3.0.0.tar.gz | |
# install missing libs | |
sudo dnf install libffi-devel | |
sudo dnf install gc-devel |
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
CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
USE mykeyspace; | |
CREATE TABLE tbl ( | |
k int, | |
v int, | |
x int, | |
PRIMARY KEY (k,v) | |
); | |
INSERT INTO tbl (k,v,x) VALUES (1,2,0); | |
INSERT INTO tbl (k,v,x) VALUES (1,2,3) IF NOT EXISTS; |
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
CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
USE mykeyspace; | |
CREATE TABLE tbl ( | |
k int, | |
v int, | |
x int, | |
PRIMARY KEY (k,v) | |
); | |
INSERT INTO tbl (k,v,x) VALUES (1,2,0); | |
INSERT INTO tbl (k,v,x) VALUES (1,2,3) IF NOT EXISTS; |
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
(defn round100 [n] (-> n (* 100) (Math/floor) (/ 100))) | |
(defn calcInterest [& {:keys [initialAmount interestRate years roundInterestYearly]}] | |
(nth (iterate | |
(fn calcInterestOneYear [amount] | |
(cond-> (* interestRate amount) | |
roundInterestYearly round100)) | |
initialAmount) years)) |
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
(ns cassandra-project.core | |
(:require [qbits.alia :as alia])) | |
(def cluster (alia/cluster {:contact-points ["172.17.0.2"]})) | |
(def session (alia/connect cluster)) | |
(alia/execute session "USE mykeyspace;") | |
(dotimes [n 2000000] | |
(alia/execute session (str "UPDATE mykeyspace.gr SET link = link + {" n " : 'ABC'} WHERE id=1 AND r=1;"))) |
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
# install emacs | |
sudo yum install emacs -y | |
# run emacs as a daemon | |
emacs --daemon | |
# connect | |
export TERM=xterm-color | |
emacsclient -nw | |
# run shell | |
c-x shell | |
# reconnect after connection drop |
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
# Start a Scylla cluster | |
######################## | |
docker run --name some-scylla -d scylladb/scylla --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 | |
# Do not use the above --api-address for production. Exposing API IP is not secure. | |
SEED=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' some-scylla) | |
echo $SEED | |
docker run --name some-scylla2 -d scylladb/scylla --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --seeds="$SEED" | |
docker run --name some-scylla3 -d scylladb/scylla --smp 1 --memory 750M --overprovisioned 1 --api-address 0.0.0.0 --seeds="$SEED" |