Skip to content

Instantly share code, notes, and snippets.

View metanovii's full-sized avatar
💭
\m/_(>_<)_\m/

Sergey Mikhaltsov metanovii

💭
\m/_(>_<)_\m/
View GitHub Profile
@metanovii
metanovii / unbound-local-dns-cache.yml
Created September 9, 2025 19:16
unbound-local-dns-cache.yml
apiVersion: v1
kind: ServiceAccount
metadata:
name: unbound
namespace: kube-system
---
apiVersion: v1
kind: Service
metadata:
name: kube-dns-upstream
@metanovii
metanovii / values.yml
Created January 15, 2025 18:22
nginx ingress helm values
controller:
ingressClass: nginx
kind: Deployment
config:
map-hash-bucket-size: "128"
generate-request-id: true
use-geoip: false
use-geoip2: true
proxy-body-size: 25m
client-body-buffer-size: 2k
@metanovii
metanovii / config.json
Created December 25, 2024 18:10
nginx-unit php symfony
{
"listeners": {
"*:8080": {
"pass": "routes"
}
},
"access_log": {
"if": "`${uri == '/healthz' ? false : true}`",
"path": "/dev/stdout",
@metanovii
metanovii / JetBrains trial reset.md
Created October 27, 2024 19:43
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@metanovii
metanovii / snat_dnat_advantech.md
Created May 17, 2024 13:28 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

resources:
- apiVersion: v1
metadata:
name: hcloud
data:
token: "${hcloud_token}"
kind: Secret
type: Opaque
@metanovii
metanovii / script_for_check_local_certificate_s_terra.md
Last active June 23, 2023 09:08
script_for_check_local_certificate_s_terra

Скрипт для получения времени жизни сертов:

#!/bin/bash

output=$(cert_mgr show)
get_date_diff() {
  local start_date=$1
  local end_date=$2
  local start_sec=$(date -d "$start_date" +%s)
  local end_sec=$(date -d "$end_date" +%s)

Looking to create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04?

Screen Shot 2020-06-05 at 20 55 31

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/install/storage) is outdated/wrong. And as of March 2021 it's possible that there's a bug as well with how the bios_grub partitions are created when using multiple disks.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage configuration step of the installer.
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.
@metanovii
metanovii / terraform_crd.tf
Last active October 21, 2022 08:52
deploy CR/CRD via kubectl provider
terraform {
required_version = ">= 0.14"
required_providers {
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.14.0"
}
}
}
1. prepare secret
❯ k -n victoriametrics describe secrets etcd-certificates
Name: etcd-certificates
Namespace: victoriametrics
Labels: <none>
Annotations: <none>
Type: Opaque