Skip to content

Instantly share code, notes, and snippets.

View subzeta's full-sized avatar
🎯
Focusing

Sergio Cadu subzeta

🎯
Focusing
View GitHub Profile
@subzeta
subzeta / gist:26cd1a1f1526411862b3a3a0b4422d3d
Last active September 5, 2019 20:29
How to create a Grafana bot for Telegram
  1. Go to Grafana > Alerting > Notification channels > New channel.
  2. Type: Telegram. It will ask you for a Bot API Token and a Chat ID.
  3. Open a chat with BotFather on Telegram.
  4. Type /newbot
  5. Type your bots name. F.e: Grafana Bot
  6. Type your bots username. F.e: a_new_grafana_bot
  7. You have your Bot API Token. Paste it on Grafana.
  8. Open this URL address, substituing YOUR_API_TOKEN_KEY with yours: https://api.telegram.org/botYOUR_API_TOKEN_KEY/getUpdates
  9. The response may look like this: {"ok":true,"result":[{"update_id":BLA_BLA_BLA", chat":{"id":[CHAT_ID],"title". Copy that CHAT_ID, even with the minus sign.
![](IMAGE_URI)
@subzeta
subzeta / errors-redsys.php
Last active September 6, 2016 09:32
RedSys Errors
<?php
$errors = [
'SIS0007' => 'Error al desmontar el XML de entrada o error producido al acceder mediante un sistema de firma antiguo teniendo configurado el tipo de clave HMAC SHA256',
'SIS0008' => 'Error falta Ds_Merchant_MerchantCode ',
'SIS0009' => 'Error de formato en Ds_Merchant_MerchantCode ',
'SIS0010' => 'Error falta Ds_Merchant_Terminal ',
'SIS0011' => 'Error de formato en Ds_Merchant_Terminal ',
'SIS0014' => 'Error de formato en Ds_Merchant_Order',
'SIS0015' => 'Error falta Ds_Merchant_Currency',