Skip to content

Instantly share code, notes, and snippets.

View nicopenaredondo's full-sized avatar

Nico R. Penaredondo nicopenaredondo

View GitHub Profile
@DeOGe
DeOGe / PHP Snippets
Last active September 25, 2018 03:33
{
// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@joeneldeasis
joeneldeasis / certscript.sh
Last active December 2, 2018 22:24
Script for updating certbot dependencies on AWS Linux AMI
#!/bin/bash
### Change the permission of certscript.sh: chmod +x /path/to/certscript.sh
### Add this script to root user's cron: 0 0 1 * * sh /path/to/certscript.sh
user=$(whoami)
certbot_dir="/usr/bin"
if [[ $user != 'root' ]]; then
echo "[*] Please run this script as root user!"
@mgmilcher
mgmilcher / gist:5eaed7714d031a12ed97
Last active March 28, 2023 14:53
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@rojan
rojan / node_crypto.js
Last active March 19, 2023 15:14
Encrypt in nodejs and decrypt in php or vice versa
var crypto = require('crypto');
var key = 'MySecretKey12345';
var iv = '1234567890123456';
var cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv);
var text = 'plain text';
var encrypted = cipher.update(text, 'utf8', 'binary');
encrypted += cipher.final('binary');
hexVal = new Buffer(encrypted, 'binary');