Skip to content

Instantly share code, notes, and snippets.

@khorevaa
khorevaa / server.go
Created March 26, 2022 19:34 — forked from thezelus/server.go
golang NewSingleHostReverseProxy + gorilla mux
package main
import (
"net/http"
"net/http/httputil"
"net/url"
"github.com/gorilla/mux"
)
- eval $(ssh-agent -s)
- ssh-add <(echo "${SSH_PRIVATE_KEY}")
- REMOTE=${STAGING_REMOTE:?Необходим STAGING_REMOTE}
- REMOTE_PORT=${STAGING_REMOTE_PORT:?Необходим STAGING_REMOTE_PORT}
- echo " * OPENING DOCKER SOCKET TUNNEL"
- |
socat \
"UNIX-LISTEN:/tmp/docker.sock,reuseaddr,fork" \
"EXEC:'ssh -o StrictHostKeyChecking=no -kTax $REMOTE -p $REMOTE_PORT socat STDIO UNIX-CONNECT\:/var/run/docker.sock'" \
&
@khorevaa
khorevaa / yurt.js
Created April 18, 2021 08:14
yurt cal
function yurtcalc() {
// -- yurt calculator, written by Rene K. Mueller
// for http://Housing.byRene.com
// inspired by the dome calculator at DesertDomes.com
// history:
// 2006-10-29: added piewise canvas calculation
// 2006-01-08: volume added
// 2005-09-29: htot corrected
// 2005-09-27: misc corrections
// 2005-08-09: first version
#!/bin/sh
set -e
TAR_FILE="/tmp/oneget.tar.gz"
RELEASES_URL="https://github.com/v8platform/oneget/releases"
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"
last_version() {
curl -sL -o /dev/null -w %{url_effective} "$RELEASES_URL/latest" |
rev |
@khorevaa
khorevaa / yurt.js
Created May 13, 2020 09:49
Калькулятор для расчета Юрты
function yurtcalc() {
// -- yurt calculator, written by Rene K. Mueller
// for http://Housing.byRene.com
// inspired by the dome calculator at DesertDomes.com
// history:
// 2006-10-29: added piewise canvas calculation
// 2006-01-08: volume added
// 2005-09-29: htot corrected
// 2005-09-27: misc corrections
// 2005-08-09: first version
WITH models AS (
WITH data AS (
SELECT
replace(initcap(table_name::text), '_', '') table_name,
replace(initcap(column_name::text), '_', '') column_name,
CASE data_type
WHEN 'timestamp without time zone' THEN 'time.Time'
WHEN 'timestamp with time zone' THEN 'time.Time'
WHEN 'boolean' THEN 'bool'
-- add your own type converters as needed or it will default to 'string'
@khorevaa
khorevaa / aes_encryption.go
Created September 3, 2019 12:47 — forked from stupidbodo/aes_encryption.go
AES Encryption Example in Golang
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
@khorevaa
khorevaa / newbotwithTorProxy.go
Created September 1, 2019 16:45
Telegram bot with proxy TOR
_ = tgbotapi.SetLogger(logger)
var proxy = "socks5://127.0.0.1:9150" // Tor proxy for testing
//creating the proxyURL
proxyURL, err := url.Parse(proxy)
transCfg := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
Proxy: http.ProxyURL(proxyURL),// ignore expired SSL certificates
@khorevaa
khorevaa / ras.service
Created October 24, 2018 14:28 — forked from Kirill/ras.service
/etc/systemd/system/ras.service 1C for Linux
[Unit]
Description=RAS
After=syslog.target
After=network.target
[Service]
Type=forking
WorkingDirectory=/opt/1C/v8.3/x86_64
User=usr1cv8
Group=grp1cv8

Gitlab Virtualbox Windows 7 runner

Первоисточник

В результате выполнения шагов у вас будет готовый runner на виртуальной машине с Windows 7 с Cygwin, к которой можно будет подключиться по ssh.

Устанавливаем Cygwin

Качаем установочный файл cygwin например в C:\dev\cygwin.

Пакеты для Cygwin устанавливаются именно из него

Запускаем файл с правами администратора: