Skip to content

Instantly share code, notes, and snippets.

View Harold2017's full-sized avatar
😃

Harold Harold2017

😃
View GitHub Profile

check port occupied by which process

sudo lsof -i
sudo lsof -i | grep TCP
sudo lsof -i :80 | grep LISTEN
sudo netstat -lptu
sudo netstat -tulpn
sudo ls -l /proc/$pid/exe
@Harold2017
Harold2017 / Pipenv-on-Mac.md
Last active March 1, 2019 09:19
Install and setup pipenv on Mac

Install pipenv

with brew

brew install pipenv

with pip3

pip3 install pipenv
@Harold2017
Harold2017 / Tencent-Cloud-setup-Shadowsocks-and-Google-BBR.md
Last active March 1, 2019 09:25
Tencent-Cloud-setup-Shadowsocks-and-Google-BBR

Update linux kernel

Find avaliable kernel

sudo apt-get update
apt-cache search --names-only linux-image

I found linux-image-4.15.0-36-generic is avaliable both in the kernel list and bbr list

Update both image and corresponding headers

docker rmi $(docker images -q -f dangling=true)
# docker rmi --force $(docker images -q -f dangling=true)
@Harold2017
Harold2017 / ImageMagick_with_rsvg.md
Created March 21, 2019 09:14
Solve svg rendering problem when composite image with transparent svg

check ImageMagick format:

covert -list format

check ImageMagick config:

convert -list configure | grep svg

install rsvg

apt-get install librsvg2-bin

build ImageMagick with rsvg

wget https://imagemagick.org/download/ImageMagick-6.9.10-34.tar.gz
@Harold2017
Harold2017 / terminal_ss.md
Created April 21, 2019 16:57
terminal with ss

add alias function to ~/.zshrc

# proxy list
proxy() {
  export all_proxy=socks5://127.0.0.1:1086
  export http_proxy=http://127.0.0.1:1087
 export https_proxy=http://127.0.0.1:1087
@Harold2017
Harold2017 / opencv_setup.sh
Created July 9, 2019 03:18 — forked from Mahedi-61/installing_opencv_from_source_in_Ubuntu_1804.sh
Installing OpenCV from source on Ubuntu 18.04 machine
#!/bin/bash
# This gist is a step by step instructions to build and install OpenCV from source on ubuntu 16.04 LTS
# note: The easy and quick way to install is
# sudo pip3 install opencv-python
# sudo pip3 install opencv-contrib-python
# But this easy pypi installation can’t open video files on GNU/Linux distribution or on mac OS X system.
# And on some system opencv binaries provided packages are not compiled.
# Therefor we have no way rather than build it from source.