Skip to content

Instantly share code, notes, and snippets.

@innovia
innovia / ElasticSearch Unassigned Shards Reassigner
Created June 30, 2015 11:32
ElasticSaerch unassigned shards reassign
#!/usr/bin/env ruby
require 'json'
es_cluster = 'http://localhost:9200'
master_node = "Howard the Duck" # sey your master node name here
unassigned_shards_info = `curl -s -XGET #{es_cluster}/_cat/shards | grep UNASSIGNED `.split("\n")
shard_indexes = []
@innovia
innovia / setup_confg.yaml
Created September 9, 2017 09:02
Basic setup_config file
---
name: "MyProject"
description: "Some Django App"
manifest:
graft: "location/to/Django/staticfiles"
prune: "some-un-needed folder"
@innovia
innovia / values.yaml
Created February 11, 2018 19:10
Vault chart values
# Default values for vault.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 3
image:
repository: vault
tag: 0.9.3
pullPolicy: IfNotPresent
service:
name: vault
@innovia
innovia / update_tags.sh
Created March 27, 2018 06:53
Update force existing tags
Delete the tag on any remote before you push
git push origin :refs/tags/<tagname>
Replace the tag to reference the most recent commit
git tag -fa <tagname>
Push the tag to the remote origin
git push origin master --tags
apiVersion: v1
kind: Pod
metadata:
name: gpu-pod
spec:
containers:
- name: cuda-container
image: nvidia/cuda:9.0-devel
resources:
limits:
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
labels:
name: p3.2xlarge
spec:
image: My-k8s-1.9-debian-stretch-2018-05-03
kubelet:
featureGates:
DevicePlugins: "true"
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nvidia-device-plugin-daemonset
namespace: kube-system
spec:
template:
metadata:
# Mark this pod as a critical add-on; when enabled, the critical add-on scheduler
# reserves resources for critical add-on pods so that they can be rescheduled after
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
apt-get update && sudo apt-get install -y \
apt-transport-https \
ca-certificates \
@innovia
innovia / Dockerfile
Last active December 9, 2018 15:13
Dockerfile MultiStage SSH Mount
# syntax=docker/dockerfile:1.0.0-experimental
## For this to work you must run `export DOCKER_BUILDKIT=1`
## then build using the command
## docker build --ssh github_ssh_key=/Users/<your_username>/.ssh/id_rsa .
## Stage 1
FROM python:2.7.15-alpine3.7 AS base
## main.tf
resource "aws_s3_bucket" "s3_bucket" {
count = "${var.enabled}"
bucket = "${local.bucket_name}"
region = "${var.region}"
force_destroy = "${var.force_destroy}"
acl = "private"
versioning = {
enabled = "${var.versioning_enabled}"