Skip to content

Instantly share code, notes, and snippets.

View emrahayanoglu's full-sized avatar

Emrah Ayanoglu emrahayanoglu

View GitHub Profile
@emrahayanoglu
emrahayanoglu / notes.md
Created April 2, 2023 21:06 — forked from rpavlik/notes.md
Debian packaging notes

These are my personal notes on how to handle Debian packaging best locally. Naturally they aren't authoritative, and I may have "missed a memo" - if so, let me know!

  • New package
    • git init
    • gbp import-orig ...
    • debmake
  • Clean up and edit
    • cme edit dpkg
  • see
@emrahayanoglu
emrahayanoglu / create-debian-package-python.md
Created April 2, 2023 14:46 — forked from influentcoder/create-debian-package-python.md
Creating a Debian package from scrath for a Python library
@emrahayanoglu
emrahayanoglu / make-local-cert.sh
Created March 18, 2021 00:00 — forked from jdeathe/make-local-cert.sh
Generate a Root CA + Intermediate CA for local (internal) use on Mac OSX using cfssl and add the intermediate certificate to your keychain so it can be trusted by your local browser.
#!/usr/bin/env bash
# REF: https://github.com/cloudflare/cfssl
# Change working directory
cd -- "$(
dirname "${0}"
)" || exit 1
readonly CA_ROOT_CERT_KEY="ca-root"
@emrahayanoglu
emrahayanoglu / README.md
Created March 3, 2021 22:56 — forked from tatsuryu/README.md
Open VPN client connect/disconnect emailer script

This script is intended to be used with Open VPN as the client-connect and client-disconnect scripts, to send an email using Mailgun to a certain address when a client connects or disconnects.

To install this, copy the below file to /etc/openvpn/statuschange.sh, replace the to email with your own, the and the from email, the URL, and the API key with your own Mailgun login. (I use the sandbox because I didn't feel like messing with DNS.)

Then, add the following to /etc/openvpn/server.conf:

client-connect /etc/openvpn/statuschange.sh
client-disconnect /etc/openvpn/statuschange.sh
script-security 2
@emrahayanoglu
emrahayanoglu / release-git-dch.sh
Created August 16, 2019 07:54 — forked from Belphemur/release-git-dch.sh
Release script to use Debian Changelog and Git together to generate the new version
#!/usr/bin/env bash
# TYPE= argument to the script where 0 = MAJOR, 1 = MINOR, 2 = BUILD. Default to BUILD.
GIT_VERSION=$(git describe --tags)
CURRENT_VERSION=$(echo ${GIT_VERSION:1} | cut -d'-' -f1)
TYPE=${1:-2}
function increment_version() {
local VERSION="$1"
local PLACE="$2"
@emrahayanoglu
emrahayanoglu / proxy.go
Created July 24, 2018 10:27 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@emrahayanoglu
emrahayanoglu / negroni-gorilla.go
Created May 8, 2018 07:24 — forked from danesparza/negroni-gorilla.go
Negroni with Gorilla mux subrouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
)
@emrahayanoglu
emrahayanoglu / main.go
Created May 7, 2018 12:48 — forked from chadlung/main.go
An example Go (golang) REST service that uses JWT (JSON Web Tokens) and Negroni http://www.giantflyingsaucer.com/blog/?p=5994
package main
// Generate RSA signing files via shell (adjust as needed):
//
// $ openssl genrsa -out app.rsa 1024
// $ openssl rsa -in app.rsa -pubout > app.rsa.pub
//
// Code borrowed and modified from the following sources:
// https://www.youtube.com/watch?v=dgJFeqeXVKw
// https://goo.gl/ofVjK4
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go