Skip to content

Instantly share code, notes, and snippets.

View Salamandar's full-sized avatar

Salamandar Salamandar

View GitHub Profile
@Salamandar
Salamandar / build_mongodb.sh
Last active January 27, 2024 11:43
Build mongodb on Debian without AVX
#!/usr/bin/env bash
sudo apt install git python-dev-is-python3 libssl-dev lld liblzma-dev python3-poetry
sudo apt install llvm clang lld
git clone https://github.com/GermanAizek/mongodb-without-avx
pushd mongodb-without-avx
pushd mongo
# Disable AVX requirements
blueprint:
name: ZHA - Moes Smart Knob for lights
description: |
Control lights with a Moes Smart Knob.
Rotating left/right will change the brightness smoothly of the selected light.
Inspired from https://gist.github.com/seamus65/939a147634942dd885c8704334627f93
domain: automation
input:
remote:
name: Remote
@Salamandar
Salamandar / ping_email.sh
Last active June 7, 2023 09:07
send email if an host is not pingable
#!/usr/bin/env bash
set -Eeuo pipefail
HOSTS_TO_CHECK=(
127.0.0.1
github.com
test_invalid.com
)
test_host() {
import yargs from 'yargs'
import Engine, { formatValue } from 'publicodes'
import rules from 'modele-social'
// npm install publicodes modele-social yargs
// node ./modele.mjs --salaireBrut 2500 2>/dev/null | jq
// Définition des arguments en ligne de commande avec yargs
@Salamandar
Salamandar / .gitignore
Last active April 4, 2023 14:48
Request tickets from the PayByPhone API
credentials.yaml
@Salamandar
Salamandar / record_ram_usage.sh
Created January 20, 2023 12:37
Record ram usage
#!/bin/bash
ram_usage() {
free -m | grep Mem | awk '{print $3}'
}
base=$(ram_usage)
max=0
while true; do
@Salamandar
Salamandar / import_apps.py
Last active January 20, 2023 12:15
Import json to Fider via SQL queries. import_apps should be called first, then the list could be reviewed, then imported via import_apps.py.
#!/usr/bin/env python3
import re
import json
import yaml
import psycopg2
def connect_db():
hostname = "localhost"
@Salamandar
Salamandar / serial_duplicator.py
Created March 23, 2022 08:52
Duplicate TTY serial port using socat in Python to log everything that goes through it.
#!/usr/bin/env python3
import sys
import os
import signal
import threading
import subprocess
from typing import Optional
from pathlib import Path
@Salamandar
Salamandar / local_prefix_variables
Created July 7, 2020 13:14
Export all useful variables for a local prefix, with development tools.
# This file expects LOCAL_PREFIX to be an absolute path to the prefix (like /usr or $HOME/.local)
export PATH="${LOCAL_PREFIX}/bin:${PATH}"
# Used to detect the build dependencies
export PKG_CONFIG_PATH="${LOCAL_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH="${LOCAL_PREFIX}/lib64/pkgconfig:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH="${LOCAL_PREFIX}/share/pkgconfig:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH="${LOCAL_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
@Salamandar
Salamandar / crosstool-config
Created April 2, 2020 18:42
Crosstool configuration
#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG aca85cb Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_wget=y
CT_CONFIGURE_has_curl=y
CT_CONFIGURE_has_stat_flavor_GNU=y
CT_CONFIGURE_has_make_3_81_or_newer=y
CT_CONFIGURE_has_libtool_2_4_or_newer=y