Skip to content

Instantly share code, notes, and snippets.

View jperocho's full-sized avatar

John Mark Perocho jperocho

View GitHub Profile
@jperocho
jperocho / hashit.js
Created June 5, 2014 10:25
A simple password encryption for node.js
/*jshint node: true, strict: true*/
'use strict';
var crypto = require('crypto');
module.exports = {
algo :'bf-ecb',
encoding :'utf8',
input_encoding: 'base64',
hashIt: function ( pass, salt ) {
#!/bin/bash
PATH=/usr/local/git/bin:$PATH
export PATH
source /usr/local/git/contrib/completion/git-prompt.sh
MAGENTA="\[\033[0;35m\]"
PURPLE="\[\033[1;35m\]"
YELLOW="\[\033[1;33m\]"
@jperocho
jperocho / Backup
Last active August 29, 2015 14:15
#!/bin/bash
# By John Mark Perocho
# PixelTracer 2015
# This is a script use to backup wordpress app in webfaction
# Usage: backup [FOLDER LOCATION] -optional [NAME OF TAR FILE]
path=${1%%+(/)}
tarname=$2
pathname=$(echo $1 | sed -r 's/[\.\/]//g')
tarit () {
@jperocho
jperocho / mongod.sh
Last active August 29, 2015 14:23
Mongodb auth in ubuntu 14.04
# Besure to comment auth=true In /etc/mongod.conf.
# Start the mongod or mongos instance without the authorization
$ sudo service mongod start
# Start mongo
$ mongo
# Inside mongo run the following
# Create admin user
@jperocho
jperocho / gist:3944dd2247fb6ee81da3
Created June 18, 2015 08:37
kerberos fails to install on Ubuntu
$ npm install -g node-gyp
$ npm update
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
}
@jperocho
jperocho / gist:f8033530b8023204584ba15943529079
Created May 28, 2017 14:17
0x37696e2679D67d0A3c7709a49483FC2FBcd7efF2
0x37696e2679D67d0A3c7709a49483FC2FBcd7efF2
@jperocho
jperocho / git_commands.md
Last active September 14, 2018 20:03
Git helpful Commands

To assume unchange

git update-index --assume-unchanged -- <file>

To revert back

git update-index --no-assume-unchanged <file>
@jperocho
jperocho / arango_tut.md
Created June 18, 2018 06:36
Arango Shell Tutorial

1. Welcome to the tutorial!

This is a user-interactive tutorial on ArangoDB and the ArangoDB shell. It will give you a first look into ArangoDB and how it works.

2. JavaScript Shell

On this shell's prompt, you can issue arbitrary JavaScript commands.

@jperocho
jperocho / arango_commands.md
Last active June 18, 2018 13:07
Arango Commands

Arango Cheat Sheet

Installing in Centos 7

cd /etc/yum.repos.d/
curl -OL https://www.arangodb.com/9c169fe900ff79790395784287bfa82f0dc0059375a34a2881b9b745c8efd42e/arangodb33/CentOS_7/arangodb.repo
yum -y install arangodb3e-3.3.10

Run arango-secure-installation then Enter the new root password