- Template name:
telegram.message - Content:
{{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}} {{ define "__alerts_list" -}} {{ range . }} {{if ne (index .Labels "alertname") "" -}} {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }} {{- if ne (index .Labels "severity") "" -}} <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
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
| #cloud-config | |
| resize_rootfs: false | |
| disk_setup: | |
| /dev/sda: | |
| table_type: 'mbr' | |
| layout: | |
| - 25 | |
| - 75 | |
| overwrite: true |
Windows Service with Python 3.5 and pyinstaller
- Python 3.5.x
- Visual C++ Build Tools 2015
- PyInstaller 3.2
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the\commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
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
| <?php | |
| function progress_bar($done, $total, $info="", $width=50) { | |
| $perc = round(($done * 100) / $total); | |
| $bar = round(($width * $perc) / 100); | |
| return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info); | |
| } |