Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar
:shipit:
Ship it!

Ionut Popa ionutzp

:shipit:
Ship it!
View GitHub Profile
View 1_singlehost.go
package main
import (
"net/http"
)
type SingleHost struct {
handler http.Handler
allowedHost string
}
View output.md
      || visible in terminal ||   visible in file   || existing

Syntax || StdOut | StdErr || StdOut | StdErr || file
==========++==========+==========++==========+==========++=========== > || no | yes || yes | no || overwrite >> || no | yes || yes | no || append || | || | || 2> || yes | no || no | yes || overwrite 2>> || yes | no || no | yes || append || | || | || &> || no | no || yes | yes || overwrite

@ionutzp
ionutzp / Howto convert a PFX to a seperate .key & .crt file.md
Last active July 31, 2023 12:50 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX.md
View Howto convert a PFX to a seperate .key & .crt file.md

source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]

What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.

Now let’s extract the certificate:

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

@ionutzp
ionutzp / README.md
Created April 5, 2017 13:55 — forked from kennethkalmer/README.md
Making sense of basic port forwarding with SSH tunnels
View README.md

SSH tunnel example

We all know how to ssh to a remote box...

Basic SSH connection with ssh 99.88.77.66

                            99.88.77.66
 +-------+                            +--------+
 | LOCAL |----------------------------| REMOTE |
View jsbin.afAbuREn.js
function foo() {
console.log(this.a);
}
function doFoo(fn) {
fn();
}
var obj = {
a: 2,