Skip to content

Instantly share code, notes, and snippets.

View dshadow's full-sized avatar

Kostiantyn Cherednichenko dshadow

  • Bahnhof
  • Ukraine, Kyiv
View GitHub Profile
@dshadow
dshadow / preseed.cfg
Last active November 12, 2019 10:32
preseed.cfg
d-i debian-installer/locale string uk_UA
d-i localechooser/supported-locales multiselect en_US.UTF-8, en_US
d-i keymap select ua
d-i keyboard-configuration/modelcode string pc105
d-i keyboard-configuration/toggle select Alt+Shift
d-i keyboard-configuration/layoutcode string us,ru,ua
d-i keyboard-configuration/xkb-keymap select ua
@dshadow
dshadow / get_method_name_from_route.py
Last active January 13, 2021 15:24
get_method_name_from_route.py
#!/usr/bin/env python3
import uvicorn
from typing import List, Optional
from fastapi import FastAPI, Request, Depends, Security, HTTPException, status
from fastapi.routing import APIRoute
from fastapi.security.api_key import APIKeyHeader
app = FastAPI(
title='HelloWorld',
@dshadow
dshadow / git-shell-check-access.py
Created April 2, 2023 14:05
Add in .ssh/authorized_keys in "command"
#!/usr/bin/env python3
import os
import sys
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO, format='%(levelname)s:%(message)s')
path = '/path_to_my_super_repo'
read_only = False if len(sys.argv) > 1 and sys.argv[1] == '-rw' else True
@dshadow
dshadow / test_date_parser_wo_fmt.cpp
Created May 30, 2023 07:57
Ability to parse date w/o libfmt
#include <iomanip>
#include <iostream>
#include <string>
#include <sstream>
#include <chrono>
using namespace std;
const char * time_format = "%Y-%m-%d";