Skip to content

Instantly share code, notes, and snippets.

View chenjie's full-sized avatar
🍁

Chenjie Ni chenjie

🍁
View GitHub Profile

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@chenjie
chenjie / dc_bst.py
Created May 17, 2019 00:43
Mirror/Deep copy of a Binary Tree/BST without recursion (iterative approach)
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@chenjie
chenjie / .gitignore
Created October 22, 2018 23:14 — forked from andreasonny83/.gitignore
Gitignore template for JavaScript projects
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Runtime data
pids
*.pid
@chenjie
chenjie / git-tips.md
Created October 14, 2018 22:49
Git的奇技淫巧🙈

Git的奇技淫巧:see_no_evil:

Git常用命令集合,Fork于tips项目

Git是一个“分布式版本管理工具”,简单的理解版本管理工具:大家在写东西的时候都用过“回撤”这个功能,但是回撤只能回撤几步,假如想要找回我三天之前的修改,光用“回撤”是找不回来的。而“版本管理工具”能记录每次的修改,只要提交到版本仓库,你就可以找到之前任何时刻的状态(文本状态)。

下面的内容就是列举了常用的Git命令和一些小技巧,可以通过"页面内查找"的方式进行快速查询:Ctrl/Command+f

开卷必读

如果之前未使用过Git,可以学习Git小白教程入门

@chenjie
chenjie / centos-python27.sh
Created September 8, 2018 16:18
Build Python 2.7 from scretch in CentOS.
#!/bin/bash
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
yum install xz-libs
wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
xz -d Python-2.7.10.tar.xz
tar -xvf Python-2.7.10.tar
cd Python-2.7.10
@chenjie
chenjie / git_toturial
Created August 19, 2018 21:08 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@chenjie
chenjie / shadowsocksR.sh
Created August 19, 2018 20:54
Shadowsocks(R) setup script backup.
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6,7, Debian, Ubuntu #
# Description: One click Install ShadowsocksR Server #
# Author: Teddysun <i@teddysun.com> #
# Thanks: @breakwa11 <https://twitter.com/breakwa11> #
# Intro: https://shadowsocks.be/9.html #
#=================================================================#
@chenjie
chenjie / bbr.sh
Last active August 19, 2018 20:57
BBR installation script translation and backup.
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: Debian/Ubuntu
# Description: Modified version of BBR
# Version: 1.0
# Author: 雨落无声
# Blog: https://www.zhujiboke.com
@chenjie
chenjie / setup-an-ssr-server.md
Last active September 23, 2022 07:09
Deploy your own Shadowsocks(R) server with BBR TCP congestion control algorithm in less than 10 steps.

What is Shadowsocks(R)?

It is a fast and secure socks5 proxy designed to protect your Internet traffic. You can learn more here.
Long story short, it is a proxy that is commonly (and secretly) used in mainland China. People use it to access GFW blocked websites, such as Google, Facebook, etc. You can view a more detailed blocked website list here.

ss-diagram
Source: https://tumutanzi.com/archives/13005

What is BBR?

BBR ("Bottleneck Bandwidth and Round-trip propagation time") is a new congestion control algorithm developed at Google. Congestion control algorithms — running inside every computer, phone or tablet connected to a network — that decide how fast to send data. You can learn more [here](https://cloudplatform.googleblog.com/2017/07/TCP-BBR-congestion-control-come