Skip to content

Instantly share code, notes, and snippets.

@dl6nm
dl6nm / how-to-update-all-python-packages.md
Last active March 13, 2024 11:09
Hot to update all Python packages with pip
@dl6nm
dl6nm / Grafana-TelegramBot-HowTo.md
Last active December 13, 2023 16:21 — forked from subzeta/gist:26cd1a1f1526411862b3a3a0b4422d3d
How to create a Grafana bot for Telegram

Set up a Telegram Bot

  1. Go to Grafana > Alerting > Notification channels > New channel.
  2. Type: Telegram. It will ask you for a Bot API Token and a Chat ID.
  3. Open a chat with BotFather on Telegram.
  4. Type /newbot
  5. Type your bots name. e.g. Grafana Bot
  6. Type your bots username. e.g. a_new_grafana_bot
  7. You get your Bot API Token. Paste it on Grafana.
  8. Before making getUpdates (in the next step) you should add your bot into your telegram client and run /start. Thus you start chatting with the bot and this room is assigned chat id. (Thanks to @KES777)
@dl6nm
dl6nm / Python-Project-Code-Structure.md
Last active July 26, 2023 01:08
Python Project Code Structure, App with internal packages,

Application with Internal Packages

In larger applications, you may have one or more internal packages that are either tied together with a main runner script or that provide specific functionality to a larger library you are packaging. We will extend the conventions laid out above to accommodate for this:

helloworld/
│
├── bin/
│
├── docs/

│ ├── hello.md

@dl6nm
dl6nm / README.md
Last active November 30, 2022 06:40
README Template

README Template

This template is intended for new projects to provide a structured README file.

[![Badges @ Shields IO][shield-badges]][shields] [![Version?][shield-version]][shields] [![Build passed?][shield-build]][shields] [![Language?][shield-markdown]][shields] [![Tested?][shield-tested]][shields] [![License?][shield-license]][shields]

@dl6nm
dl6nm / sign-git-commits.md
Created November 4, 2022 06:51
Sign your Git commits with GPG key

Sign your Git commits

After you add your public key to your account, you can sign individual commits manually, or configure Git to default to signed commits.

Sign individual Git commits manually:

  1. Add -S flag to any commit you want to sign:

    git commit -S -m "My commit message"

  2. Enter the passphrase of your GPG key when asked.

@dl6nm
dl6nm / Software-Versioning-Scheme.md
Last active September 17, 2022 18:57
Software Versioning Scheme + Human Readable Version + Semantic Versioning (SemVer) with `git describe`

Software Versioning

Scheme

1.2.3[-beta.1][+123] → major.minor.patch[-pre-release][+build]
| | |    |      |
| | |    |      +-- build:        optional dot-separated build identifiers
| | |    +--------- pre-release:  optional dot-separated pre-release identifiers build metadata information
| | +-------------- hotfix:       make backwards-compatible bug fixes

| +---------------- feature: add functionallity in backwards-compatible manner

@dl6nm
dl6nm / git-commit-message-conventions.md
Last active May 3, 2022 12:06
Git Commit Message Conventions - Conventional Commits

Git commit message conventions

Format of the commit message

[revert: ]<type>[(<scope>)]: <subject>
    |      |        |           |
    |      |        |           +--- very short description of the change
    |      |        |                (use imerative, parent tense: 'change' not 'changed')
    |      |        |

| | +--------------- optional: specifying place of the commit change

@dl6nm
dl6nm / conftest.py
Created October 15, 2020 09:40
pytest helper class with static method (function) in conftest.py
import pytest
class Helpers:
@staticmethod
def help_me():
return "no"
@pytest.fixture
@dl6nm
dl6nm / config
Created July 23, 2020 06:51
Set user credentials in .git/config
# Add the following lines to your .git/config to set other credentials than the default ones used in [Fork Git Client](http://fork.dev/)
[credential "https://github.com/username/repository.git"]
helper = manager
username = username
useHttpPath = true
@dl6nm
dl6nm / grafana_telegram_bot.md
Created July 1, 2020 09:05 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather