Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

  • Unity-Technologies
  • United Kingdom
View GitHub Profile
@holms
holms / do-db-psql.tf
Created April 17, 2023 16:35
Terraform Digital Ocean Postgresql Database Cluster
resource "digitalocean_vpc" "myvpc" {
name = "myvpc"
region = "fra1"
ip_range = "10.10.10.0/24"
}
resource "digitalocean_database_cluster" "mycluster" {
name = "mycluster"
engine = "pg"
version = "14"
@holms
holms / az-pgsql.tf
Last active April 17, 2023 15:53
terraform azure postgresql flexible server
resource "azurerm_postgresql_flexible_server" "mydb" {
name = "pbs-northeurope"
location = azurerm_resource_group.mycompany.location
resource_group_name = azurerm_resource_group.mycompany.name
administrator_login = "psqladmin"
administrator_password = "mypassword"
sku_name = "MO_Standard_E4s_v3"
version = "12"
@holms
holms / gist:f6248de0bf3dcbcb956162d08562af7e
Created December 27, 2022 03:06
Kusto - provision database with terraform from local file
resource "azurerm_kusto_script" "example" {
name = "example-script"
database_name = azurerm_kusto_database.example.name
cluster_name = azurerm_kusto_cluster.example.name
content_script = file("path/to/script.csl")
force_an_update_when_value_changed = md5(file("path/to/script.csl"))
}
@holms
holms / client.go
Created March 6, 2020 12:55
go problem
package aerospike_shared
import (
"bytes"
"fmt"
"log"
"math"
"os"
"runtime"
"strconv"
@holms
holms / plan.md
Last active July 8, 2019 23:17
Plan

As iskart noriu ispeti kad cia ieina beveik visa devops engineer'ingo geriausios praktikos (jos yra viesai zinomos ir istirtos per 50000 imoniu worldwide), ir cia tikrai nebus lengva suprasti. As jau taip bandziau abstraguotis ant kiek tik galejau ir tai tikrai nera lengva padaryti. Prasau klausk bet kokio termino kurio nesupranti. Cia yra metodologija ir as cia realiai atpasakoju savo darba. Ne techniniam zmogui tai pakankami didele informacine bomba.

Koks devops tikslas

Devops praktikos skirtos pagreitinti produkto gamyba, pastatyti produkta ant konvejerio. Viska automatizuoti iki maksimumo ir sumazinti palaikymo kastus iki minimo, ko maziau human factor, to geriau, nebent nori procesa pagerinti.

  • Automatinis infrastrukturos pletimo igyvendinimas naudojant debesu (CLOUD) technologija. (Nuomojames resursus tiek kiek reikia is kitu, siuo atveju is AWS, pvz serveri su tiek ramais ir vieta kiek mums reikia, ir galimybe bet kada pakeisti jo konfiguracija, ir startuoti tiek serveriu kiek mums reikia musu sp
@holms
holms / credstash.tf
Created November 13, 2018 00:46
Terraform credstash
Perfect free secrets manager approach
# Cli tool: https://github.com/fugue/credstash
# Setup module for DynamoDB/KMS: https://github.com/fpco/terraform-aws-foundation/tree/master/modules/credstash-setup
# Terraform credstash provider: https://github.com/sspinc/terraform-provider-credstash
@holms
holms / terraform.tf
Created November 13, 2018 00:44
Terraform modules depends_on workaround
# File fancy-app-module/variables.tf
variable depends_on { default = [], type = "list"}
# File my-app.tf
module "app" {
source = "modules/fancy-app-module"
@holms
holms / Dockerfile
Created September 7, 2018 20:06
problem with volumes
FROM bitnami/minideb-extras:stretch-r131
LABEL maintainer "Bitnami <[email protected]>"
ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
HOME="/"
# Install required system packages and dependencies
RUN install_packages libblkid1 libbsd0 libc6 libffi6 libgcc1 libglib2.0-0 libmount1 libpcre3 libselinux1 libstdc++6 libuuid1 libx11-6 libxau6 libxcb1 libxdmcp6 libxext6 zlib1g
RUN bitnami-pkg install java-1.8.181-1 --checksum 66bba4b4a2647f981339d306da796905c222057c4277a5ef045e079981a404f4
RUN bitnami-pkg unpack kafka-2.0.0-1 --checksum a5c583db6dce68f8c71e1f7bd3c927639ede08f8043cb699049041344c35449c
@holms
holms / dark.md
Created August 8, 2018 07:56 — forked from a7madgamal/dark.md
Dark mode for Slack on MacOS
  1. Close slack
  2. Open this file /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
  3. Append this to it
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
 $("").appendTo('head').html(css);
@holms
holms / migrate-backend.sh
Created April 20, 2018 14:10
Splitting folder to separate git repositories
# So we have this situation: repo `app` which has `serverapp` folder inside which we want to convert to separate repo
rm -rf app
rm -rf app-server
git clone [email protected]:xxxx/app.git
cp -R app app-server
cd app-server
git filter-branch --prune-empty --subdirectory-filter serverapp master
echo node_modules/ >> .gitignore # For node.js only
git add .gitignore # For node.js only
git commit -m 'Remove node_modules from git history' # For node.js only