Skip to content

Instantly share code, notes, and snippets.

@kohigh
kohigh / memorySizeOfObject.js
Created February 8, 2022 09:55
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@kohigh
kohigh / wildcard_ssl_renew_letsencrypt_name_com.md
Created November 28, 2021 00:16 — forked from padeoe/README_wildcard_ssl_renew_letsencrypt_name_com.md
[Script]Renew letsencrypt wildcard ssl cert for domain on name.com

[Script]Renew Wildcard Certificates with Letsencrypt for domain hosted by Name.com

This tutorial can renew your ssl certificate:

Wildcard certificates issued by letsencrypt.org need DNS TXT record to challenge, we can add TXT record manually when you apply the cert. If we want to automate it, we need to write a script that use the API of DNS provider to add TXT record. certbot has provided command argument --manual-auth-hook to pass the script.

1. Get a API token

Get your own api token provided by name.com: https://www.name.com/account/settings/api.

@kohigh
kohigh / golang-tls.md
Created November 25, 2021 19:00 — forked from 6174/golang-tls.md
Simple Golang HTTPS/TLS Examples
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)
openssl ecparam -genkey -name secp384r1 -out server.key
@kohigh
kohigh / gist:746273eb69a8b308f21336346f541637
Created March 19, 2019 14:01
Ruby's performance tuning way
@kohigh
kohigh / Hackback
Created March 20, 2018 09:38 — forked from denji/Hackback
Nikto, NMap , Skipfish and friends http://www.security-marathon.be/?p=844
_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide for those without the patience to wait for whistleblowers
--[ 1 ]-- Introduction