Skip to content

Instantly share code, notes, and snippets.

View Akagi201's full-sized avatar
🎯
Focusing

Bob Liu Akagi201

🎯
Focusing
View GitHub Profile
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@reidransom
reidransom / gist:2630650
Created May 7, 2012 21:41
Timecode burn with ffmpeg
# Timecode burn with ffmpeg
# ffmpeg must be configured with --enable-libfreetype
# box=1 - tells ffmpeg to draw a box around the text
# boxcolor - format is 0xRRGGBB[AA]
ffmpeg -i video.mov -vcodec libx264 -cmp 22 -vf "drawtext=fontfile=DroidSansMono.ttf: timecode='09\:57\:00\:00': r=23.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099" -y output.mov
@eddieh
eddieh / libevent-v-libuv.md
Last active March 7, 2024 20:33
libevent vs libuv

libevent vs libuv

Comparing libevent and libuv. My upfront biased: I want to like libevent. However, I want to objectively compare the two and make an informed decision.

What versions are we comparing?

  • libevent 2.0.22 (Stable) [2014-01-05]
  • libuv 1.8.0 (Stable) [2015-12-15]
@nanoninja
nanoninja / jose_jwt_go_usage.md
Created September 29, 2016 14:35
JOSE - JWT Usage Examples

JOSE - JWT Usage Examples

JOSE is a comprehensive set of JWT, JWS, and JWE libraries.

jwt.io

Installation

go get github.com/SermoDigital/jose
@cr3ative
cr3ative / gist:8340001
Last active February 14, 2024 03:31
Drift HD Ghost - Technical Notes and Root

## Drift HD Ghost - Technical Notes and Root

Note: Please don't attempt anything here unless you are comfortable with the possibility of permanently damaging your camera. I also do not guarantee your camera is the same as mine - this is just for information and fun! It goes without saying that I take no responsibility for what you do with this information, and it will probably invalidate your warranty too.

It is reported that the firmware re-flash does not appear to disable the debug network on a Ghost S.

  • Most of this was found by simply running strings over publically available firmware and software, then searching around for anything interesting.
  • The camera runs on the Ambarella A5S chipset, which appears to run PrKERNEL (implementing uItron): http://www.esol.com/embedded/prkernelv4.html, then boots Linux as a process inside the uItron OS.
  • There's lots of references to BOSS in the firmware, presumably a codename for this chipset from Ambarella.
  • The code on the device-side is a very close im
@justinas
justinas / 1_singlehost.go
Last active November 29, 2023 11:41
Go middleware samples for my blog post. http://justinas.org/writing-http-middleware-in-go/
package main
import (
"net/http"
)
type SingleHost struct {
handler http.Handler
allowedHost string
}
@fatih
fatih / set.go
Created August 11, 2013 21:05
Concurrent safe SET data structure in Go (Golang)
// A very simple example about how to use concurrent-safe SETs (using string as keys) in GO
package main
import (
"fmt"
"sync"
)
type Set struct {
m map[string]bool

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

@jbardin
jbardin / proxy_copy.go
Last active June 28, 2023 22:12
Go TCP Proxy pattern
package proxy
import (
"io"
"log"
"net"
)
func Proxy(srvConn, cliConn *net.TCPConn) {
// channels to wait on the close event for each connection
@ninehills
ninehills / wr703n-openwrt.md
Last active December 9, 2022 13:37
WR703N OpenWrt 配置流程

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。