Skip to content

Instantly share code, notes, and snippets.

View dkgndianko's full-sized avatar

Mouhamad Ndiankho THIAM dkgndianko

View GitHub Profile
@dkgndianko
dkgndianko / clone_github_org_repos.sh
Last active August 29, 2024 08:56
Clone all repositories belonging to a given org or user at Github. You must install `gh` command (`brew install gh` under mac) and be authenticated (`gh auth login`).
org=myorg_is_here
gh repo list $org --limit 100 | cut -f 1 | xargs -L1 gh repo clone $1
@dkgndianko
dkgndianko / install_tableplus_on_fedora_workstation_32.md
Last active July 11, 2022 13:55
This is a howto for installing Tableplus (A database tool) on Linux RPM-compatible distributions.

Successfully installed on Fedora Workstation 32 with this steps:

  1. Download the Debian package from official sources there [UPDATE] Use this link instead.
  2. Installing some dependencies:
sudo dnf install openldap openldap-devel libgee libgee-devel gtksourceview-devel gtksourceview2-devel gtksourceview3-devel gtksourceview4-devel libgnome-keyring-devel gnome-keyring gnome-keyring-pam
  1. Transform from .deb to .rpm using alien:
@dkgndianko
dkgndianko / openvpn_cli.md
Last active October 22, 2020 12:22
Connect to VPN with openvpn

situation

When trying to connect to a VPN via command. And you receive config files like .ovpn client .crt and .key or .p12.

Procedure

  1. First gather config files in a same directory. For this tuto, we assume that every config file is in the directory ~/Config/VPN/myVPN.
  2. Install openvpn package from official repositories.

on Ubuntu

sudo apt-get install openvpn
@dkgndianko
dkgndianko / deb_to_rpm.md
Created October 5, 2020 16:37
Build .rpm package from .deb

I recently moved from Debian-basd distributions to RHEEL world. I'm actually using Fedora. At some point, I wanted to install frantz. But I only have two possibilities: .deb and .AppImage and I choosed the .deb. After downloading the .deb file, I use alien to transform it to .rpm.

  1. Install alien (if not)
sudo dnf install alien
  1. transform .deb to .rpm
@dkgndianko
dkgndianko / ntp_on_debian.md
Created September 30, 2020 15:15
Configure system to automatically set date and time by using NTP server
  1. Install needed NTP packages
sudo apt install ntp
sudo apt install ntpdate
  1. Configure the NTP server to follow
sudo ntpdate pool.ntp.org
@dkgndianko
dkgndianko / asw_ecr_config.md
Last active September 30, 2020 15:10
Confiure AWS Elastic Container Registry
  1. Install AWS CLI if not. On Debian you can use:
sudo apt install awscli
pip install awscli
  1. Configure AWS. For that you will need secret key and access key.
aws configure
@dkgndianko
dkgndianko / docker_tips.md
Last active September 30, 2020 10:39
Tips about docker

1. Install Docker on Debian

To install Docker Engine, visit here

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
@dkgndianko
dkgndianko / pagination_type_generator.py
Last active December 19, 2019 13:47
A type for pydantic paginated elements in response
from pydantic import BaseModel
class _Pagination:
def __init__(self):
self.cache = []
def __getitem__(self, klass):
target_class = None
key = str(klass)
try:
target_class = self.cache[key]
@dkgndianko
dkgndianko / repository_method_generator.py
Last active October 28, 2019 12:01
Dynamically generate getter methods for a repository based on the name of fields
from typing import List, Callable, Iterator, Tuple
LOGICAL_SEPARATORS = ["and", "or"]
OPERATORS = ["lt", "gt", "not", "in", "none"]
OPERATORS_MAPPING = {"=": "=", "lt": "<", "gt": ">", "lte": "<=", "gte": ">=", "not": "!=", "none": "is None",
"is": "is"}
# TODO: Add docstrings
# After first generation, add method to the repository class for further calling.
def _generate_method(method_name: str) -> Callable:
@dkgndianko
dkgndianko / repository_method_generator.py
Created October 28, 2019 11:46
Dynamically generate getter methods for a repository based on the name of fields
from typing import List, Callable, Iterator, Tuple
LOGICAL_SEPARATORS = ["and", "or"]
OPERATORS = ["lt", "gt", "not", "in", "none"]
OPERATORS_MAPPING = {"=": "=", "lt": "<", "gt": ">", "lte": "<=", "gte": ">=", "not": "!=", "none": "is None",
"is": "is"}
def _generate_method(method_name: str) -> Callable:
zip_iterator = _process_getter(method_name.split("_"))