Skip to content

Instantly share code, notes, and snippets.

View 9seconds's full-sized avatar
💭
I can't actively participate because of family reasons

Sergey Arkhipov 9seconds

💭
I can't actively participate because of family reasons
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 9seconds on github.
  • I am 9seconds (https://keybase.io/9seconds) on keybase.
  • I have a public key ASBiWuv5KuJMZGUtR7jY0Mzrb4mhajMYZdED6paQCGC7Swo

To claim this, I am signing this object:

@9seconds
9seconds / wgeasy_migrate.py
Created October 13, 2022 09:06
Migrate from https://www.linuxserver.io/ WireGuard to WGEasy
#!/usr/bin/env python
import argparse
import datetime
import ipaddress
import json
import pathlib
import sys
import uuid
@9seconds
9seconds / comparators.py
Last active November 20, 2020 14:09
Example of inlined datetime comparators
import enum
import datetime
import pydantic
class Comparator(enum.Enum):
LT = "<"
GT = ">"
EQ = "="
@9seconds
9seconds / coins.py
Created December 28, 2018 12:17
Coins task solution
#!/usr/bin/env python3
import sys
import itertools
COINS = [1, 5, 10, 50, 100, 200, 500, 1000, 2500]
CACHE = {}
def change_number(money):
@9seconds
9seconds / coins.txt
Created December 16, 2018 09:26
Dojo tasks
В России есть такие монеты:
- 1 копейка
- 5 копеек
- 10 копеек
- 50 копеек
- 1 рубль
- 2 рубля
- 5 рублей
- 10 рублей
- 25 рублей
@9seconds
9seconds / curl.py
Created February 26, 2018 14:07
pycurl http2
import io
import pycurl
curl = pycurl.Curl()
curl.setopt(curl.URL, "https://nghttp2.org")
curl.setopt(pycurl.HTTP_VERSION, pycurl.CURL_HTTP_VERSION_2_0)
curl.setopt(pycurl.VERBOSE, 1)
@9seconds
9seconds / example-log.py
Created September 12, 2017 09:49
log.py example
# -*- coding: utf-8 -*-
# vim: set et sw=4 ts=4:
import logging
import logging.config
import flask
@9seconds
9seconds / ranntsbuilder.py
Created April 28, 2017 14:39
Script which builds rannts website
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set ft=python:
import argparse
import contextlib
import json
import logging
import os
@9seconds
9seconds / ranntsbuilder.yaml
Last active April 28, 2017 14:30
Script used to build rannts website on remote machines
---
# vim: set ft=ansible:
# Mandatory: copy_back - drectory path without trailing slash
# commit_hash - commit to work with
- hosts: all
become: true
gather_facts: false
@9seconds
9seconds / db_logger.py
Created July 4, 2016 12:58
Ansible Database logger
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import os.path
import sqlite3
import time
import uuid