Skip to content

Instantly share code, notes, and snippets.

View zhiguangwang's full-sized avatar

Zhiguang Wang zhiguangwang

View GitHub Profile
@zhiguangwang
zhiguangwang / README.md
Last active January 31, 2024 17:35 — forked from ygmpkk/sslocal.service
Shadowsocks Systemd Service

Copy ssserver.service to under /lib/systemd/system/ and run:

sudo systemctl enable ssserver
sudo systemctl start ssserver

sudo systemctl status ssserver

@zhiguangwang
zhiguangwang / README.md
Created April 27, 2016 03:41
Find all shell scripts and add execute permissions to all of them.
find . -name "*.sh" -exec chmod u+x {} \;
@zhiguangwang
zhiguangwang / .bash_aliases
Created April 24, 2016 13:59
Convenient aliases to list TCP listeners and connections on Ubuntu
alias netls='sudo netstat -plant | grep LISTEN'
alias netls4='sudo netstat -4 -plant | grep LISTEN'
alias netls6='sudo netstat -6 -plant | grep LISTEN'
alias netlsc='sudo netstat -plant | grep -v LISTEN'
alias netlsc4='sudo netstat -4 -plant | grep -v LISTEN'
alias netlsc6='sudo netstat -6 -plant | grep -v LISTEN'
alias netlsa='sudo netstat -plant'
@zhiguangwang
zhiguangwang / README.md
Last active August 25, 2023 12:47
Disable and Enable kdc on Mac OS X

If you don't like or need the kdc process on Mac OS X, which opens TCP port 88 to the world, you can disable it with launchctl.

Disable:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.Kerberos.kdc.plist

Enable:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.Kerberos.kdc.plist
@zhiguangwang
zhiguangwang / README.md
Last active April 12, 2016 01:57
Increase scrollback buffer of GNU screen

The default setting is 100.

3 ways to set scrollback buffer:

From the .screenrc file

Edit ~/.screenrc:

defscrollback [num]
@zhiguangwang
zhiguangwang / README.md
Last active June 23, 2023 09:50
Building Unreal Engine Game Client and Dedicated Server on Linux.

Building Unreal Engine Game Client and Dedicated Server on Linux

Because the build tools of UE4 works across platforms (Windows, Mac OS, Linux), steps in this article can be applied to Mac OS and Windows as well.

On Windows, You need to replace RunUAT.sh with RunUAT.bat though.

Prerequisites

First, get Unreal Engine 4 sourcecode and export the following environment variables:

@zhiguangwang
zhiguangwang / .vimrc
Created April 8, 2016 04:10
Vim configurations with file indent and syntax highlighting.
" Enable different settings for different file types
" See: http://vim.wikia.com/wiki/Indenting_source_code
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
@zhiguangwang
zhiguangwang / README.md
Last active April 8, 2016 02:00
Install latest stable Git on Ubuntu

Install latest stable Git on Ubuntu

Install the most current stable version of Git for Ubuntu, using PPA of Ubuntu Git Maintainers team.

For details, see this PPA page.

@zhiguangwang
zhiguangwang / README.md
Last active April 8, 2016 02:05
Install Oracle Java 8 on Ubuntu

Install Oracle Java 8 on Ubuntu

Install Oracle JDK 8 on Ubuntu, using the webupd8team PPA.

@zhiguangwang
zhiguangwang / get-process-cpu-usage.md
Last active April 20, 2016 01:43
Get CPU usage of a process by name
top -b -n 1 -p `pgrep $PROCESS_NAME` | grep $PROCESS_NAME | awk {'print $9'}