Skip to content

Instantly share code, notes, and snippets.

View random-ua's full-sized avatar

Alexander Kostyuchenko random-ua

View GitHub Profile
@lucjross
lucjross / .tf
Last active May 20, 2020 02:54
ALB Listener Rule, weighted Target Groups
resource "aws_alb_listener_rule" "http_80" {
count = local.lb ? 1 : 0
listener_arn = data.aws_alb_listener.http_80.arn
action {
type = "forward"
target_group_arn = aws_alb_target_group.http_80[0].arn
}
condition {
host_header {
values = [local.host_name]
@figassis
figassis / README.md
Last active April 6, 2024 15:53
Deploy AWS Storage Gateway on VirtualBox

Update Ubuntu

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

Install Required Linux Headers

sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms ufw apt-transport-https ca-certificates curl software-properties-common

Add VirtualBox Repository and key

@chromko
chromko / monzo-alertmanager-config.yaml
Created August 27, 2019 15:41 — forked from milesbxf/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active May 15, 2024 19:37
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@markjlorenz
markjlorenz / simple-exec-with-docker-remote-api.sh
Created July 23, 2016 16:05
Using the exec command with the docker API, and capturing output
#! /usr/bin/env bash
# Create the container with a long running process. If PID1 exists before
# we send the exec commands, they will fail because the container is not running
#
CONTAINER_NAME="TEST-`uuidgen`"
curl --silent --unix-socket /var/run/docker.sock "http:/containers/create?name=${CONTAINER_NAME}" -XPOST \
-H "Content-Type: application/json" \
-d '{
"Image": "ruby:latest",
@sbuzonas
sbuzonas / nginx-cors.conf
Created September 8, 2015 15:36
Nginx CORS maps
map $http_origin $allow_origin {
default "";
"~^https?://(?:[^/]*\.)?(stevebuzonas\.(?:com|local))(?::[0-9]+)?$" "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
cssmin = require('gulp-minify-css'),
@pudquick
pudquick / exec-priv.sh
Created August 18, 2014 00:14
An example of using execute-with-privileges verb of security command to bypass GUI for a CLI authorization prompt
# This expects that you're already running as sudo'd / root account
cat <<EOF | security -i
authorize -C adminUserNameHere com.apple.uninstalld.uninstall
execute-with-privileges /usr/sbin/uninstall /Applications/SomeMASapp.app
EOF
# In the example above, if you're already running as root / sudo'd admin,
# you still get a prompt for the password of the account in question.
# We aren't dodging proving we know the password - we're just doing it
DOWNLOAD_HANDLERS = {
'http': 'myspider.socks5_http.Socks5DownloadHandler',
'https': 'myspider.socks5_http.Socks5DownloadHandler'
}