Skip to content

Instantly share code, notes, and snippets.

View cjuroz's full-sized avatar

Cristian Uroz cjuroz

View GitHub Profile
@cjuroz
cjuroz / functions.php
Last active January 5, 2022 03:49
Make a WordPress whole site private (require login)
// Make site private
function make_wordpress_site_private(){
global $wp;
if (!is_user_logged_in() && $GLOBALS['pagenow'] !== 'wp-login.php'){
wp_redirect(wp_login_url($wp -> request));
exit;
}
}
@cjuroz
cjuroz / genpassforsecurecodingdojo.js
Last active July 5, 2018 05:39
Simple password hash/salt generator for Secure Coding Dojo
// 1) Fill password var with your secret password.
// 2) Contact secure coding dojo admin to update generated hash/salt values.
const crypto = require('crypto');
const validator = require('validator');
password = 'insert-your-password-here';
var isStrongPass = validator.matches(password,/.{8,}/)==true && validator.matches(password,/[a-z]{1,}/)==true && validator.matches(password,/[A-Z]{1,}/)==true && validator.matches(password,/[0-9]{1,}/)==true;
if(!isStrongPass){
@cjuroz
cjuroz / BUILD
Last active February 4, 2022 12:08 — forked from jarpy/requirements.txt
Serverless Elasticsearch Curator for AWS Lambda using requests-aws4auth to sign requests with AWS ES
# http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
pip install elasticsearch-curator -t /path/to/project-dir
pip install requests-aws4auth -t /path/to/project-dir
@cjuroz
cjuroz / chocolateyInstall.ps1
Last active March 26, 2019 12:47
Chocolatey script to install Visual Studio 2017 from local NAS using offline installer. More info about how to create offline installer here: https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio
## USAGE EXAMPLES
# installs CoreEditor (the IDE), ManagedDesktop (.NET framework applications), NetCoreTools (.NET core applications), NetWeb (ASP.NET) + active product using provided Product Key
# choco install visualstudio2017enterprise.pls -y --params "/Features:Microsoft.VisualStudio.Workload.CoreEditor,Microsoft.VisualStudio.Workload.ManagedDesktop,Microsoft.VisualStudio.Workload.NetCoreTools,Microsoft.VisualStudio.Workload.NetWeb /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
# silent bare minimum installation with product key activation. The minimum installation contains only the Core Editor workload (Microsoft.VisualStudio.Workload.CoreEditor)
# choco install visualstudio2017enterprise.pls -y --params "/ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
# silent bare minimum installation without product key activation
# choco install visualstudio2017enterprise.pls -y