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 0.9.0 On centos 6.5.md
Last active June 17, 2019 03:39 — forked from hawkup/Install thrift On centos 6.5.md
Install thrift 0.9.0 On centos 6.5

Update The system

sudo yum -y update

Install the Platform Development Tools

sudo yum -y groupinstall "Development Tools"
@betapcode
betapcode / 1) Install
Created November 17, 2017 09:31 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@betapcode
betapcode / elasticsearch-example.js
Created September 14, 2017 07:13 — forked from StephanHoyer/elasticsearch-example.js
Simple example how to use elastic search with node.js
'use strict';
var elasticsearch = require('elasticsearch');
var Promise = require('bluebird');
var log = console.log.bind(console);
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
@betapcode
betapcode / upgrade-gcc
Created June 22, 2017 16:42
upgrade gcc in centos 6
#!/bin/bash
#
# description: upgrade gcc-c++ from 4.4 to 4.8 on centos 6.5
# AUTHOR : betapcode, [email protected]
# COMPANY: Tamtay JSC
# VERSION: 1.0
# CREATED: 04/05/2017 10:31:01 PM
echo '=================================================='
echo '=============== Upgrade gcc-c++ ==============='
@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 '=================================================='
@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 / 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 / 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 / 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 / minaftp.sh
Created November 4, 2016 06:57
Minaftp auto start | stop | restart | reload | status command services
#!/bin/sh
#
# chkconfig: - 80 30
# description: auto start minaftp on server
# processname: minaftp
# PARAMETERS: /sbin/services minaftp start|stop|restart|reload
# AUTHOR : betapcode, [email protected], [email protected]
# COMPANY: Tamtay JSC
# VERSION: 1.0
# CREATED: 04/11/2016 10:31:01 AM