Skip to content

Instantly share code, notes, and snippets.

View mikekenneth's full-sized avatar
🌍

Mike Houngbadji mikekenneth

🌍
View GitHub Profile
@mikekenneth
mikekenneth / apache_superset_permissions_for_readonly_role.txt
Created November 19, 2025 03:53
Apache Superset List of Permissions to allow Read ONLY Access
"all datasource access on all_datasource_access"
"can dashboard on Superset"
"can explore json on Superset"
"can explore on Superset"
"can export on Dashboard"
"can get embedded on Dashboard"
"can read on Chart"
"can read on Dashboard"
"can read on DashboardFilterStateRestApi"
"can read on EmbeddedDashboard"
@mikekenneth
mikekenneth / rootless_cadvisor.sh
Last active April 7, 2026 09:37
rootless cadvisor : Allow you to start cadvisor with rootless docker so you can monitor les rootless containers
docker run \
--volume=/:/rootfs:ro \
--volume=/run/user/$(id -u)/docker.sock:/var/run/docker.sock:ro \
--volume=/sys:/sys:ro \
--volume=$HOME/.local/share/docker/:/var/lib/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
gcr.io/cadvisor/cadvisor:latest
@mikekenneth
mikekenneth / streamlit_date_month_selector.py
Created May 4, 2023 10:10
Streamlit month picker using selectbox and radio.
import streamlit as st
from calendar import month_abbr
from datetime import datetime
with st.expander('Report month'):
this_year = datetime.now().year
this_month = datetime.now().month
report_year = st.selectbox("", range(this_year, this_year - 2, -1))
month_abbr = month_abbr[1:]
report_month_str = st.radio("", month_abbr, index=this_month - 1, horizontal=True)
@mikekenneth
mikekenneth / forticlient_vpn_installation.md
Created April 26, 2023 09:21
Installation of Forticlient VPN on Debian 11 Bulleyes

Original Post: https://gitlab.com/fhidalgo.dev/install-forticlient-on-debian-11-bullseye/-/blob/en/README.md

I am just adding this here for my sake of retrieving easily.

Install Forticlient on Debian 11 bullseye

In Debian 11 bullseye there is a package that has been removed called libappindicator1. This is used to display notifications. However, there are still many packages that have it as a dependency, such as the Forticlient VPN client.

To resolve that dependency, all you have to do is mock the package with equivs:

@mikekenneth
mikekenneth / minio in docker-compose.yaml
Created December 28, 2022 11:56
Starting MinIO using docker-compose
version: '3'
services:
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_storage:/data
@mikekenneth
mikekenneth / pandas_multiple_line_plot.py
Created September 27, 2022 08:16
Plotting multilple line plot with Pandas & Matplotlib
import pandas as pd
import matplotlib.pyplot as plt
data = {
'ip_address': ['10.10.1.2','10.10.1.3','10.10.1.4','10.10.1.5','10.10.1.6','10.10.1.7','10.10.1.8'],
'latency': [278,353,658,517,62,485,875],
'packet_size': [773,9860,4618,1056,9568,8124,4605]}
df = pd.DataFrame(data=data)
print(df.head())
@mikekenneth
mikekenneth / postgres_queries_and_commands.sql
Created September 12, 2022 17:23 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
import serial
import time
# Instantiate serial connection to the HD Ranger
hd_ranger_serial_port_id = '/dev/ttyUSB0' # 'COM5'
ser = serial.Serial(hd_ranger_serial_port_id, 115200) # open serial port
print(ser.name) # check which port was really used
# Get XON from HD Ranger
print(ser.read(1)) # Pour lire le XON
DROP TABLE if exists d_date;
CREATE TABLE d_date
(
date_dim_id INT NOT NULL,
date_actual DATE NOT NULL,
epoch BIGINT NOT NULL,
day_suffix VARCHAR(4) NOT NULL,
day_name VARCHAR(9) NOT NULL,
day_of_week INT NOT NULL,
@mikekenneth
mikekenneth / rank_scores.py
Created June 28, 2022 10:58
Rank list of scores
# Code pour calculer les rangs
def rank_scores(scores:list):
return {moyenne: rang for rang, moyenne in enumerate(reversed(sorted(set(moyennes))), start=1)}
moyennes = [1, 2, 20 , 16, 19, 18, 0, 6, 6.5, 12.5, 0.5, 15.60, 17.8]
ranked_scores = rank_scores(moyennes)
# Ensuites on peut recupere les range en entrant la moyennes comme input
ranked_scores.get(2) # 10