Skip to content

Instantly share code, notes, and snippets.

View pobsuwan's full-sized avatar

Apiwat Suksuwan pobsuwan

View GitHub Profile
@pobsuwan
pobsuwan / zookeeper-kafka
Created July 15, 2016 03:45 — forked from mesonoxian/zookeeper-kafka
Simple Zookeeper and Kafka init.d Startup Script
#! /bin/bash
### BEGIN INIT INFO
# Provides: kafka
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: kafka service
### END INIT INFO

Most active GitHub users in Thailand

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 29 Jul 2015 01:52:41 GMT till Fri, 29 Jul 2016 01:52:41 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 6)
@pobsuwan
pobsuwan / rabbitmq-cluster.md
Last active March 29, 2024 02:05
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3
apm install atom-alignment atom-bootstrap3 atom-material-syntax atom-material-ui atom-terminal autocomplete-modules autocomplete-php color-picker docblockr emmet file-icons git-plus highlight-selected linter linter-php merge-conflicts minimap minimap-highlight-selected pigments project-manager Remote-FTP seti-syntax seti-ui simple-drag-drop-text terminal-plus vim-mode

#การใช้ Git ฉบับรีบร้อน

##Git Git เป็น revision control แบบ distributed (หมายความว่าไม่มีศูนย์กลาง) และ แบบ non-linear history (หมายความว่ามีประวัติการเปลี่ยนแปลงแบบไม่ใช่เส้นตรง) ดังนั้นทำให้คอนเซปต์ของ Git นั้นต่างจาก revision control รุ่นก่อนหน้าหลายอย่าง

ต่อไปจะอธิบายย่อๆเรื่องคำสั่ง Git โดยอิงกับการทำงานใน GitHub เป็นสำคัญ (Git มีวิธีใช้พลิกแพลงมากมาย ไปศีกษาการใช้อื่นได้ด้วยการไป Google เอาเอง)

##clone

สมมุติว่ามี repository แห่งนีงใน GitHub เช่น https://github.com/norsez/projectA

@pobsuwan
pobsuwan / redis-master.conf
Created December 17, 2016 08:36
redis-master.conf
port 6379
cluster-enabled yes
cluster-config-file /etc/redis/redis-master/nodes.conf
cluster-node-timeout 5000
appendonly yes
dir /etc/redis/redis-master/data
@pobsuwan
pobsuwan / redis-slave.conf
Created December 17, 2016 08:37
redis-slave.conf
port 6380
cluster-enabled yes
cluster-config-file /etc/redis/redis-slave/nodes.conf
cluster-node-timeout 5000
appendonly yes
dir /etc/redis/redis-slave/data
@pobsuwan
pobsuwan / benchmark-commands.txt
Created February 14, 2017 10:03 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@pobsuwan
pobsuwan / .vimrc
Last active June 7, 2017 04:13
my vimrc
set shell=/bin/bash " set for fish shell
set nocompatible " be iMproved, required
filetype off " required
execute pathogen#infect()
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required