Skip to content

Instantly share code, notes, and snippets.

View hgranillo's full-sized avatar

Horacio Granillo hgranillo

View GitHub Profile
@juliohm1978
juliohm1978 / drain.sh
Last active September 20, 2024 07:21
A bash alternative to kubectl drain
#!/bin/bash
##
## This aims to be an alternative to `kubectl drain NODE`, overcoming
## some of its limitations. A GitHub issue was closed a while ago
## without any solution or alternatives.
##
## https://github.com/kubernetes/kubernetes/issues/48307
##
## Even though `kubectl drain` respects PDBs defined by the user,
@matthamil
matthamil / sync_wow_addons.md
Last active December 10, 2022 21:41
Syncing WoW Addons across multiple computers

If you play WoW on multiple computers and have addons installed on one of them, you probably wish you could have the same addons installed on all of your machines. This is a guide to sync addons across multiple machines (and preserve their settings, too!).

Prerequisites

You will need the following:

  1. Google Account
  2. Google Drive storage space equal or greater than the size of your World of Warcraft\_classic_\Interface\AddOns directory.
  3. Addons you have already downloaded in your World of Warcraft\_classic_\Interface\AddOns directory.
@djfdyuruiry
djfdyuruiry / multi_brach_dsl_with_custom_strategy_and_script_path.groovy
Last active November 24, 2021 04:47
Jenkins Job DSL for a Multi-Branch Pipeline that includes Branch Source Strategy & custom Jenkinsfile script path
// A new UUID must be generated for the first run and re-used for your Job DSL, the plugin updates jobs based on ID
UUID uuid = UUID.fromString("dd847135-8391-4f66-a54c-7f8781dc3119") // generate one @ https://www.uuidgenerator.net
multibranchPipelineJob("my_awesome_job") {
displayName "my awesome job"
description "multi-branch pipeline job thingy"
configure {
it / sources / 'data' / 'jenkins.branch.BranchSource' << {
source(class: 'jenkins.plugins.git.GitSCMSource') {
id(uuid)
cat image.jpg | base64 | vault write /secret/image.jpg value=-
vault read -format=raw -field=value /secret/image.jpg | base64 --decode > image.out.jpg
@hflamboauto1
hflamboauto1 / setup_osx.sh
Created November 1, 2016 13:54 — forked from dstapp/setup_osx.sh
OS X setup script (currently 10.11)
#!/bin/bash
# Homebrew requires Xcode CLI tools to be installed. OS X provides stubs for CLI tools
# that trigger the CLI tools installer when called. So we call `git` to start the installation.
git
echo "Press any key when Xcode CLI tools installation is complete..."
read
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active September 7, 2024 16:25
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@kennwhite
kennwhite / Nginx_1.11_Mainline_Cent_6_7_Static_OpenSSL_1.1.sh
Last active July 22, 2019 01:55
RPM build Nginx 1.11.x with ALPN on CentOS 6/7 using static OpenSSL 1.1 (v 1.02+ required for http/2 support in Chrome)
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7
CENTVER="6"
OPENSSL="openssl-1.1.0-pre5"
NGINX="nginx-1.11.0-1"
yum clean all
# Install epel packages (required for GeoIP-devel)
@leommoore
leommoore / mongodb_3.2.x_replica_sets_on_aws_ec2.md
Last active March 15, 2022 22:28
MongoDB 3.2.x Replica Sets on AWS EC2

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

@magnetikonline
magnetikonline / README.md
Last active December 25, 2018 13:03
SSH forward local port to remote AWS RDS MySQL instance.

SSH forward local port to remote AWS RDS instance

The scenario:

  • We have connectivity to remote server (EC2 instance) REMOTE_EC2_HOST over SSH.
  • Connectivity to AWS RDS MySQL instance RDS.ENDPOINT.rds.amazonaws.com from remote server only (due to security group/firewall settings).
# forward requests from 127.0.0.1:6400 -> RDS.ENDPOINT.rds.amazonaws.com:3306
# add [-f] switch to background ssh process
$ ssh -vvvN \
	-L 6400:RDS.ENDPOINT.rds.amazonaws.com:3306 \