Compile tshark/wireshark for Android

It is a painful process and I would like to record the whole process.. I will provide a script in the end to assist, but the script should be used "AS IS."

To get wireshark working on Android, we will need many many libraries to start with. Most importantly, we need:

  • libpcap
  • glib
  • libiconv
  • libffi
  • gettext

To get these (and compiled correctly), we also need to get libgcrypt, libgpg-error, gmp, nettle, libtasn1, p11-kit, gnutls, xz, and libxml2. First we need to download all these. Navigate to a directory and use the following script to do so. Continue reading Compile tshark/wireshark for Android

Convert png to eps with minimal size

Every time I try to convert from png to eps, through commands like convert or via online converters like here, the eps file is always super large. For example, a 50KB png after conversion becomes 3MB eps.

Then I figured a way to reduce the file size. It is still through convert command, but with an additional prefix inside the command. Continue reading Convert png to eps with minimal size

Update/Install Tex Live 2016

Solutions combined from here and here. Here is a log.

If you use MacOS, skip the Debian/Ubuntu part.


cd ~
tar -xzf install-tl-unx.tar.gz
cd install-tl-20170117
sudo ./install-tl

Then press o and press Enter. You will see the option manual. Enable letter size as well as creating symlinks by pressing P and L.

Then press i to start installation. It took me about 45min to finish installation. This will depend on your network speed.


Just download MacTex from here. Install the pkg. It took me about 20min.

Dealing with dvips font issue

After installing the new system, I still encounter the problem saying

dvips: Font Helvetica used in file <...> is not in the mapping file.

To solve the issue, find where is.

For MacOS, mine is at /usr/local/texlive/2016/texmf-dist/fonts/map/dvips/tetex/

For Ubuntu, mine is at /usr/share/texlive/texmf-dist/fonts/map/dvips/tetex/

First check your current version of Tex is right (via tex --version), and then do

nano ~/.dvipsrc

and paste the following (modify based on the path of and save it.

p +/usr/share/texlive/texmf-dist/fonts/map/dvips/tetex/

Then run updmap to update the map.

Everything should work fine now. Thank Harris and the author of Tex Live.

Issue While Installing NCrack 0.4Alpha

So today I was trying to install NCrack 0.4Alpha, and I encountered this problem of undeclared variable DE1 and userkey not in scope. Below are the commands to run and the red marks where the errors appear.

tar xzf ncrack-0.4ALPHA.tar.gz
cd ncrack-0.4ALPHA.tar.gz && ./configure
make install

The errors:

... In function 'void deskey(unsigned char*, int)': error: 'DE1' was not declared in this scope In function 'void cookey(long unsigned int*)': error: 'usekey' was not declared in this scope

Online people suggest to install the following crypto packages. And then redo above installation steps.

sudo apt-get install build-essential checkinstall libssl-dev libssh-dev

Continue reading Issue While Installing NCrack 0.4Alpha

Create ShadowSocks on VPS

This is a log to establish & install ShadowSock on VPS (Centos).

If you do not have zlib-devel and openssl-devel, then you need to install it.

sudo yum install -y zlib-devel openssl-devel

Detailed steps:

git clone
cd shadowsocks-libev
./configure --prefix=/usr && make
sudo make install
sudo cp ./rpm/SOURCES/etc/init.d/shadowsocks-libev /etc/init.d/
sudo chmod +x /etc/init.d/shadowsocks-libev
sudo mkdir /etc/shadowsocks-libev
sudo cp ./debian/config.json /etc/shadowsocks-libev/
sudo nano /etc/shadowsocks-libev/config.json

Continue reading Create ShadowSocks on VPS

A Quick Reply to "Math in Dates"

While I was searching for how to setup PHP on Mac, I found this guy's website (Jason) and his post in July. The problem he pointed out is:

Which year (only the last two digits) will have the most dates that satisfies the equation (day+month=year)?

For example, January 3, 2004 satisfies this (since 1+3=4). So does February 2, 2004. So in year 2004, for instance, how frequent this happens? The answer is 3, because we only have Jan. 3rd, Feb. 2nd, and Mar. 1st. Continue reading A Quick Reply to "Math in Dates"