- Go to Grafana > Alerting > Notification channels > New channel.
- Type: Telegram. It will ask you for a Bot API Token and a Chat ID.
- Open a chat with BotFather on Telegram.
- Type
/newbot
- Type your bots name. e.g.
Grafana Bot
- Type your bots username. e.g.
a_new_grafana_bot
- You get your Bot API Token. Paste it on Grafana.
- Before making getUpdates (in the next step) you should add your bot into your telegram client and run
/start
. Thus you start chatting with the bot and this room is assigned chat id. (Thanks to @KES777)
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags. | |
curl -H "Accept: application/vnd.github.mercy-preview+json" \ | |
https://api.github.com/search/repositories?q=topic:ecs+topic:go | |
Response from the github can be rather verbose so lets filter only relavant info such repo url and description. | |
curl -H "Accept: application/vnd.github.mercy-preview+json" \ | |
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}' |
package YOURAPP::Logger; | |
use strict; | |
use DateTime; | |
use IO::Handle; | |
use Log::Log4perl qw(:easy); | |
if ( $ENV{YOURAPP_API_LOG_DIR} ) { | |
if ( -d $ENV{YOURAPP_API_LOG_DIR} ) { | |
my $date_now = DateTime->now->ymd('-'); |
create schema if not exists utils; | |
create table utils.replaceable_now ( the_time timestamp with time zone ); | |
CREATE OR REPLACE FUNCTION replaceable_now() RETURNS timestamp with time zone AS $AA$ | |
SELECT coalesce((select the_time from utils.replaceable_now limit 1), now()); | |
$AA$ LANGUAGE SQL STABLE; | |
/* | |
-- run in prod: |
package example.postgres.audit; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.sql.CallableStatement; | |
import java.sql.Connection; | |
import java.sql.PreparedStatement; | |
import java.sql.SQLException; | |
import java.sql.Savepoint; |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
- Go HTTP standalone (as the control group)
- Nginx proxy to Go HTTP
- Nginx fastcgi to Go TCP FastCGI
- Nginx fastcgi to Go Unix Socket FastCGI
package Mojolicious::Plugin::Coro; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use Coro; | |
use Mojo::IOLoop; | |
# Wrap application in coroutine and reschedule main coroutine in event loop | |
sub register { | |
my ($self, $app) = @_; | |
my $subscribers = $app->plugins->subscribers('around_dispatch'); |