Skip to content

Instantly share code, notes, and snippets.

@darren
darren / rtp_http.go
Last active May 7, 2024 06:59
最简单的Go代码实现联通的iptv转换为HTTP流, 实现类似udpxy的功能
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"os"
"strings"
@sebnyberg
sebnyberg / guide.md
Last active March 7, 2024 16:14
Ubuntu installation on iMac 2019 (MacOS 11 - Big Sur)

Ubuntu 20.04 with Wifi on iMac 2019 (MacOS 11 - Big Sur)

The purpose of this document is to summarize some of the things I had to figure out to successfully install Ubuntu on my iMac '19 27" 5K, a.k.a. iMac 19,1.

t2linux

From what I could find, iMac's do not have the t2 security chip. However, it does share hardware (and firmware) with contemporary Macbook Pros. For this reason, the t2linux.org website contains lots of helpful information about how to install Ubuntu on an iMac.

However, the guides on the t2linux website did not work for me when I ran it, so I had to mix and match some old pages from the wiki to make things work. Also, most issues are focused on Macbooks, not iMacs.

@torresashjian
torresashjian / linux-ubuntu-install-wifi-drivers
Last active April 12, 2024 09:07
How to install Broadcom bcm43602 Drivers on Ubuntu Linux
sudo apt-get purge bcmwl-kernel-source
sudo apt update
sudo update-pciids
sudo apt install firmware-b43-installer
sudo reboot #note that this will restart your computer
sudo iwconfig wlp3s0 txpower 10dBm
#sudo iwconfig wlp2s0 txpower 10dBm
@felix021
felix021 / socks5_proxy.go
Created November 21, 2020 08:12
Minimal socks5 proxy implementation in Golang
package main
import (
"encoding/binary"
"errors"
"fmt"
"io"
"net"
)
@FrankSpierings
FrankSpierings / frida-golang-symbol-enumerate.js
Last active June 13, 2023 14:27
Frida code to enumerate the Golang symbols
const utils = {
colors: {
red: function(string) {
return '\x1b[31m' + string + '\x1b[0m';
},
green: function(string) {
return '\x1b[32m' + string + '\x1b[0m';
},
@juliendkim
juliendkim / add (multiple) SRT to MP4 and MOV.sh
Last active April 29, 2024 13:19
Add multiple subtitles to an MP4/MOV with FFMPEG
# single subtitle with MP4(for MOV : change mov_text to srt)
$ ffmpeg -i VIDEO.mp4 -i SUBTITLE.srt -c:v copy -c:a copy -c:s mov_text OUTPUT.mp4
$ ffmpeg -i VIDEO.mov -i SUBTITLE.srt -c:v copy -c:a copy -c:s srt OUTPUT.mov
# multiple subtitles with MP4(for MOV : change mov_text to srt)
$ ffmpeg -i VIDEO.mp4 -i KOREAN.srt -i ENGLISH.srt \
-c:v copy -c:a copy -c:s mov_text \
-map 0:v -map 0:a -map 1 -map 2 \
-metadata:s:s:0 language=kor -metadata:s:s:1 language=eng \
OUTPUT.mp4
@bradfitz
bradfitz / ws.go
Created November 5, 2018 17:06
pre-Go1.12 websocket hijack+proxy
httpsServer := &http.Server{
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
hj, isHJ := w.(http.Hijacker)
if r.Header.Get("Upgrade") == "websocket" && isHJ {
c, br, err := hj.Hijack()
if err != nil {
log.Printf("websocket websocket hijack: %v", err)
http.Error(w, err.Error(), 500)
return
}
@aclements
aclements / madv_free.go
Created October 29, 2018 15:30
Tool for experimenting with MADV_FREE
// You may want to first disable transparent huge pages:
//
// echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
package main
import (
"flag"
"fmt"
"io/ioutil"

1:设置

sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p

2:安装

https://www.wireguard.com/install/
@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC: