Skip to content

Instantly share code, notes, and snippets.

View jperocho's full-sized avatar

John Mark Perocho jperocho

View GitHub Profile
Cx Execute Command
Cx, C- Decrease text size
Cx, C+ Decrease text size
Mx, type: customize-theme Change Theme (M in mac is ALT key)
Mx, type: list-packages List Pachage
Cg Quit command
Cg, Cs Save
@jperocho
jperocho / areBufferEqual.js
Created June 22, 2018 15:41
Checks if two buffers are equal
const equalBuffer = (buffer1, buffer2) =>
buffer1.length !== buffer2.length
? false
: (() => {
for (let i = 0; i < buffer1.length; i++) {
if (buffer1.readUInt8(i) !== buffer2.readUInt8(i)) {
return false;
}
}
return true;
@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

@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 / 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 / gist:f8033530b8023204584ba15943529079
Created May 28, 2017 14:17
0x37696e2679D67d0A3c7709a49483FC2FBcd7efF2
0x37696e2679D67d0A3c7709a49483FC2FBcd7efF2
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:3944dd2247fb6ee81da3
Created June 18, 2015 08:37
kerberos fails to install on Ubuntu
$ npm install -g node-gyp
$ npm update
@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 / 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 () {