Skip to content

Instantly share code, notes, and snippets.

@amitaymolko
amitaymolko / HttpRequest.java
Last active August 15, 2020 01:53
Simple HttpURLConnection wrapper class
package com.amitaymolko.network;
import java.util.HashMap;
/**
* Created by amitaymolko on 2/16/16.
*/
public class HttpRequest {
'use strict';
var NodeRSA = require('node-rsa');
var CryptoJS = require('crypto-js');
const crypto = require('crypto')
let generateKeyPair = (password) => {
let key = new NodeRSA();
key.generateKeyPair()
let publicKey = Buffer.from(key.exportKey('public')).toString('base64')
@amitaymolko
amitaymolko / gist:5865e9fdef6bf47ffc2323c813edd40d
Created June 28, 2019 07:31
Haproxy containers logs - unexpected behavior
HA1:
06:49:12
Jun 28 06:49:12 5ff0d8408113 haproxy[127]: backend www-backend-test-git has no server available!
06:49:12
Jun 28 06:49:12 5ff0d8408113 haproxy[127]: backend www-backend-test-git has no server available!
06:49:12
Jun 28 06:49:12 5ff0d8408113 haproxy[127]: backend www-backend-test-git has no server available!
06:49:13
Jun 28 06:49:13 5ff0d8408113 haproxy[127]: www-backend-test-git/test-git2 changed its IP from to 172.18.1.197 by awsdns/default.
06:49:13
'use strict';
const NodeRSA = require('node-rsa');
const crypto = require('crypto')
let generateKeyPair = (password) => {
let key = new NodeRSA();
key.generateKeyPair()
let publicKey = Buffer.from(key.exportKey('public')).toString('base64')
let privateKey = Buffer.from(key.exportKey('private')).toString('base64')
@amitaymolko
amitaymolko / aws-node.tf
Created November 4, 2019 12:17
aws-node iam annotation
resource "null_resource" "aws-node-iam" {
provisioner "local-exec" {
command = "aws eks --region ${var.region} update-kubeconfig --name ${var.cluster_name} && kubectl annotate sa aws-node -n kube-system eks.amazonaws.com/role-arn=${aws_iam_role.cni-role.arn}"
}
provisioner "local-exec" {
when = "destroy"
command = "aws eks --region ${var.region} update-kubeconfig --name ${var.cluster_name} && kubectl annotate sa aws-node -n kube-system eks.amazonaws.com/role-arn-"
}