Generics in Java

Generics mean parameterized types. The idea is to allow type (Integer, String, … etc, and user-defined types) to be a parameter to methods, classes, and interfaces. Using Generics, it is possible to create classes that work with different data types. For example: // A Simple Java program to show working of user defined // Generic …

Use youtube-dl to download 1080P video with audio

Today I used youtube-tl to download videos from YouTube. Because of networking traffic it took me some time to finish, however, video downloaded successfully. But when I open the video then I notice the audio file not be downloaded simultaneously. Here is a way to fix this problem: youtube-dl -f 137+bestaudio –merge-output-format mkv youtube_url

How to build VPN using Shadowsocks

Purchase a VPS in CentOS. SSH to your VPS. Download and deploy Shadowsocks into your VPS. wget –no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh chmod +x shadowsocksR.sh ./shadowsocksR.sh 2>&1 | tee shadowsocksR.log Follow the promotions and set basic informaiton. If meet errors, install C compilor: yum -y install gcc automake autoconf libtool make yum -y install gcc-c++ some commands start:/etc/init.d/shadowsocks …

How to install JavaFX on Mac

The simplest way I have seen is to use brew: brew tap bell-sw/liberica brew install –cask liberica-jdk15-full Then we could use terminal at least to run our JavaFX program. However, I think here would be more setting steps if you wanna run it in some IDE.

How to deploy Nginx in CentOS

SSH to VPS ssh root@ip Update yum to install Nginx yum -y update Install Nginx yum install nginx Start Nginx and start Nginx when server launch systemctl start nginx systemctl enable nginx Check Nginx status systemctl status nginx Set firewall for visiting sudo firewall-cmd –permanent –zone=public –add-service=http sudo firewall-cmd –permanent –zone=public –add-service=https sudo firewall-cmd –reload …