Skip to content

Instantly share code, notes, and snippets.

View soardex's full-sized avatar

Edward Fitz Bucud Abucay soardex

View GitHub Profile
@soardex
soardex / gist:3e71337c0b595f9a717c046820169ced
Created April 25, 2017 09:29
The Missing Piece Vim Configuration
"noremap <left> <nop>
"noremap <right> <nop>
"noremap <up> <nop>
"noremap <down> <nop>
"set exrc
"set secure
@soardex
soardex / gist:8a56f5856bff417a2c96ec1fd26906e5
Created March 25, 2017 14:16
Use Test User To Test Messenger Bot
To get it to work please follow the steps:
1) Create test user by toggling the Authorize test users for this app and grant permissions "manage_pages" and "page_messaging".
2) Use the Edit Button and get an access token for this user (using v2.6). Please save this for later.
3) Use edit button to login as the test user
4) After login, create page as the test user
5) Use the user access token for the test user to get the page access token for this user. You can do this with the following call:
~~~
https://graph.facebook.com/v2.6/me/accounts?access_token=<TEST_USER_ACCESS_TOKEN>
~~~
@soardex
soardex / gist:17a2abaa4f393704e7fc6f6f9fea17c1
Last active March 14, 2017 05:48
Make FreeBSD Unicode
# /etc/login.conf
\:umask=022:\
\:charset=UTF-8:\
\:lang=en_US.UTF-8:
# cap_mkdb /etc/login.conf
# /etc/profile
setenv LANG en_US.UTF-8
setenv CHARSET UTF-8
@soardex
soardex / gist:27d598fc149d734807f415cc320df7d4
Created March 13, 2017 05:07
Light .vimrc Configuration
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter'
Plug 'easymotion/vim-easymotion'
Plug 'raimondi/delimitmate'
Plug 'mileszs/ack.vim'
Plug 'kien/ctrlp.vim'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-rails'
@soardex
soardex / gist:410d07d1b0b6a04ced09457a0ee5cec9
Created February 26, 2017 19:40
Expand FreeBSD Using The Corrupt on Gpart
gpart show
gpart recover da0
gpart resize -i 2 -s 19G da0
zpool list
zpool online -e zroot da0p2
@soardex
soardex / gist:192071400541f8d894ec8b63315df73b
Created February 26, 2017 15:54
Open Port On Existing SSH Connection
<ENTER>~C - To open command line
<ENTER>~? - To open help files
<ENTER>~# - To list forwarded connections
https://coderwall.com/p/5wp2wg/start-port-forwarding-over-an-existing-ssh-connection-instead-of-creating-a-new-one
openssl genrsa 2048 | tee stunnel.key
openssl req -new -key stunnel.key -x509 -days 365 -out stunnel.crt
openssl dhparam 2048 | tee stunnel.dhp
cat stunnel.crt stunnel.key stunnel.dhp | tee stunnel.pem
@soardex
soardex / gist:cddb256b888801c66e3e7bf39950af82
Created January 28, 2017 17:38
Port Forwarding Windows
;; forward all incoming traffic to port 8080 from port 80
netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.0.0.1 connectport=8080 connectaddress=127.0.0.1
;; get ports that are open
netstat -ano | findstr :8080
;; show all port proxies
netsh interface portproxy show all
;; clear all forwarding rules
FROM python:2.7-alpine
MAINTAINER Edward Fitz Abucay <[email protected]>
USER root
ENV JUROJIN_SRC=data
ENV JUROJIN_BOOT=jurojin-boot.sh
ENV JUROJIN=/data
RUN mkdir -p $JUROJIN
@soardex
soardex / gist:0daadbce5ab11eb3e4e0c50ce1a58f3e
Created December 25, 2016 20:08
Import JSON File In MongoDB
var file = cat('./MOCK_DATA.json');
use yoopur;
db.auth('username', 'password');
var o = JSON.parse(file);
db.users.insert(o);