Skip to content

Instantly share code, notes, and snippets.

View betapcode's full-sized avatar

Phạm Ngọc Minh betapcode

  • tamtay.vn
  • Hà Nội - Việt Nam
View GitHub Profile
@betapcode
betapcode / install_thrift.sh
Last active October 28, 2015 03:40 — forked from amuraru/install_thrift.sh
install thrift 0.8.0
#/bin/bash
set -e
wget http://archive.apache.org/dist/thrift/0.8.0/thrift-0.8.0.tar.gz
tar zxf thrift-0.8.0.tar.gz
pushd thrift-0.8.0
wget https://issues.apache.org/jira/secure/attachment/12511532/thrift-1465_1.patch
patch -p0 < thrift-1465_1.patch
wget https://issues.apache.org/jira/secure/attachment/12537024/THRIFT-1474-read-exceptions-first.patch
@betapcode
betapcode / create_ipa.sh
Created December 2, 2015 15:29 — forked from six519/create_ipa.sh
Building Ionic iOS Release And Generate ipa File Script
#!/bin/bash
# Thanks to: https://gist.github.com/DavidFrahm/4409d6b74e46377e7be7
# Usage: ./create_ipa.sh <Scheme Name> <Provisioning Profile>
echo "Building Ionic iOS release..."
ionic build --release ios
pushd platforms/ios/
echo "Building archive file..."
xcodebuild -scheme "$1" -configuration Release clean archive -archivePath "build/$1.xcarchive"
@betapcode
betapcode / gist:cadb416718c17a726962
Created March 12, 2016 03:29 — forked from ryanjbonnell/gist:3880048
Install Memcache on Mac OS X 10.8 "Mountain Lion"
# memcached requires libevent
cd /usr/local/src
curl -L -O http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
tar -xvzf libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable*
./configure
make
sudo make install
# Compile memcached utility
@betapcode
betapcode / forever.md
Created April 10, 2016 16:11 — forked from nickleefly/forever.md
forever your node app

Install Forever:

npm install forever -g

now your can run forever

forever --help
forever start app.js
@betapcode
betapcode / Sublime Text 3 Build 3103 License Key - CRACK
Created August 25, 2016 04:15
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@betapcode
betapcode / ZeroMQ-XPUB.py
Created November 9, 2016 06:30 — forked from m0sa/ZeroMQ-XPUB.py
Example of the ZeroMQ XPUB socket, that shows how the producer can be controlled by the number of subscribers
import thread
import time
import zmq
from zmq.core.socket import Socket
# global zmg context
context = zmq.Context()
endpoint = "tcp://*:8888"
# the subscriber thread function
@betapcode
betapcode / xpub-xsub.js
Created November 9, 2016 06:30 — forked from tjanczuk/xpub-xsub.js
How to connect 5 publishers with 5 subscribers over TCP using ZeroMQ's XPUB/XSUB proxy
// How to connect 5 publishers with 5 subscribers
// over TCP using ZeroMQ's XPUB/XSUB proxy.
// sub (connect)
// <-8701->
// (bind) xpub <---> xsub (bind)
// <-8700->
// (connect) pub
var zmq = require('zmq');
@betapcode
betapcode / pubfwd.py
Created November 9, 2016 06:30 — forked from minrk/pubfwd.py
"""
An XPUB/XSUB broker that forwards subscriptions
"""
import os
import string
import sys
import time
from random import randint
from threading import Thread
@betapcode
betapcode / espresso.py
Created November 9, 2016 06:31 — forked from vivekfantain/espresso.py
zeromq XPUB/XSUB issue that cannot be explained
# Espresso Pattern
# This shows how to capture data using a pub-sub proxy
#
import time
from random import randint
from string import uppercase
from threading import Thread
@betapcode
betapcode / scribe-centos
Last active August 24, 2017 02:26
scribe installation script on CentOS
#!/bin/bash
echo '=================================================='
echo '===============Install necessary tools==============='
echo '=================================================='
sudo yum update
sudo yum install git make flex bison libtool automake openssl-devel libevent libevent-devel python-devel gcc-c++ byacc java-1.7.0-openjdk ant
echo '=================================================='