Skip to content

Instantly share code, notes, and snippets.

View gotoashishgupta's full-sized avatar

Ashish Gupta gotoashishgupta

View GitHub Profile
@gotoashishgupta
gotoashishgupta / multihooks.py
Created February 23, 2020 20:57 — forked from carlos-jenkins/multihooks.py
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/bin/bash
echo "Generating self-signed certificates... in dir $(pwd)/config"
openssl genrsa -out ./config/sslcerts/key.pem -aes256 1024
openssl req -new -key ./config/sslcerts/key.pem -out ./config/sslcerts/csr.pem
openssl x509 -req -days 9999 -in ./config/sslcerts/csr.pem -signkey ./config/sslcerts/key.pem -out ./config/sslcerts/cert.pem
function _checkPasswordStrength (password = '') {
password = password.trim();
const _passwordLength = password.length;
// Password Strength Additions
const _passwordLengthTest = _passwordLength >= 8 ? _passwordLength : 0;
const _numberOfCharactersTest = _passwordLength * 4;
let _strength = 0;