| Before | After |
|---|---|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm install -g nodemon | |
| nodemon --exec python my_program.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |