# Southeast Asia’s Diversity in Language.

English, Bahsa Indonesia, Bahasa Malaysia, Burmese (Zawgyi), Thai, Vietnamese, Chinese, Khmer.

Even if we count Simplified Chinese and Traditional Chinese as one language, we still have eight languages that are widely used in Southeast Asia.

# What We Use Make Who We Are

For a start up, for a tech team, or for a community, what we use make who we are. They are the source of culture and they show what we believe.

Which operating system, Windows, Linux or OS X, do you use as the default developing environment? Which operating system do you use as the production environment, Debian based, Red hat based, or Gentoo? Which cloud server do you use, AWS or other? Which language do you use as the main backend language, Python, Ruby, Node.js, or Java, PHP, C++? Which infrastructure do you use?

# Integrate Everything Into Slack

Slack is gradually becoming the standard for modern office communication. While you may argue that technically Slack is no different than, say, IRC – the polished experience is what makes it stand out in the crowd of messaging services. Using less gentler words, Slack is killing email for office communications. And has built in support for code snippets with syntax highlighting. Boom.

Actually, Slack is more than just a communication tool. What makes it extraordinary is it provides the possibility to integrate everything and make your workflow complete. In this post we’re highlighting some of the most useful new workflows that Slack is enabling. All these are currently heavily in use in our team, and we find they are exceptionally helpful.

# Solve AutoCAD Chinese Question Mark Issue

This article describes a complicated issue when using AutoCAD, Chinese text shows as a question mark, and two common causes and a perfect solution.

# How to Be a Good Tech Lead for a Start Up

To be a good tech lead in a start up is totally different from being CTO at a mature big company. There are numerous theories and technologies about managment in big companies. Unfortunately, there are not so much knowledges about how to lead a technical start up. Today, I’m gonna to give my advices. Hope they will inspire you.

I’m gonna talk this in 9 respects. They are not all ordered by importances, even though some are.

# Cast Android and iPhone Screen Onto Macbook

This guides is for casting Android and iPhone Screen onto a Macbook or other computers through a USB cable. If you’re searching a wireless solution, this is not. Actually after searching a lot, I find no good solution for wireless cast, so I admit this is a compromise solution. After all, fluency and resolution are more important.

# Proxy All TCP Traffic on a Remote Server

Even though SOCKS is a higher level protocol and more appropriate for doing proxy thing, there are no easy solution for building a global proxy for a Linux server except doing that on a router. For a remote server, normally a cloud server, it’s not always convenient to access the router. So after several tries, I decide drop the SOCKS solution, and simply use Linux’s iptables.

The easiest way I find from my recent research is with shadowsocks-libev. Shadowsocks-libev is a lightweight secured SOCKS5 proxy for embedded devices and low-end boxes. Shadowsocks-libev is written in pure C and only depends on libev and OpenSSL or PolarSSL. The use of mbedTLS is added but still for testing, and it is not officially supported yet.

# 9 Most Useful Jenkins Plugins

To your disappointment, I’m not gonna to show up some theme plugins even though I do think there are much space for Jenkins to improve in this scope. I’m gonna to show you something that really really useful, much more useful than that kind of simple theme plugins.

#### Throttle Concurrent Builds Plugin

This plugin allows for throttling the number of concurrent builds of a project running per node or globally.

Bitbucket Server, Jira, Confluence, Crowd etc, so many excellent software come from a same company — Atlassian. Some of them are technically designed well (even though not best), so they are good study cases. These days I’m interested in the license generating algorithm, so I dig into them for studying. Its license algorithm is DSA. Theoritically, it’s impossible to know the private key, so the private key can be think as unknown and safe. Without private key, it’s impossible to generate the corresponding signature for raw text. In this way, it makes sure that every issued license is from the owner.

To better understand the relationship between orignal text and the license text, I write a Python code to uncover the original text from a license text.

# Modify Java .class in a .jar

Sometimes I need to know what’s inside to figure out a best solution, like modifying a Java .class file in a .jar file. After searching google and stack overflow for a while, I found this question is little cared, and almost all information is not complete. So I wrap them up and make the whole process runnable.

# Transform All Files to UTF-8

I wrote a blog several years ago about transform all files in a folder recursively from one encoding to another. Today I decide to solve this issue more completely.

I wrap all this to a Python egg package, upload it to PyPi, and everyone who want to use this don’t need to copy & paste code any more. Just install it and use it.

This ships with a shell command, so after installing, just type

to transform a single file to UTF-8 encoding, or

# POJ 1020 Anniversary Cake

