Skip to content

Instantly share code, notes, and snippets.

Avatar

Anoop Vijayan Maniankara maniankara

View GitHub Profile
@maniankara
maniankara / Dockerfile
Created Apr 6, 2016
concurrent-persistant-volume
View Dockerfile
FROM ubuntu
COPY run.sh /run.sh
CMD ["/bin/bash", "/run.sh"]
View goCDJobLog
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 Sep 28, 2021
handling put request in golang
View http-put-request.go
package fragments
import (
"net/http"
"io"
"log"
"strings"
"os"
"bytes"
)
@maniankara
maniankara / go-routines-for-loop.go
Created Feb 19, 2017
Executing go routines inside for loop with Boolean channels
View go-routines-for-loop.go
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 Feb 19, 2017
simple firstclass function: assigning function to variable
View variable-function.go
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 Feb 19, 2017
first class function: passing function to another
View passing-function.go
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 Mar 24, 2017
Build a debian package for your binary (box) to install in /usr/bin/
View build-debian-package.sh
# 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 Dec 18, 2017
jenkins_logstash_conf
View jenkins_logstash.conf
input {
tcp {
port => 12345
codec => multiline {
pattern => "^Finished: "
what => "previous"
}
}
}
@maniankara
maniankara / jfrog-community-support-screen-shot.png
Last active Jan 17, 2018
JFROG Artifactory community support option
View jfrog-community-support-screen-shot.png
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 Jan 29, 2018
SSL translation for a nexus repository manager implementing two repository connectors dockerfetch and dockerpushtest
View nexus-nginx
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;