Skip to content

Instantly share code, notes, and snippets.

View emrahayanoglu's full-sized avatar

Emrah Ayanoglu emrahayanoglu

View GitHub Profile
@Mattemagikern
Mattemagikern / Certificates.go
Created May 9, 2019 08:31
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@shaneutt
shaneutt / LICENSE
Last active March 17, 2025 17:53
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@linuxmalaysia
linuxmalaysia / README-autossh-systemd.txt
Last active January 27, 2025 02:04
Autossh using systemd
1) ==== Autossh using systemd ====
Example from
https://gist.github.com/drmalex07/c0f9304deea566842490
2) =============
Install autossh
@tschm
tschm / client.py
Created July 9, 2018 18:56
Influxdb client
import os
import pandas as pd
from influxdb import DataFrameClient
class Client(DataFrameClient):
def __init__(self, host=None, port=8086, database=None):
host = host or os.environ["INFLUXDB_HOST"]
super().__init__(host, port)
@alex-leonhardt
alex-leonhardt / main.go
Last active October 11, 2024 11:34
golang text/template with a map[string]interface{} populated from mixed json data
package main
import (
"encoding/json"
"os"
"reflect"
"text/template"
)
@Belphemur
Belphemur / release-git-dch.sh
Created February 28, 2018 15:36
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"
@edro15
edro15 / ForceUSBtoTTY.md
Last active April 26, 2025 09:43
[How To] Force a specific USB device to a certain TTY

Scenario:

  • multiple USB devices plugged via hub to a host (Linux OS based),
  • multiple services/programs interacting with TTY running on top (e.g. GPSd)

Problem:

At boot TTY are randomly assigned to devices causing depending services/programs instabilities. They could indeed fail to start because of different TTY configurations.

Solution:

@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@Remiii
Remiii / README.md
Created October 17, 2017 08:43
VPN (OpenVPN) server and clients setup 🚂🚇😀

VPN (OpenVPN) server and clients setup 🚂🚇😀

This gist give all the steps in order to build a VPN (OpenVPN) network with server and clients (automatic generation for clients certificates). 😀

  1. Server configuration
  2. Clients configuration
  3. Security
  4. Generate automatic certificates for clients

Server configuration

== How to Implement an AWS Lambda function using Swift 4
1. Use the appropriate docker image to build a Swift 4 executable.
docker run -it -v "$(PWD):/app" doctorimpossible/swift4ubuntu bash
mkdir demo; cd demo
swift package init --type executable
:: edit Sources/demo/main.swift