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
console.log('Loading function'); | |
var aws = require('aws-sdk'); | |
var region = 'us-west-2'; | |
var ec2 = new aws.EC2({region: region}); | |
var topicArn = "arn:aws:sns:us-west-2:797456418907:cloudius_running_ec2_instances"; | |
function push(payload, context) { | |
var sns = new aws.SNS(); |
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
# Even Fibonacci numbers | |
# https://projecteuler.net/problem=2 | |
# Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: | |
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | |
# By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. | |
(defn fib | |
([] (fib 1)) | |
([a] (fib 1 a)) |
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
mkdir report | |
rpm -qa > ./report/rpm.txt | |
journalctl -b > ./report/journalctl.txt | |
df -k > ./report/df.txt | |
netstat > ./report/netstat.txt | |
export report_uuid=$(uuidgen) | |
tar c report | xz > report.tar.xz | |
curl --request PUT --upload-file report.tar.xz "scylladb-users-upload.s3.amazonaws.com/$report_uuid/report.tar.xz" | |
echo $report_uuid |
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
(setq github-project-prefix "https://github.com/scylladb/scylla/issues/") | |
(defun create-github-issue (string &optional from to) | |
"replace a #xxx with [#xxx](https://github.com/scylladb/scylla/issues/xxx)" | |
(interactive | |
(if (use-region-p) | |
(list nil (region-beginning) (region-end)) | |
(let ((bds (bounds-of-thing-at-point 'paragraph)) ) | |
(list nil (car bds) (cdr bds)) ) ) ) | |
(let (workOnStringP inputStr outputStr) |
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
/***************************/ | |
/* simple root 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 | |
/* |
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
## Presto | |
$ cd etc | |
etc$ ls -la | |
total 28 | |
drwxrwxr-x 3 tzach tzach 4096 Jun 27 10:24 . | |
drwxr-xr-x 8 tzach tzach 4096 Jun 27 10:24 .. | |
drwxrwxr-x 2 tzach tzach 4096 Jun 27 10:19 catalog | |
-rw-rw-r-- 1 tzach tzach 203 Jun 27 10:19 config.properties | |
-rw-rw-r-- 1 tzach tzach 176 Jun 27 10:18 jvm.config |
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
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'); |
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
## 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}}" |
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
cat scylla.1.2.1.metrics.txt | sed 's/.$//' | sed 's/^.//' | cut -d"/" -f2- | sed 's/.$//' | sort |
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 -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 |