Skip to content

Instantly share code, notes, and snippets.

@eeddaann
eeddaann / test_redis.md
Created July 4, 2018 08:03
Test connection to Redis with netcat

Test connection to Redis with netcat

echo -e '*1\r\n$4\r\nPING\r\n' | nc redis.host.com 6379

import cv2
import numpy as np
import matplotlib.pyplot as plt
a = []
cap = cv2.VideoCapture('clip.mp4')
ok, frame = cap.read()
parameters_shitomasi = dict(maxCorners=100, qualityLevel=0.3, minDistance=7)
@eeddaann
eeddaann / kassandra.py
Created April 13, 2023 10:37
generate random data for zincobserve
import base64, json
import requests
from requests.exceptions import HTTPError
import random
import time
user = "root@example.com"
password = "Complexpass#123"
bas64encoded_creds = base64.b64encode(bytes(user + ":" + password, "utf-8")).decode("utf-8")
name: guild
channels:
- defaults
dependencies:
- backcall=0.2.0
- ca-certificates=2021.10.26
- certifi=2021.10.8
- colorama=0.4.4
- decorator=5.1.0
- ipython=7.29.0
@eeddaann
eeddaann / sir_python
Last active July 14, 2021 22:12
sir model with age groups implemented in python
#!/usr/bin/env python
import numpy as np
from pylab import *
import scipy.integrate as spi
#Parameter Values
PopIn= {'g1s_young':1/12,'g1i_young':1/12,'g1r_young':1/12,'g1s_mid':1/12,'g1i_mid':1/12,'g1r_mid':1/12,'g1s_old':1/12,'g1i_old':1/12,'g1r_old':1/12,'g1s_vold':1/12,'g1i_vold':1/12,'g1r_vold':1/12}
arr = [1/12]*12
beta= 0.50
@eeddaann
eeddaann / PromQL-docker-swarm-node-name.md
Last active March 2, 2021 14:11
query in PromQL to get docker swarm node names instead of node id

PromQL

Prometheus is a time-series db, it's query language called PromQL.

Here are some analogies from SQL which may help to understand the basics of PromQL better:

  • metric ~ sql table
  • label ~ sql column

example:

  • Count how many containers running on each node:
@eeddaann
eeddaann / dict-test.js
Last active February 4, 2021 11:35
ODH dictionary
class meow {
constructor(options) {
this.maxexample = 2;
this.word = '';
}
async displayName() {
return "אנגלית טכנית"
}
async findTerm(word) {
<!doctype html>
<html>
<head>
<title>Hello Webpack</title>
</head>
<body>
<textarea name="" id="input" cols="130" rows="10">a AND b OR c</textarea>
<div>
<button type="button" id="submit">Submit</button>
</div>
import pandas as pd
# Create dummy Data Frame
df = pd.DataFrame({
'A': [1,2,-3],
'B': [2,-4,6],
'C': [3,5,-7]
})
print(df.corr().unstack().sort_values().drop_duplicates())
@eeddaann
eeddaann / calsium.js
Last active January 16, 2019 06:40
calsium wip
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProviderViewModels : [], //Disable terrain changing
infoBox : false, //Disable InfoBox widget
selectionIndicator : false //Disable selection indicator
});
//Enable lighting based on sun/moon positions
viewer.scene.globe.enableLighting = true;
//Use STK World Terrain