Skip to content

Instantly share code, notes, and snippets.

View toantran-ea's full-sized avatar

Toan Tran toantran-ea

View GitHub Profile
@toantran-ea
toantran-ea / MongoDB_macOS_Sierra.md
Created November 5, 2017 00:11 — forked from nrollr/MongoDB_macOS_Sierra.md
Install MongoDB on Sierra using Homebrew

##Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@toantran-ea
toantran-ea / gitkraken_into_gitx.md
Created April 12, 2017 17:11
Config gitkraken on Linux to have better shortcut in commandline

Create new file in /usr/local/bin called gitx_shell.sh with following content (remove quotes)

#!/bin/sh

nohup /usr/share/gitkraken/gitkraken & 

Assign execution mode for file

sudo chmod +x gitx_shell.sh

@toantran-ea
toantran-ea / remote_pairing_setup.md
Created March 30, 2017 07:16 — forked from alvarobp/remote_pairing_setup.md
Setting up a remote pair station with SSH + TMUX and/or Reverse SSH Tunnel

Disclaimer: The following examples try to give an overview of the process followed in different scenarios. Some commands were actually written from memory. Some tools might exist simplifying all this. Furthermore, I'm no expert so if anyone ever reads this and knows any improvement, please let me know.

Case 1: Direct access to Pairing Station

Given that the Guest User can access the Pairing Station directly, either because the station is publicly available or because NAT port forwarding can be used, there's only one thing we need to do, give ssh access to the Guest User by adding his ssh public key to our Local User (pair) .ssh/authorized_keys file.

The local user would open up a tmux session with

tmux new-session -s pairing
@toantran-ea
toantran-ea / reset_routing_table.sh
Created March 28, 2017 12:40 — forked from midwire/reset_routing_table.sh
Reset routing table on OSX
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
@toantran-ea
toantran-ea / tmux.conf
Created January 18, 2017 16:44
tmux configuration - cross machines (macbook + linux station)
# set prefix to be Ctrl-a
set -g prefix C-a
# unbind original ctrl-b
unbind C-b
# setting the delay between prefix and command
set -s escape-time 1
# set the base index for windows to 1
set -g base-index 1
# set base index for pane to 1
setw -g pane-base-index 1
@toantran-ea
toantran-ea / install_tmux.sh
Created January 18, 2017 15:49
Install tmux on Ubuntu/Linux Mint
#!/bin/sh
sudo apt-get install build-essential curl git python-setuptools ruby;
sudo apt-get install build-essential libevent-dev libncurses-dev;
#tmux2.3
wget -O tmux-2.3.tar.gz https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz;
tar -zvxf tmux-2.3.tar.gz;
cd tmux-2.3/
./configure;
@toantran-ea
toantran-ea / sample_blip.py
Created September 18, 2014 10:33
Script to collect sample blacklisted ip addresses
import socket
def get_list():
s ="""
Deny from 208.50.101.
Deny from 78.234.5.2
Deny from 98.150.108.228
Deny from 69.41.14.215
Deny from 64.124.98.10
Deny from 64.125.188.25
@toantran-ea
toantran-ea / gist:59bafc793c5e3277e999
Created September 3, 2014 23:11
Pengo - Latest compiling output
06:07:15 **** Incremental Build of configuration Default for project PenGoPaint ****
/Users/toan/androiddev/android-ndk-r9d/ndk-build all
Android NDK: WARNING: APP_PLATFORM android-13 is larger than android:minSdkVersion 12 in ./AndroidManifest.xml
[armeabi] Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
[armeabi] Gdbsetup : libs/armeabi/gdb.setup
[armeabi-v7a] Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup
[armeabi] Compile++ thumb: pengo_ndk <= GaussFilter.cpp
[armeabi] Compile++ thumb: pengo_ndk <= CurveDrawing.cpp
make: *** No rule to make target `jni/FileUtils.cpp', needed by `obj/local/armeabi/objs-debug/pengo_ndk/FileUtils.o'. Stop.
@toantran-ea
toantran-ea / Eclipse Console output
Created September 3, 2014 15:03
Eclipse Console output
22:01:16 **** Incremental Build of configuration Default for project Virtuacast ****
/Users/toan/androiddev/android-ndk-r9d/ndk-build NDK_DEBUG=1 all
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
/bin/sh: pkg-config: command not found
[armeabi-v7a] Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup
GStreamer : [GEN] => gst-build-armeabi-v7a/gstreamer_android.c
GStreamer : [COMPILE] => gst-build-armeabi-v7a/gstreamer_android.c
gst-build-armeabi-v7a/gstreamer_android.c:2:21: fatal error: gst/gst.h: No such file or directory
@toantran-ea
toantran-ea / gist:757b5402050fc6831fc3
Created September 3, 2014 14:02
3/9/2014-Compiling error
toans-MacBook-Pro:HologreetingsARAndroid toan$ ~/androiddev/android-ndk-r10/ndk-build clean
/Users/toan/androiddev/android-ndk-r10/build/core/build-binary.mk:449: warning: overriding commands for target `obj/local/armeabi-v7a/objs/ImageTargetsNative/__/__/HologreetingsARLib/src/Android'
/Users/toan/androiddev/android-ndk-r10/build/core/build-binary.mk:449: warning: ignoring old commands for target `obj/local/armeabi-v7a/objs/ImageTargetsNative/__/__/HologreetingsARLib/src/Android'
[armeabi-v7a] Clean : ImageTargetsNative [armeabi-v7a]
[armeabi-v7a] Clean : OpenAL-prebuilt [armeabi-v7a]
[armeabi-v7a] Clean : Vuforia-prebuilt [armeabi-v7a]
[armeabi-v7a] Clean : android_native_app_glue [armeabi-v7a]
[armeabi-v7a] Clean : crypto [armeabi-v7a]
[armeabi-v7a] Clean : curl [armeabi-v7a]
[armeabi-v7a] Clean : gnustl_shared [armeabi-v7a]