Skip to content

Instantly share code, notes, and snippets.

@alpap
alpap / example.go
Created June 7, 2020 10:51 — forked from yanmhlv/example.go
JSONB in gorm
package main
import (
"database/sql/driver"
"encoding/json"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@alpap
alpap / pipeline.gdsl
Created January 16, 2020 13:43 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@alpap
alpap / postgres.sh
Last active July 25, 2019 13:22 — forked from mrw34/postgres.sh
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
chown 70 server.key
docker run -d --name postgres -v $PWD/server.crt:/var/lib/postgresql/server.crt:ro -v $PWD/server.key:/var/lib/postgresql/server.key:ro postgres:11-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@alpap
alpap / _service.md
Created June 20, 2017 23:09 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)