Skip to content

Instantly share code, notes, and snippets.

@soumentrivedi
soumentrivedi / script
Created Dec 9, 2016
Kubernetes-Setup-Hack-Session-1
View script
ID=$(uuidgen) && aws route53 create-hosted-zone --name k8s.testrun.dev --caller-reference $ID
aws s3api create-bucket --bucket k8s-testrun-dev-state-store --region eu-west-1
export NAME="firstcluster.cloud.dev.os.uk"
export KOPS_STATE_STORE="s3://k8s-testrun-dev-state-store"
$GOPATH/bin/kops create cluster \
--node-count 3 \
--zones eu-west-1a,eu-west-1b,eu-west-1c \
View DockerCloudNodes - AWS Autoregister
#!/bin/bash
export DOCKERCLOUD_APIKEY="YOUR-API-KEY"
export DOCKERCLOUD_USER="YOUR-USERNAME"
#Setup environment variables & aliases
if [ -z "$S3_BUCKET" ]; then
S3_BUCKET="S3-BUCKET-NAME"
fi
View gist:099d74840a4f06d81103
http://forum.unity3d.com/threads/useful-github-repos-for-unity.258224/
@soumentrivedi
soumentrivedi / change_owner.sql
Last active Sep 27, 2018
Steps to perform pg_dump on Postgresql RDS instance
View change_owner.sql
alter schema schema_name1 owner to rds_superuser;
alter schema schema_name2 owner to rds_superuser;
\dn;
CREATE FUNCTION exec(text) returns text language plpgsql volatile AS $f$
BEGIN EXECUTE $1; RETURN $1; END; $f$;
SELECT exec('ALTER TABLE ' || quote_ident(s.nspname) || '.' || quote_ident(s.relname) || ' OWNER TO rds_superuser')
FROM (
SELECT nspname, relname
FROM pg_class c JOIN pg_namespace n ON (c.relnamespace = n.oid)
WHERE nspname in ('schema_name1', 'schema_name2') AND
@soumentrivedi
soumentrivedi / hiera.yaml
Created May 27, 2015
Hiera Eyaml - Separate encryption keys for every puppet environment
View hiera.yaml
---
:backends:
- eyaml
- yaml
:hierarchy:
- "nodes/%{::clientcert}"
- common
:yaml:
:datadir: /git_source/puppet/environments/%{::environment}/hieradata
@soumentrivedi
soumentrivedi / SonarQube-IssueLog
Last active Aug 29, 2015
SonarQube "coverage is set to 0% as no JaCoCo execution data has been dumped"
View SonarQube-IssueLog
In a multi-project based maven build with relatively larger unit tests, one would be familiar with the requirements of memory parameters such as Xmx, XX:MaxPermSize, etc passed with MAVEN_OPTS or within surefire plugin.
This also comes to help with issues of Java Code Coverage (jacoco) when performing analysis in SonarQube. Recently during analysis with sonarqube and jacoco as coverage plugin, we have been observing that our CI builds pass unit test but certain sub-projects report "coverage is set to 0% as no JaCoCo execution data has been dumped" and 0% code coverage is reported in the sonarqube dashboard. We have been able to get around this problem by using the following code snippet at the root pom.xml level
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>