Skip to content

Instantly share code, notes, and snippets.

View AndreyDodonov-EH's full-sized avatar
🎯
Focusing

Andrey Dodonov AndreyDodonov-EH

🎯
Focusing
View GitHub Profile
@AndreyDodonov-EH
AndreyDodonov-EH / example.md
Last active July 12, 2025 15:02
Deduplicate console output live and/or show timestamps
Before After
$ ./printer.sh 
@AndreyDodonov-EH
AndreyDodonov-EH / watch_any_script.sh
Created July 6, 2025 15:08
nodemon: watch ANY script (including non-node)
npm install -g nodemon
nodemon --exec python my_program.py
@AndreyDodonov-EH
AndreyDodonov-EH / permit_team.sh
Created May 23, 2023 15:07
Give permission to all repos in a GitHub organisation for a certain team
#name of your ogranisation
#ORG=some_org
#name of your team
#TEAM_SLUG=some_team
#permission to be given. Possible values are pull, triage, push, maintain, admin
#PERMISSION=pull
#more details on listing repos: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories
#more details on giving permission to a team https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions
@AndreyDodonov-EH
AndreyDodonov-EH / main.py
Created March 4, 2023 21:17
Calling shell command from python with sudo
import logging
import subprocess
def sudo_exec(pwd: str, cmd: list[str]):
"""Executes given shell command with sudo.
:param pwd: password for sudo
:param cmd: command to execute as a sudo as an array, e.g. ['echo','hi']
:return: touple where first entry is a return code and second is output