Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View maniankara's full-sized avatar

Anoop Vijayan Maniankara maniankara

View GitHub Profile
@maniankara
maniankara / Dockerfile
Created April 6, 2016 10:12
concurrent-persistant-volume
FROM ubuntu
COPY run.sh /run.sh
CMD ["/bin/bash", "/run.sh"]
09:26:43.636 [GIT] Fetching changes
09:26:43.949 [GIT] Performing git gc
09:26:44.051 [GIT] Reset working directory pipelines/REPO
09:26:44.051 [GIT] Cleaning all unversioned files in working copy
09:26:44.474 Working directory "/var/lib/go-agent/pipelines/REPO/PATH/REP" does not exist!
09:26:44.515 [go] Job completed REPO/7/defaultStage/1/defaultJob on sandbox [/var/lib/go-agent]
@maniankara
maniankara / http-put-request.go
Last active November 9, 2022 09:58
handling put request in golang
package fragments
import (
"net/http"
"io"
"log"
"strings"
"os"
"bytes"
)
@maniankara
maniankara / go-routines-for-loop.go
Created February 19, 2017 13:51
Executing go routines inside for loop with Boolean channels
package fragments
func downloadUrls(urls []string) {
done := make(chan bool, len(urls))
for _, url := range urls {
go func(url string) {
@maniankara
maniankara / variable-function.go
Created February 19, 2017 13:59
simple firstclass function: assigning function to variable
package fragments
import "os"
func dummy() {
// define
createFile := func (path string) *os.File {
tmpfn, err := os.Create(path)
if err != nil {
@maniankara
maniankara / passing-function.go
Created February 19, 2017 14:07
first class function: passing function to another
package fragments
import (
"net/http"
"bytes"
)
// define a type function
type httpReqFunc func () (resp *http.Response, err error)
@maniankara
maniankara / build-debian-package.sh
Last active March 24, 2017 20:59
Build a debian package for your binary (box) to install in /usr/bin/
# Prepare the binary
mkdir mypackage; # root dir of the package creation
mkdir -p mypackage/usr/bin; # path to install
cp box mypackage/usr/bin # copy the binary
# Prepare the debian control
mkdir -p mypackage/DEBIAN/
cat > mypackage/DEBIAN/control << EOF
Package: myfancypackage
Version: 1.0-1
@maniankara
maniankara / jenkins_logstash.conf
Last active December 18, 2017 18:32
jenkins_logstash_conf
input {
tcp {
port => 12345
codec => multiline {
pattern => "^Finished: "
what => "previous"
}
}
}
@maniankara
maniankara / jfrog-community-support-screen-shot.png
Last active January 17, 2018 09:09
JFROG Artifactory community support option
Screen shot to link to stackoverflow: https://stackoverflow.com/questions/48222569/unable-to-install-artifactory-5-x-on-ubuntu-16-04-with-ppa-does-not-have-a-rel
@maniankara
maniankara / nexus-nginx
Created January 29, 2018 22:05
SSL translation for a nexus repository manager implementing two repository connectors dockerfetch and dockerpushtest
upstream dockerfetch {
server 127.0.0.1:8082 fail_timeout=0;
server HOSTNAME.YOURDOMAIN.com:8082 fail_timeout=0;
}
upstream dockerpushtest {
server 127.0.0.1:8083 fail_timeout=0;
server HOSTNAME.YOURDOMAIN.com:8083 fail_timeout=0;
}
server {
listen 48082 ssl;