I hereby claim:
- I am cdalvaro on github.
- I am cdalvaro (https://keybase.io/cdalvaro) on keybase.
- I have a public key whose fingerprint is 91DB 2FD1 CE5A 3545 9250 FEFC E0F9 B75C 3246 CEB5
To claim this, I am signing this object:
/usr/local/bin/gpg --batch --pinentry-mode=loopback --passphrase-file ~/.gnupg/key.txt --no-tty "$@" |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
import iterm2 | |
async def set_theme(connection, theme): | |
# Themes have space-delimited attributes, one of which will be light or dark. | |
parts = theme.split(" ") | |
if "dark" in parts: | |
preset = await iterm2.ColorPreset.async_get(connection, "GitHub Dark") |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get a single character | ${VARNAME[index]} |
Get the string from a specific index | ${VARNAME[index,-1]} |
#! /bin/bash | |
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION | |
# Developed for DSM 6. Not tested on other versions. | |
# Steps to install | |
# Save this script in one of your shares | |
# Backup /usr/syno/share/nginx/ as follows: | |
# # cd /usr/syno/share/ | |
# # tar cvf ~/nginx.tar nginx | |
# Run this script as root |
telegram.message
{{- /* 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 -}}
telegram.message
{{ define "alert_list" }}{{ range . }}{{ .Labels.alertname }}
{{ range .Annotations.SortedPairs }}<strong>{{ .Name }}</strong>: {{ .Value }}
{{ end }}| {{ if gt (len .GeneratorURL) 0 }}<a href="{{ .GeneratorURL }}">source</a> | {{ end }}{{ if gt (len .SilenceURL) 0 }}<a href="{{ .SilenceURL }}">silence</a> | {{ end }}{{ if gt (len .DashboardURL) 0 }}<a href="{{ .DashboardURL }}">dashboard</a> | {{ end }}{{ if gt (len .PanelURL) 0 }}<a href="{{ .PanelURL }}">panel</a> |{{ end }}
—
{{ end }}{{ end }}
{{ define "telegram.message" }}
{{ if gt (len .Alerts.Firing) 0 }}FIRING!!!