This file contains 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
{"schemaVersion":1,"label":"coverage","message":"56%","color":"yellow"} |
This file contains 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 random | |
import re | |
codes = [] | |
doubles = r"00|11|22|33|44|55|66|77|88|99" | |
while (codes.__len__() < 90): | |
code = random.randint(1000, 9999) | |
if code not in codes and not re.search(doubles, str(code)): | |
codes.append(code) |
This file contains 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
AWS_ACCESS_KEY_ID=test | |
AWS_SECRET_ACCESS_KEY=test | |
AWS_BACKUP_BUCKET=backup | |
S3_URL=http://localstack:4572 | |
DATABASE_HOST=localhost | |
DATABASE_PORT=5432 | |
DATABASE_USER=postgres | |
DATABASE_PASS= | |
DATABASES=db1,db2,db3 |
This file contains 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
""" | |
Skrypt sprawdzający czy są zmiany w liście egzaminów na stronie PZSS | |
W przypadku wykrycia zmian wysyła powiadomienie na aplikację pushover | |
pip install python-pushover | |
python3 pzss-exams.py | |
crontab entry every 1h: | |
1 * * * * python3 /FILE/LOCATION/pzss-exams.py |
This file contains 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
# send informations about new ssh logins to pushover api | |
who="$(whoami)" | |
last="$(last -n 5)" | |
curl -s \ | |
--form-string "token=" \ | |
--form-string "user=" \ | |
--form-string "title=SSH Login: $who" \ | |
--form-string "message=$last" \ |
This file contains 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
# tables | |
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to NEW_OWNER" YOUR_DB ; done | |
# sequences | |
for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to NEW_OWNER" YOUR_DB ; done | |
# views | |
for tbl in `psql -qAt -c "select table_name from information_schema.views where table_schema = 'public';" YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to NEW_OWNER" YOUR_DB ; done |