Skip to content

Instantly share code, notes, and snippets.

View pprishchepa's full-sized avatar

Pavel Prishchepa pprishchepa

View GitHub Profile
package main
import (
"net/http"
"net/http/httptest"
"time"
"github.com/gin-gonic/gin"
timeout "github.com/vearne/gin-timeout"
)
package main
import (
"errors"
)
func UnwrapAll(err error) error {
var e error
for {
if e = errors.Unwrap(err); e == nil {
package main
import (
"errors"
"fmt"
)
type job struct {
Name string
After []string
@pprishchepa
pprishchepa / Jenkinsfile
Created July 18, 2018 09:33 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@pprishchepa
pprishchepa / tmux.conf
Created April 18, 2018 07:44 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@pprishchepa
pprishchepa / sshtunnel.go
Created February 12, 2018 06:22 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@pprishchepa
pprishchepa / go-ssh-reverse-tunnel.go
Created February 12, 2018 06:22 — forked from codref/go-ssh-reverse-tunnel.go
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
@pprishchepa
pprishchepa / go-ssh-reverse-tunnel.go
Created February 12, 2018 06:22 — forked from codref/go-ssh-reverse-tunnel.go
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
<?php declare (strict_types=1);
// Always redirect to the primary domain when hosted on Wodby.
if (!empty($_SERVER['WODBY_HOST_PRIMARY']) && php_sapi_name() !== 'cli') {
if( preg_match('/^(http[s]?:\/\/)?(.*)$/', $_SERVER['WODBY_HOST_PRIMARY'], $matches)) {
$primary_host = $matches[2];
if ($_SERVER['HTTP_HOST'] !== $primary_host) {
$primary_url = isset($_SERVER['WODBY_URL_PRIMARY'])
? $_SERVER['WODBY_URL_PRIMARY']
: $_SERVER['WODBY_HOST_PRIMARY'];
@pprishchepa
pprishchepa / docker-compose-v3.yml
Created June 13, 2017 12:41 — forked from seeruk/docker-compose-v3.yml
Concourse CI working with Docker Compose V3 syntax.
version: "3"
services:
concourse-db:
image: postgres:9.5
environment:
- POSTGRES_DB=concourse
- POSTGRES_USER=concourse
- POSTGRES_PASSWORD=changeme
- PGDATA=/database