Skip to content

Instantly share code, notes, and snippets.

View noemi-dresden's full-sized avatar
🎯
Focusing

Salohy Miarisoa noemi-dresden

🎯
Focusing
View GitHub Profile
@noemi-dresden
noemi-dresden / prometheus.yml
Last active March 10, 2020 07:31
prometheusConfig
# global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# A scrape configuration containing exactly one endpoint to scrape:
scrape_configs:
- job_name: 'any-name-you-want'
static_configs:
- targets: ['localhost:8080'] # the address of an application that exposes metrics for prometheus
@noemi-dresden
noemi-dresden / exampleLogstash.conf
Created June 14, 2018 07:07
Example logstash config
input{
kafka {
boostrap_servers => "localhost:9092"
topic => "a-kafka-topic"
}
}
filter{
json {
source => "message"
@noemi-dresden
noemi-dresden / clusteringalgorithms.md
Last active June 18, 2018 12:47
Clustering algorithms overview
Name Definition Example Characteristics Organization
Connectivity Models Data points closer in data space are more similar than those far away hierachical cluster easy to interpret but do not scale well Hierachical
Centroid models iterative where similarity is intepreted as proximity of data point to centroid K-means provide final number of cluster Non-Hierachical
Distribution Models Based on probability of data points in a cluster belonging to the same distribution EM-Algorithm (Expectation-Maximization) frequent problems of overfitting Non-Hierachical
Density Models Isolate different density regions as basis for clustering Density-Based Clustering of Application with Noise (DBSCAN) Not good on high dimensional data or clusters with varying densities Non-Hierachical
@noemi-dresden
noemi-dresden / myGit.md
Last active January 9, 2019 15:44
my most used git command

list remote

git remote -v

Reset a branch to remote

  1. git fetch origin
  2. git reset --hard origin/master

List branches

  1. remote git branch -r
  2. local git branch
@noemi-dresden
noemi-dresden / fix_x509_error.md
Last active December 24, 2018 09:59
Fix x509 error while using docker

x509: failed to load system roots and no roots provided while using docker

When does it happen?

If the base image used to build the docker container does not have the CA certificates and you try to connect with an https or secure connection inside a docker container

How to fix it?

Just install ca cetificate to your container. For example you are using alpine you can do it as follow

@noemi-dresden
noemi-dresden / fixshbadinterpreter.md
Last active March 8, 2019 20:30
fix / /bin/sh^M : bad interpreter

Fix /bin/sh^M : bad interpreter when running a shell script

  1. Open the script using vi or vim
  2. Type esc
  3. Type :set fileformat=unix
  4. Save with :wq!
@noemi-dresden
noemi-dresden / datasource.yaml
Last active March 28, 2019 17:34
Prometheus and Grafana
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus-ip:9090
@noemi-dresden
noemi-dresden / docker-compose.yml
Created March 28, 2019 18:20
Spark standalone cluster using docker
version: "3.1"
services:
spark-master:
image: bde2020/spark-master:2.4.0-hadoop2.7
container_name: spark-master
ports:
- "8080:8080"
- "7077:7077"
volumes:
- ${PWD}/spark/metrics.properties:/spark/conf/metrics.properties
@noemi-dresden
noemi-dresden / submit.sh
Last active March 28, 2019 20:24
Spark submit using docker
docker run --name spark-app \
-e ENABLE_INIT_DAEMON=false \
--link spark-master:spark-master \
-v path/to-your/metrics.properties:/spark/conf/metrics.properties \
--network=same-network-as-master-and-worker \
spark-app
@noemi-dresden
noemi-dresden / metrics.properties
Created March 28, 2019 19:10
spark properties file allowing to sink to graphite
*.sink.graphite.class=org.apache.spark.metrics.sink.GraphiteSink
*.sink.graphite.host=graphite_exporter
*.sink.graphite.port=9109
*.sink.graphite.period=10
*.sink.graphite.unit=seconds
# Enable JvmSource for instance master, worker, driver and executor
master.source.jvm.class=org.apache.spark.metrics.source.JvmSource
worker.source.jvm.class=org.apache.spark.metrics.source.JvmSource