Skip to content

Instantly share code, notes, and snippets.

View HosseyNJF's full-sized avatar
🤙

M. Hosseyn Najafi HosseyNJF

🤙
View GitHub Profile
@HosseyNJF
HosseyNJF / id_rsa.pub
Created December 26, 2024 12:44
My RSA Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDi8fze5JiaIlfrSUJREPyT6yxtqLcTqTG2ZQ37J1DMeqzRS8wL7JYujHH3Fh4ND/OwJdlgIhsUl/vmWDB+Ta1T2SEGN6xhkZV16K2SjPQWy5oB8g83jIuw+e9H2a0zHU6lFC7qYDZN9eJPm0M/tr889KdvDYwsxezqGs5M0FEzWZbgg/YXgDF2o+RtkhOEuQ0aW206gBiDBwd6lT30UIUDWM5LCvBWf5wyYxmY+06r6brAGEnqnwYo4bsQ8BeX3KKYjjtLD0dBj5dRvmrXQlUCF7/B84/ysndrXYE6TvlLmkeW3coj28Pd1kt1w2U9S6eLGa6PDUabHHpsG88sAtEv hosseynjf@icloud.com
@HosseyNJF
HosseyNJF / dictionary_cache.py
Created March 10, 2024 12:40
An interface to redis HSET, wrapped in a dictionary, using django_redis.
from collections.abc import MutableMapping
from django_redis.cache import RedisCache
from redis.client import Redis
class DictionaryCache(MutableMapping):
def __init__(
self,
@HosseyNJF
HosseyNJF / README.md
Last active November 10, 2024 07:46
Delete data from exported time-series from Prometheus / VictoriaMetrics in a time range.

Usage

Note that the response cache must be deleted after these steps in order to remove previously cached results - see more details here.

@HosseyNJF
HosseyNJF / .xbindkeysrc
Created February 7, 2021 16:40
Ever wanted to switch workspaces with the buttons on the side of your mouse in Gnome? Here you are!
"wmctrl -s $(( $(xdotool get_desktop) - 1 ))"
b:9
"wmctrl -s $(( $(xdotool get_desktop) + 1 ))"
b:8
"wmctrl -r :ACTIVE: -t $(( $(xdotool get_desktop) - 1 )) && wmctrl -s $(( $(xdotool get_desktop) - 1 ))"
shift + b:9
"wmctrl -r :ACTIVE: -t $(( $(xdotool get_desktop) + 1 )) && wmctrl -s $(( $(xdotool get_desktop) + 1 ))"