#!/usr/bin/env python | |
import argparse | |
import redis | |
def connect_redis(conn_dict): | |
conn = redis.StrictRedis(host=conn_dict['host'], | |
port=conn_dict['port'], | |
db=conn_dict['db']) | |
return conn |
Create file /etc/systemd/system/[email protected]
. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin
, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform
.
I wrote this gist
because I didn't found a clear, end-to-end example on how to achieve this task. In particular,
I understood the resource "aws_lambda_permission" "cloudwatch_allow"
part by reading a couple of bug reports plus
this stackoverflow post.
The js
file is actually the Lambda function automatically created by AWS when creating this pipeline through the
web console. I only added a endpoint
variable handling so it is configurable from terraform
.
CREATE TABLE ascii_random_data ENGINE=TinyLog | |
AS | |
WITH | |
arrayStringConcat( | |
arrayMap( | |
x -> reinterpretAsString( toUInt8( rand(x) % 96 + 0x20 ) ), | |
range( 1024 ) | |
) | |
) as str1024, | |
substring(str1024, 1, 512 + bitAnd(rand(),0x1FF) ) as str |
events { | |
worker_connections 1024; | |
} | |
http { | |
# google's DNS server | |
resolver 8.8.8.8; | |
resolver_timeout 5s; | |
server { | |
# proxy server port |
#!/bin/bash | |
# need API_KEY as parameter | |
if [ ! $# -eq 3 ] | |
then | |
echo "Usage: artifact_download_test.sh <API_KEY> <outer_loop> <inner_loop>" | |
exit 1 | |
fi | |
echo "Download testing started" |
Github Actions is a CI/CD platform that gained a lot of popularity recently. I participated in building ⭐️ Lighthouse CI Action and was curious how well it performs.
But Github Marketplace UI shows no ranking information. Essentially, It's a search with random results; at least, I don't understand the order. I couldn't find ⭐️ Lighthouse CI Action in Continuous integration category after browsing 50 available pages (Each page shows 20 results, so it's possible to see only 1000 results, but CI category has 1469 😐).
I decided to build a custom script that crawls all categories and use Github Search (example query) to estimate usa