Skip to content

Instantly share code, notes, and snippets.

View Ad1n's full-sized avatar
♟️
Focusing

@ad1n0d1n Ad1n

♟️
Focusing
  • Kupibilet
  • Serbia
View GitHub Profile
@Ad1n
Ad1n / all_combinations_between_unknown_counts_of_vectors.rs
Created January 10, 2023 16:57
All combinations between unknown counts of vectors, ordered by exposed list of vectors
fn main() {
let mut v: Vec<Vec<&str>> = Vec::new();
v.push(["1", "2"].to_vec());
v.push(["3", "4", "5"].to_vec());
v.push(["6", "7"].to_vec());
let mut acc = Vec::new();
require "yaml"
require "git"
class UpdateClassifier
GIT_REPO = "[email protected]:it-hq/it-classifications.git".freeze
TMP_PATH = "#{Rails.root}/tmp".freeze
LOCAL_CLASSIFIERS_PATH = "#{TMP_PATH}/categories".freeze
REG_PARAM = "#{LOCAL_CLASSIFIERS_PATH}/**/*.yml".freeze
@Ad1n
Ad1n / qna_config_monit
Last active January 30, 2019 14:15
Qna monit config
### Nginx ###
check process nginx with pidfile /opt/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if memory usage > 80% for 5 cycles then restart
if failed host 127.0.0.1 port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout