Skip to content

Instantly share code, notes, and snippets.

View aryak007's full-sized avatar

Aryak Sengupta aryak007

View GitHub Profile
@aryak007
aryak007 / jenkins-job-dsl.groovy
Created December 21, 2015 12:09 — forked from stuartstevenson/jenkins-job-dsl.groovy
Jenkins job dsl with distributed job config files. The seed.groovy file scans stash repo branches for jenkins-job-dsl.groovy files and runs them centrally.
Closure job = {
// Job Name
name "${stashProjectKey}-${projectName}-${branchSimpleName}"
// Where should jenkins run the job
label ('master')
// Where should Jenkins get the source code from
scm {
git {
@aryak007
aryak007 / centos7systemd.txt
Created December 18, 2017 06:42
Docker Notes
My guess is that you're running a non-privileged container. systemd requires CAP_SYS_ADMIN capability but Docker drops that capability in the non privileged containers, in order to add more security.
systemd also requires RO access to the cgroup file system within a container. You can add it with –v /sys/fs/cgroup:/sys/fs/cgroup:ro
So, here a few steps on how to run CentOS with systemd inside a Docker container:
Pull centos image
Set up a docker file like the one below:
FROM centos
@aryak007
aryak007 / listOfGuidesForSettingUpWittr.md
Last active March 6, 2018 19:43
A list of guides for debugging wittr set-up issues on Windows or setting up using Docker
@aryak007
aryak007 / ClosuresFirstExample.js
Last active March 26, 2018 18:28
Closures First Example
function outer(){
var stark = "The king in the North, Jon Snow";
function inner(){
console.log(stark);
}
anotherFunction(inner);
}
function anotherFunction(inner){
function outer() {
var inner = function()
{
console.log(stark);
}
var stark = "Jon Snow, the one true king";
return inner;
}
outer()(); //Q1. What will be the output of this example
for(var i = 1;i<=5;i++)
{
setTimeout(function()
{
console.log("value is : "+i);
},i*1000);
}
for(var i = 1;i<=5;i++){
(function(i){
setTimeout(function(){
console.log("value is : "+i);
},i*1000);
})(i);
}
function secretPassword() {
var password = 'xh38sk';
return {
guessPassword: function(guess) {
if (guess === password) {
return true;
} else {
return false;
}
}
var outerFunction = (function(){
var publicInterface = {
inner : function(){
console.log("Inner function");
},
anotherInner: function(){
publicInterface.inner();
}
// Lexical scope means compile time scope
var foo = "bar";
function bar(){
var foo = "baz"; //This is called shadowing. It will be in the local scope.
function baz(foo){
foo = "bam"; // Gets assigned to the local foo again
bam = "yay";