Skip to content

Instantly share code, notes, and snippets.

@Lirt
Lirt / nginx-proxy-to-alertmanager.yaml
Created May 6, 2021 18:42
Nginx proxy for basic-auth from Loki to AlertManager
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-proxy-to-alertmanager
namespace: kube-system
labels:
app: nginx-proxy-to-alertmanager
group: monitoring
component: loki
$ terraform plan -target='google_project_iam_member.rec-serving-ebq-autoload-error-writer-member'
2019-12-19T00:11:35.015+0100 [DEBUG] plugin.terraform-provider-google_v2.20.1_x4: 2019/12/19 00:11:35 [DEBUG] Locking "iam-project-my-test-project"
2019-12-19T00:11:35.015+0100 [DEBUG] plugin.terraform-provider-google_v2.20.1_x4: 2019/12/19 00:11:35 [DEBUG] Locked "iam-project-my-test-project"
2019-12-19T00:11:35.015+0100 [DEBUG] plugin.terraform-provider-google_v2.20.1_x4: 2019/12/19 00:11:35 [DEBUG] Retrieving policy for project "my-test-project"
2019-12-19T00:11:35.015+0100 [DEBUG] plugin.terraform-provider-google_v2.20.1_x4: 2019/12/19 00:11:35 [DEBUG] Waiting for state to become: [success]
2019-12-19T00:11:35.018+0100 [DEBUG] plugin.terraform-provider-google_v2.20.1_x4: 2019/12/19 00:11:35 [DEBUG] Google API Request Details:
2019-12-19T00:11:35.018+0100 [DEBUG] plugin.terraform-provider-google_v2.20.1_x4: ---[ REQUEST ]---------------------------------------
2019-12-19T00:11:35.018+0100 [DEBUG] plugin.terra
+--------+
| 214 US |
| 28 GB |
| 17 IT |
| 15 ES |
| 15 CA |
| 8 DE |
| 4 IE |
| 3 KW |
| 3 IN |
IPs Country
214 US
28 GB
17 IT
15 ES
15 CA
8 DE
4 IE
ip_address state_code login_count
41.63.176.___ AO 8
200.80.227.___ AR 41
120.146.134.___ AU 18
79.132.239.___ BE 15
184.149.27.___ CA 1
24.37.20.___ CA 13
70.28.77.___ CA 21
70.25.65.___ CA 23
+-----------------+------------+-------------+
| ip_address | state_code | login_count |
+-----------------+------------+-------------+
| 41.63.176.___ | AO | 8 |
| 200.80.227.___ | AR | 41 |
| 120.146.134.___ | AU | 18 |
| 79.132.239.___ | BE | 15 |
| 184.149.27.___ | CA | 1 |
| 24.37.20.___ | CA | 13 |
| 70.28.77.___ | CA | 21 |
@Lirt
Lirt / vbox-mod-sign.sh
Last active February 3, 2019 10:54
Sign VirtualBox kernel modules to run with SecureBoot
#!/usr/bin/env bash
#
# Script for guide:
# https://gorka.eguileor.com/vbox-vmware-in-secureboot-linux-2016-update/
#
# Verification:
# dmesg | grep "EFI:.*cert.*${cert_name}"
#
set -eu
set -o pipefail
@Lirt
Lirt / digital-ocean.sh
Last active August 30, 2018 19:15
Phoronix test suite, Google PerfKit
# Install doctl
# https://github.com/digitalocean/doctl
cd /tmp && wget -qO - https://github.com/digitalocean/doctl/releases/download/v1.6.0/doctl-1.6.0-linux-amd64.tar.gz | tar -xzvf -
sudo mv /tmp/doctl /usr/local/bin/
# Install elasticsearch package for pushing data to ES
sudo pip install elasticsearch
ES_URI=''
# Setup credentials and access to DO
@Lirt
Lirt / images.sh
Last active December 11, 2017 08:31 — forked from smoser/gist:4756561
boot a cloud image in kvm
## Install a necessary packages
sudo apt-get install kvm cloud-utils genisoimage
modprobe kvm && modprobe kvm-intel
## URL to most recent cloud image of 16.04
img_url="http://cloud-images.ubuntu.com/server/releases/16.04/release"
img_url="${img_url}/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
## download the image
wget $img_url -O disk.img.dist
@Lirt
Lirt / interfaces.sh
Last active August 8, 2023 07:15
Useful things with linux networking
# Debian default gateway /etc/network/interfaces
up route add default gw 62.210.123.1
# Force interface eth0 to 10 Gbit speed
ethtool -s <device> speed 10000 duplex full autoneg off
# For the setting to be persistent across reboots
# edit "/etc/udev/rules.d/71-ethtool.rules"ff and
# add "SUBSYSTEM=="net", ACTION=="add", NAME=="<device>", RUN+="/sbin/ethtool <device> -s speed 100 duplex full autoneg off"