Skip to content

Instantly share code, notes, and snippets.

View dileeph's full-sized avatar

Dileep Hareendran dileeph

View GitHub Profile
@dileeph
dileeph / code commit init
Created May 4, 2016 20:58
initializing Codecommit in aws
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
@dileeph
dileeph / kubernetes namespace
Created May 3, 2016 21:21
kubernetes namespace creation
$ kubectl create -f geolocus-namespace.json
$ kubectl --namespace geolocus-ns create -f bs-quota.json
$ kubectl --namespace geolocus-ns create -f bs-limits.json
$ kubectl describe limits bs-limits --namespace geolocus-ns
@dileeph
dileeph / resource limits json
Created May 3, 2016 21:18
resource limits json for kubernetes
{
"kind": "LimitRange",
"apiVersion": "v1",
"metadata": {
"name": "bs-limits"
},
"spec":{
"limits":[
{
"max":{"cpu":"1", "memory":"1Gi"},
@dileeph
dileeph / resource quota json
Last active May 3, 2016 21:09
resource quota json for a kubernetes namespace
{
"apiVersion": "v1",
"kind": "ResourceQuota",
"metadata": {
"name": "bs-quota"
},
"spec": {
"hard": {
"memory": "1Gi",
"cpu": "1",
@dileeph
dileeph / namespace json
Created May 3, 2016 21:00
namespace json for kubernetes
{
"kind": "Namespace",
"apiVersion": "v1",
"metadata": {
"name": "geolocus-ns"
}
}
@dileeph
dileeph / authenticated-rest-call
Created January 7, 2016 00:42
authenticated-rest-call
package com.dh.ts.repo;
import java.net.URI;
import java.nio.charset.Charset;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@dileeph
dileeph / jenkins-workflow-docker-stash
Created January 5, 2016 21:50
jenkins workflow using 'stash' to pass files between two docker containers
node{
docker.image('buildpack-deps:jessie-scm').inside {
sh "echo 'hello' >> a.txt"
stash includes: 'a.txt', name: 'pom'
}
docker.image('buildpack-deps:jessie-scm').inside {
unstash 'pom'
sh "cat a.txt"
}
@dileeph
dileeph / gist:456755d11c1c6d6f0a56
Last active January 5, 2016 00:03
kubernetes-json-files
{
"kind": "ReplicationController",
"apiVersion": "v1",
"metadata": {
"name": "claims-web-controller",
"labels": {
"state": "serving"
}
},
@dileeph
dileeph / gist:8d5a23220db55955fa36
Created January 2, 2016 23:11
jenkins-workflow-example-1
stage 'Dev'
node {
git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
mvn 'clean package'
}
def mvn(args) {
sh "${tool 'M3'}/bin/mvn ${args}"
}
@dileeph
dileeph / gist:c5f9eae2f971d91e1dda
Created January 2, 2016 05:12
Getting List of Objects with RestTemplate in Spring
RestTemplate restTemplate = new RestTemplate();
try {
ResponseEntity<List<Claim>> claimResponse = restTemplate.exchange(
uri,
HttpMethod.GET,
null,
new ParameterizedTypeReference<List<Claim>>() {});
if(claimResponse != null && claimResponse.hasBody()){
claims = claimResponse.getBody();