Skip to content

Instantly share code, notes, and snippets.

View kazqvaizer's full-sized avatar
😎
Wow!

Alexey Chudin kazqvaizer

😎
Wow!
  • Netherlands
View GitHub Profile
@kazqvaizer
kazqvaizer / some.sh
Created June 25, 2024 07:12
Create project with fandsdev django cookicutter
PYTHON_VERSION=3.11.9
pyenv install $PYTHON_VERSION
pyenv shell $PYTHON_VERSION
WHERE_IS_THE_PYTHON_UBUNTOVSKI=`pyenv which python`
pipx reinstall --python=$WHERE_IS_THE_PYTHON_UBUNTOVSKI poetry
pipx reinstall --python=$WHERE_IS_THE_PYTHON_UBUNTOVSKI cookiecutter
@kazqvaizer
kazqvaizer / deploy-and-wait.sh
Last active March 16, 2023 12:13
Way to run commands and deploy services in docker swarm stack.
#!/bin/bash
#
# Update whole docker swarm stack from CI job and wait untill success.
# Inits rollback process in case of unsuccessfull deployment.
#
# Requires another script from here: https://github.com/sudo-bmitch/docker-stack-wait
#
# By: Alexey Chudin <[email protected]>
# License: MIT
#
@kazqvaizer
kazqvaizer / screencast.sh
Created November 22, 2022 09:05
Launch all necessary for screen cast with yourself
#!/bin/bash
mplayer -ontop -noborder -geometry 300x300+80+750 -vf mirror,crop=240:240:30:0 -vo gl2 -msglevel all=0 -tv width=300:height=300:device=/dev/video0 tv:// &
simplescreenrecorder --start-hidden &>/dev/null &
sleep 3
wmctrl -r MPlayer -b add,sticky
@kazqvaizer
kazqvaizer / multipartify.py
Last active January 31, 2025 09:31
Python dict to multipart/form-data converter to use it requests
"""
Here is a way to flatten python dictionaries for making multipart/form-data POST requests.
{"some": ["balls", "toys"], "field": "value", "nested": {"objects": "here"}}
->
{"some[0]": "balls", "some[1]": "toys", "field": "value", "nested[objects]": "here"}