Skip to content

Instantly share code, notes, and snippets.

View uburuntu's full-sized avatar
:shipit:
Yep, it's a squirrel in a hat

Ramzan Bekbulatov uburuntu

:shipit:
Yep, it's a squirrel in a hat
View GitHub Profile
@uburuntu
uburuntu / schema.esdl
Created March 11, 2022 17:02
Telegram bot schema for EdgeDB
module meta {
abstract type HasCreated {
required property created -> datetime {
default := std::datetime_current();
}
}
abstract type HasMetadata {
required property metadata -> json {
default := <json>'{}';
@uburuntu
uburuntu / create.sh
Created July 22, 2021 09:50
Create SSH Key
#!/usr/bin/env bash
set -Eeuo pipefail
ssh-keygen -o -a 100 -t ed25519 -C "bekbulatov.ramzan@ya.ru" -f ~/.ssh/id_ed25519
# -o: Save the private-key using the new OpenSSH format rather than the PEM format. Actually, this option is implied when you specify the key type as ed25519.
# -a: It’s the numbers of KDF (Key Derivation Function) rounds. Higher numbers result in slower passphrase verification, increasing the resistance to brute-force password cracking should the private-key be stolen.
# -t: Specifies the type of key to create, in our case the Ed25519.
# -f: Specify the filename of the generated key file. If you want it to be discovered automatically by the SSH agent, it must be stored in the default `.ssh` directory within your home directory.
# -C: An option to specify a comment. It’s purely informational and can be anything. But it’s usually filled with <login>@<hostname> who generated the key.
@uburuntu
uburuntu / exc_tracker.py
Last active May 25, 2021 23:38
Telegram Exception Tracker for aiogram
import asyncio
import re
from functools import cached_property
from typing import Optional
import aiogram
import aiohttp
class TextNormalizer:
@uburuntu
uburuntu / -machine.sh
Last active January 7, 2024 14:02
New Machine Initialization
#!/bin/bash
# Main packages
sudo apt-get update
sudo apt-get install -y mc nano git curl htop keychain mosh libcurl4-openssl-dev libssl-dev python3.11-dev python3-pip
sudo apt-get install -y libxml2-dev libxslt-dev libtiff-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
sudo apt-get upgrade
# Install Docker
# https://docs.docker.com/engine/install/ubuntu/
@uburuntu
uburuntu / toc_generate.py
Last active August 27, 2022 16:59
Telegram channel table of contents generation with links | t.me/unrelated
from collections import Counter
import telebot
def md_link(text, link):
return f'[{text}]({link})'
def md_bold(text):
@uburuntu
uburuntu / upload.sh
Created December 17, 2017 21:44
YaDisk uploading
#!/bin/bash
yadisk_dir="app:/results"
content=$(curl -X GET -H "Content-Type: application/json" -H "Authorization: OAuth $YADISK_API_TOKEN" https://cloud-api.yandex.net/v1/disk/resources/upload?path=$yadisk_dir/$1&overwrite=true)
curl --upload-file $1 $(jq -r '.href' <<< "$content")
@uburuntu
uburuntu / fork_update.md
Last active August 9, 2018 10:54 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@uburuntu
uburuntu / .gitconfig
Last active November 13, 2017 18:28
Own .gitconfig
[user]
name = uburuntu
email = bekbulatov.ramzan@ya.ru
[gui]
diffopts = -b
spellingdictionary = none
[merge]
tool = kdiff3