Skip to content

Instantly share code, notes, and snippets.

View neoswf's full-sized avatar
🏠
Working from home

Shlomi Asaf neoswf

🏠
Working from home
View GitHub Profile
#BACKUP YOUR FILES FIRST
#EDITS FOR httpd.conf
#1. Uncomment these lines
LoadModule ssl_module modules/mod_ssl.so
Include /Applications/MAMP/conf/extra/httpd-ssl.conf
#2. Change ServerName value
ServerName localhost:443
#This is just a listing of the commands for generating your SSL certificates
#Run these commands one at a time from inside your ~/ssl folder
#Make sure you create your server.csr.cnf and your v3.ext files first inside the same folder
#private key generation
#This will ask you for a passphrase(password) do NOT lose this file or the password
openssl genrsa -des3 -out ~/ssl/rootCA.key 2048
#create root certificate
openssl req -x509 -new -nodes -key ~/ssl/rootCA.key -sha256 -days 1024 -out ~/ssl/rootCA.pem
authorityKeyIdentifier = keyid, issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
[req]
default_bits= 2048
prompt= no
default_md= sha256
distinguished_name = dn
[dn]
C = CA
ST = ON
L = Ottawa
O = End Point
@chranderson
chranderson / nvmCommands.js
Last active May 6, 2024 14:15
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@webarthur
webarthur / is_cnpj.js
Last active November 30, 2020 13:20
Valida CNPJ - função em JavaScript
function is_cnpj(c) {
var b = [6,5,4,3,2,9,8,7,6,5,4,3,2];
if((c = c.replace(/[^\d]/g,"")).length != 14)
return false;
if(/0{14}/.test(c))
return false;
for (var i = 0, n = 0; i < 12; n += c[i] * b[++i]);
PASSOS:
1) alterar no arquivo index.js o nome do projeto de "node-ant" para "node_ant" na geração da tag <project>. Isso foi necessário para conseguirmos recuperar a referência ao nome do projeto no código javascript que iremos escrever no teste item (3). Não sei como o ant gera o nome quando usamos "-" no meio desse nome.
2) alterar no arquivo jxon.js o trecho de código:
...
else if (key === 'keyValue') {
keyValue = cur;
}