Skip to content

Instantly share code, notes, and snippets.

View adisheshsm's full-sized avatar

adisheshsm

  • India
View GitHub Profile
@adisheshsm
adisheshsm / upload.go
Created December 27, 2017 09:52 — forked from ebraminio/upload.go
golang upload client and server
// curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload
package main
import (
"fmt"
"io"
"net/http"
"os"
"time"
@adisheshsm
adisheshsm / multipart_upload.go
Created December 27, 2017 10:07 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@adisheshsm
adisheshsm / golang-tls.md
Created December 29, 2017 14:15 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https

@adisheshsm
adisheshsm / infra-secret-management-overview.md
Created January 16, 2018 05:12 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

#!/bin/bash
#
# How to prepare:
# - ensure that the lvm thin pool is big enough
# - backup any (most likely /boot and /boot/efi) device with:
# # mkdir /restoredev
# # dev=<device>; dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev")
# - make a thin snapshot
# - remove /restoredev
@adisheshsm
adisheshsm / client.go
Created July 5, 2018 13:37 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@adisheshsm
adisheshsm / client.go
Created July 6, 2018 14:32 — forked from xjdrew/client.go
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@adisheshsm
adisheshsm / pam_modules.list
Created July 2, 2022 08:07 — forked from assimilat/pam_modules.list
list_of_pam_modules
https://github.com/nuvious/pam-duress
A Pluggable Authentication Module (PAM) which allows the establishment of alternate passwords that can be used to perform actions to clear sensitive data, notify IT/Security staff, close off sensitive network connections, etc if a user is coerced into giving a threat actor a password.
https://github.com/uber/pam-ussh
uber's ssh certificate pam module
https://github.com/Yubico/yubico-pam
Yubico Pluggable Authentication Module (PAM)
https://github.com/hamzasood/pam_touchid