Update/Install Tex Live 2016

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

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

Debian/Ubuntu

cd ~
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
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.

MacOS

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 dvips35.map is.

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

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

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 dvips35.map) and save it.

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

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.

wget http://nmap.org/ncrack/dist/ncrack-0.4ALPHA.tar.gz
tar xzf ncrack-0.4ALPHA.tar.gz
cd ncrack-0.4ALPHA.tar.gz && ./configure
make
make install

The errors:

... 
crypto.cc: In function 'void deskey(unsigned char*, int)':
crypto.cc:545:14: error: 'DE1' was not declared in this scope
crypto.cc: In function 'void cookey(long unsigned int*)':
crypto.cc:590:14: 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 https://github.com/shadowsocks/shadowsocks-libev.git
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"

VPS Setup Record - SSH Security

The VPS info I have is listed in VPS Setup Record - Basics, and I have talked about how to install LAMP at VPS Setup Record - LAMP. This is a follow-up post that targets at making our VPS more secure. Remember, to use vim to edit files, you need to press i to start inserting. When you finish, type on your keyboard :wq to save and exit.

Using Strong Password

The first thing is to make the password stronger and harder to be hacked. A good password should include at least one capital letter, one number, and one symbol. It should be of length > 8, and it should NOT contain any commonly used password like what has been listed here.

Use a password manager if you are afraid of forgetting the passwords. Get a trustable password manager as listed here. Continue reading VPS Setup Record - SSH Security

Install Scapy for Mac OS Yosemite

It's not painful but it still requires a few steps. Here I log them.

First thing is to make sure you installed Python 2.x. Not sure about whether Python 3 has similar steps. Also, here I assume Homebrew is installed too. If any of the following codes result in a Permission denied error, append sudo in front the commands. Continue reading Install Scapy for Mac OS Yosemite