Skip to content

Instantly share code, notes, and snippets.

View sergio's full-sized avatar

Sergio Acosta sergio

View GitHub Profile
@sergio
sergio / pkcs11-tls-proxy.go
Created September 27, 2022 02:27 — forked from korc/pkcs11-tls-proxy.go
PKCS11-authenticated TLS socket proxy
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"net/textproto"
@sergio
sergio / dotnet core .gitignore
Created January 15, 2019 22:52 — forked from vmandic/dotnet core .gitignore
A default .NET Core project .gitignore file
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
# Visual Studio Code
.vscode
# User-specific files
@sergio
sergio / webcryptoapi.html
Created October 31, 2018 17:00 — forked from deiu/webcryptoapi.html
Web Crypto API: RSA keygen & export & import & sign & verify & encrypt & decrypt
<html>
<head>
<script>
function generateKey(alg, scope) {
return new Promise(function(resolve) {
var genkey = crypto.subtle.generateKey(alg, true, scope)
genkey.then(function (pair) {
resolve(pair)
})
})
@sergio
sergio / sed cheatsheet
Created March 29, 2018 18:23 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@sergio
sergio / diffpdf.sh
Created April 7, 2017 18:06 — forked from brechtm/diffpdf.sh
Page-by-page PDF diff tool
#!/bin/bash
# usage: diffpdf.sh fidle_1.pdf file_2.pdf
# requirements:
# - ImageMagick
# - Poppler's pdftoppm and pdfinfo tools (works with 0.18.4 and 0.41.0,
# fails with 0.42.0)
# (could be replaced with Ghostscript if speed is
# not important - see commented commands below)