Skip to content

Instantly share code, notes, and snippets.

View miry's full-sized avatar

Michael Nikitochkin miry

View GitHub Profile
@miry
miry / volumes.tf
Created March 18, 2018 19:05
REsize Amazon EBS volumes without a reboot: Step 3 Execute a script
// volumes.tf
// ...
resource "null_resource" "expand_disk" {
connection {
type = "ssh"
user = "ubuntu"
private_key = "${file("~/.ssh/id_rsa")}"
host = "${data.aws_instance.mysql.public_ip}"
}
@miry
miry / volumes.tf
Created March 18, 2018 19:00
REsize Amazon EBS volumes without a reboot: Step 2 Detect device name in the instance base on tags
// volumes.tf
// ...
locals {
mount_point = "${aws_ebs_volume.mysql.tags["opsworks:mount_point"]}"
}
@miry
miry / volumes.tf
Last active March 18, 2018 18:59
REsize Amazon EBS volumes without a reboot: Step 2 Detect device name in the instance
// volumes.tf
// ...
locals {
mount_point = "${data.aws_instance.mysql.ebs_block_device.0.device_name}"
}
@miry
miry / volumes.tf
Created March 18, 2018 18:54
REsize Amazon EBS volumes without a reboot: Step 2 Detect instance IP base on attached volume
// volumes.tf
// ...
data "aws_instance" "mysql" {
filter {
name = "block-device-mapping.volume-id"
values = ["${aws_ebs_volume.mysql.id}"]
}
}
output "instance_id" {
@miry
miry / volumes.tf
Created March 18, 2018 18:51
REsize Amazon EBS volumes without a reboot: Step 1 Update the resource with new size
// volumes.tf
resource "aws_ebs_volume" "mysql" {
availability_zone = "us-east-1a"
size = 2000
type = "gp2"
tags {
Name = "mysql"
Role = "db"
Terraform = "true"
FS = "xfs"
@miry
miry / volumes.tf
Created March 18, 2018 18:49
REsize Amazon EBS volumes without a reboot: Step 1 Create a terraform resource
// volumes.tf
resource "aws_ebs_volume" "mysql" {
availability_zone = "us-east-1a"
size = 1000
type = "gp2"
tags {
Name = "mysql"
Role = "db"
Terraform = "true"
FS = "xfs"
@miry
miry / rbac_role_cluster.yaml
Created March 4, 2018 08:29
Example of roles in K8S with RBAC
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: staging-node-user
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
@miry
miry / List.go
Created January 16, 2018 10:08
List created by miry - https://repl.it/@miry/List
package main
import "fmt"
import "errors"
type Node struct {
next *Node
value string
}
@miry
miry / scrapper.rb
Created September 10, 2017 21:13
Test app to run headless chrome with capybara
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
require 'logger'
Bundler.require
Capybara.register_driver(:headless_chrome) do |app|
@miry
miry / Brewfile
Last active October 28, 2023 11:52
MacOS Brewfile to install default applications. https://github.com/Homebrew/homebrew-bundle
#cask_args appdir: "~/Applications", require_sha: true
cask 'spotify'
cask 'homebrew/cask-versions/firefox-developer-edition'
cask 'signal'
cask 'keybase'
cask 'slack'
cask 'telegram-desktop'