Skip to content

Instantly share code, notes, and snippets.

Dreampuf dreampuf

Block or report user

Report or block dreampuf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dreampuf
dreampuf / main_test.go
Created Nov 8, 2018
How to handle sub process gently in Golang
View main_test.go
package main
import (
"bufio"
"bytes"
"context"
"io"
"log"
"os/exec"
"strings"
@dreampuf
dreampuf / Dockerfile
Created Sep 28, 2018
Pingfedera docker build
View Dockerfile
from nimmis/java-centos:oracle-8-jre
ENV JAVA_HOME /usr/java/default
WORKDIR /opt
RUN yum install -y which tar nmap-ncat
ADD pf-install-9.1.2.sh /opt/pf-install.sh
RUN chmod +x /opt/pf-install.sh
RUN /opt/pf-install.sh
ENTRYPOINT ["sh", "-c", "/usr/local/pingfederate-1/bin/run.sh"]
@dreampuf
dreampuf / remote_ingest.sh
Created Sep 28, 2018
Docker Image Repository Ingest
View remote_ingest.sh
token=$(curl -s -H "Authorization: Basic $(echo -n "USERNAME:PASSWORD" | base64)" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:sebp/elk:pull" | jq -r ".token")
configsha=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer ${token}" https://registry-1.docker.io/v2/sebp/elk/manifests/latest | jq -r .config.digest)
curl -sL -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer ${token}" https://registry-1.docker.io/v2/sebp/elk/blobs/sha256:4b52312ebe8d44f438eeecf08da2b4460250bd574642cc124bc5eaac4f1ebfc5 | jq
@dreampuf
dreampuf / go_installation.sh
Last active Mar 11, 2019
How to install golang 1.11 in CentOS5
View go_installation.sh
# details in: https://golang.org/doc/install/source
# a patch for centos 5 build: https://github.com/golang/go/issues/24980#issuecomment-384193598
export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$PATH"
mkdir /usr/local/go ~/go
curl -L https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz | tar xf - -C /usr/local/go
cd /usr/local/go/src
./make.bash
curl -L https://dl.google.com/go/go1.11.src.tar.gz | tar xf - -C ~/go
@dreampuf
dreampuf / Dockerfile
Created Aug 21, 2018
Pingfederate Container
View Dockerfile
from nimmis/java-centos:oracle-8-jre
ENV JAVA_HOME /usr/java/default
WORKDIR /opt
RUN yum install -y which tar nmap-ncat
ADD pf-install-9.1.2.sh /opt/pf-install.sh
RUN chmod +x /opt/pf-install.sh
RUN /opt/pf-install.sh // You need to run it manually
ENTRYPOINT ["sh", "-c", "/usr/local/pingfederate-1/bin/run.sh"]
@dreampuf
dreampuf / tutorial.md
Created Jul 25, 2018 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API
View tutorial.md

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@dreampuf
dreampuf / buildrpm.sh
Created May 23, 2018
Promethues RPM package generator
View buildrpm.sh
#!/bin/bash
# Automatic generate a rpm package for prometheus component
# Author: dreampuf <soddyque@gmail.com>
# Usage: buildrpm.sh package_url
# Example: buildrpm.sh https://github.com/prometheus/mysqld_exporter/releases/download/v0.10.0/mysqld_exporter-0.10.0.linux-amd64.tar.gz
URL=${1}
FILENAME=${URL##*/}
PACKAGEFOLDERNAME=${FILENAME%%.tar*}
APPNAME=${FILENAME%%-*}
@dreampuf
dreampuf / build.sh
Created May 4, 2018
Build gvisor from centos:latest container
View build.sh
git clone --depth 1 https://github.com/google/gvisor.git
cd gvisor
docker --rm -it "$PWD":/opt/gvisor -w /opt/gvisor centos bash
curl -O /etc/yum.repos.d/vbatts-bazel-epel-7.repo https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo
yum install -y epel-release bazel gcc gcc-c++ git protobuf-devel protobuf-lite-devel
env CC=/usr/bin/gcc bazel build runsc
@dreampuf
dreampuf / bootstrap_develop_environment.sh
Last active Nov 19, 2018
Bootstrap_develop_environment.sh
View bootstrap_develop_environment.sh
#!/usr/bin/env bash
# Install Homebrew first
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Basic development tools
brew install pyenv awscli pyenv-virtualenv go
# Enable caskroom
brew tap caskroom/cask
View SysInitV_example.sh
#!/bin/bash
#
#
#
# Start on runlevels 3, 4 and 5. Start late, kill early.
# chkconfig: 345 95 05
#
#
#!/bin/bash
You can’t perform that action at this time.