Skip to content

Instantly share code, notes, and snippets.

Suresh Prajapati toddlers

Block or report user

Report or block toddlers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@innovia
innovia / lambda-concurrency-to-cloudwatch.py
Created Dec 17, 2017
Lambda concurrent execution custom metric on CloudWatch
View lambda-concurrency-to-cloudwatch.py
#!/usr/bin/env python
import boto3
import datetime
import time
ENABLED_REGIONS = [
"us-east-1",
"us-west-2",
"eu-west-1",
"eu-central-1",
@rkrzr
rkrzr / auto_tags.py
Last active Jul 8, 2019
Automatically generate ansible tags of the same name for each role in a playbook
View auto_tags.py
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@irvingpop
irvingpop / ssh_key.tf
Last active Sep 12, 2019
Terraform external data source example - dynamic SSH key generation
View ssh_key.tf
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@so0k
so0k / kubectl.md
Last active Sep 13, 2019
Playing with kubectl output
View kubectl.md

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
View docker-cli-tips-and-tricks.md
@pablitoc
pablitoc / configure_proxy_protocol.md
Last active Oct 24, 2017
Configuring Proxy Protocol
View configure_proxy_protocol.md

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"

@kcd83
kcd83 / gist:79030f14be869f4884d0
Last active Aug 29, 2015 — forked from tehranian/gist:7123269
Allow SSH on ports other than 22 and create the directory
View gist:79030f14be869f4884d0
#!/bin/bash
# High-performance, native SSH implementation for Jenkins SSH slaves. Jenkins'
# standard turn-key SSH slave implementation uses an embedded, "pure Java"
# implementation of SSH (https://github.com/jenkinsci/trilead-ssh2).
# That standard implementation combines all of the convenience of a pure Java
# implementation with all of the "performance" of a pure Java implementation :P
# If your distributed build process generates large build artifacts like ISOs,
# VM images, Vagrant boxes, etc, then you will see a substantial benefit from
@davidkelley
davidkelley / network.template
Created Apr 13, 2014
AWS Cloudformation that launches Private and Public Subnets inside a configured VPC complete with a Bastion Host
View network.template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Creates networking infrastructure.",
"Parameters" : {
"BastionKeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the bastion host",
"Type" : "String",
@regit
regit / Netfilter-dashboard
Created Mar 23, 2014
Netfilter Kibana Dashboard
View Netfilter-dashboard
{
"title": "Netfilter Logs",
"services": {
"query": {
"list": {
"0": {
"query": "dvc:*",
"alias": "Netfilter",
"color": "#7EB26D",
"id": 0,
@hwdsl2
hwdsl2 / .MOVED.md
Last active Aug 24, 2019
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
View .MOVED.md
You can’t perform that action at this time.