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 / 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 <kazqvaizer@gmail.com>
# 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 September 18, 2023 14:16
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"}