This is a simple search problem. With some pruning job it’s sufficient to pass test cases.

The biggest possible area of cake is $$16 \times 10 \times 10$$, so the biggest possbile side of cake is $$40$$.

Image a cake as a matrix with rows and colums. Each element of this matrix is a 1x1 cell. The problem can be translated to if there exists a method to fill this matrix with squares.

Now fill the matrix in this order: find the lowest leftmost empty cell $$C_{i,j}$$. Find successive cells $$C_{i,j}, C_{i, j+1}, \dots, C_{i, j+w}$$ with the same height as $$C_{i,j}$$.

Choose a square and put it into an area with left upper cell as $$C_{i, j}$$. If this can not construct a solution, backtrack to use another squre, otherwise continue to the end and get a solution.

# Calculate Distance Between Latitude/Longitude Points

This page presents a variety of calculations for latitude/longitude points, with the formula and code fragments for implementing them.

All these formula are for calculations on the basis of a spherical earth (ignoring ellipsoidal effects) – which is accurate enough for most purposes [In fact, the earth is very slightly ellipsoidal; using a spherical model gives errors typically up to 0.3%].

### Distance

This uses the haversine formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an “as-the-crow-flies” distance between the points (ignoring any hills they fly over, of course!).

Haversine formula: $$haversin{\left(\dfrac{d}{r}\right)} = haversin{\left(\phi_2-\phi_1\right)} + \cos{\phi_1}\cos{\phi_2}\,haversin{\left(\lambda_2-\lambda_1\right)}$$

where

$$haversin(\theta) = \sin^2\left(\dfrac{\theta}{2}\right) = \dfrac{1-\cos(\theta)}{2}$$

$$d$$ is the distance between the two points (along a great circle of the sphere)

$$r$$ is the radius of the sphere

$$\phi_1$$, $$\phi_2$$: latitude of point 1 and latitude of point 2

$$\lambda_1$$, $$\lambda_2$$: longitude of point 1 and longitude of point 2

# Downgrade MongoDB From 3.0 to 2.6

Due to a Meteor bug (actually it’s a bug from MongoDB nodejs driver, but the bug has already been fixed by the nodejs driver, while the issue is Meteor is referencing an old version of this driver), I have to downgrade MongoDB from 3.0.5 to 2.6.10. Normally this is a trival work, but it cost me a whole afternoon to do this, because there are serveral traps in there, so I decide to write this blog to help other people who meet the same issue with me.

The main problem is MongoDB 3.0 uses a new version of authentication algorithom SCRAM-SHA-1, while 2.6 uses an old version MONGODB-CR. Actually there are other methods besides these two. These two are the default configuration. If one upgrades MongoDB from 2.6 to 3.0, the authentication schema version can be upgraded by authSchemaUpgrade from 3 to 5, and in the same time the authentication algorithom will be upgraded from MONGODB-CR to SCRAM-SHA-1. However, when one downgrades MongoDB from 3.0 to 2.6, you can not use authSchemaUpgrade to downgrade the authentication schema, and it will remain in 5 and the authentication algorithm will remain in SCRAM-SHA-1, which are not supported by MongoDB 2.6. So yes, without additional work, you are not able to log into the database.

This article provides a method to solve this issue, which is not documented by MongoDB official website (and appearantly not documented in anywhere).

# Automatically Backup MongoDB With AWS CLI

Before that, let’s review some existing methods. One method is use the open source project s3cmd. Originally it doesn’t support the v4 signature, and after a long time, it finally supports v4 signature. The issue is it still doesn’t support the China region S3 server. Due to the maintainer is only one person and he doesn’t have enough time on this project, I guess it will another long period of time to fix this. Another method is to use mongodb-s3-backup. After a little modification, it can handle Chinese region S3 server well, but it doesn’t support v4 signature.

So I just creat a new script: https://github.com/leonsim/mongo-s3-backup.

Even though the serieze of HeartBleeding bugs makes HTTPS (SSL) look vulnerable, I still believe after bugs fixed, HTTPS is more secure than HTTP. Actually we can archieve this in a few simple steps with technologies like OpenSSL, free certificate provider, nginx configuration.

# Setting Up MongoDB Replication on EC2 With Ubuntu 14.02

To setup a meteor production environment on EC2, we need to install mongoDB as the main database. To use the MUP(Meteor Up tool), it’s easier to use Ubuntu operating system.

### Gentoo

For Mac OS developers, it’s essential to build your own arsenal. For most Linux utilities missed on Mac OS, just use homebrew to install. There is one exeption I make: Vim.