Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
@Voronenko
Voronenko / cronjob.yaml
Created February 23, 2021 08:03
Nightly rollout on schedule
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: specific-deployment-restart
namespace: <YOUR NAMESPACE>
spec:
concurrencyPolicy: Forbid
schedule: '0 8 * * *' # cron spec of time, here, 8 o'clock
jobTemplate:
spec:
bind C send-keys -t.- 'mvn install' Enter
The -t.- means "the other pane". Enter stands for the key of that name, i.e. the newline at the end of the command.
tmux bind-key "$KEY" run-shell "/path/to/script.sh"
@Voronenko
Voronenko / sh2ju.sh
Created February 1, 2021 09:50 — forked from double16/sh2ju.sh
junit bash commands
#!/bin/bash
### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org)
### Copyright 2016 Patrick Double (pat at patdouble.com)
###
### Licensed under the Apache License, Version 2.0.
### You may obtain a copy of it at
### http://www.apache.org/licenses/LICENSE-2.0
###
### A library for shell scripts which creates reports in jUnit format.
@Voronenko
Voronenko / 2020-nginx-a+.conf
Created January 28, 2021 18:35
up to date A+ grade
# SSL Settings
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
# OCSP stapling
- repo: local
hooks:
- id: terragrunt-atlantis-config
name: "Update atlantis.yaml config"
entry: terragrunt-atlantis-config generate --autoplan --workflow terragrunt --output atlantis.yaml --root . --ignore-parent-terragrunt --parallel=false --preserve-workflows
language: system
@Voronenko
Voronenko / esxi_usb_stick_notes.sh
Created January 13, 2021 10:00
Notes on cloning bootable ESX stick
#!/bin/bash
# existing stick to image on hdd
sudo dd if=/dev/sdc of=/home/slavko/usb-esxi67-8G.img bs=1M status=progress
# from image on hdd to existing stick
sudo dd if=/home/slavko/usb-esxi67-8G.img of=/dev/sdc bs=4M status=progress
version: '3.7'
volumes:
prometheus_data: {}
grafana_data: {}
services:
prometheus:
#!/usr/bin/env python3
import click
import yaml
# define a custom representer for strings
def quoted_presenter(dumper, data):
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='"')
yaml.add_representer(str, quoted_presenter)
data "aws_ami" "instance_ami" {
most_recent = true
owners = [
var.ubuntu_account_number]
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"]
}
}
#!/bin/bash
# Author: dj-mcculloch
# Documentation: https://dj-does.medium.com/nfs-mounts-and-wake-on-lan-25c0c1d55c90
# Adaptation of rufflove's comment solution (https://www.blogger.com/profile/01096649615527099308) via tech-bodges'
# blog post from 2010 http://tech-bodges.blogspot.com/2010/06/linux-autofs-and-wake-on-lan-bodge.html as well as
# bryanchicken's post (https://forum.kodi.tv/showthread.php?tid=118164)
# {NFS_IP} is where you would put in your NFS' IPv4 address, e.g. the IP