Skip to content

Instantly share code, notes, and snippets.

View fuji246's full-sized avatar

Jiantao Fu fuji246

View GitHub Profile
@fuji246
fuji246 / connect-mitm-proxy.go
Created March 16, 2024 18:47
HTTP Forward Proxy with TLS interception
// Implements a tunneling forward proxy for CONNECT requests, while also
// MITM-ing the connection and dumping the HTTPs requests/responses that cross
// the tunnel.
//
// Requires a certificate/key for a CA trusted by clients in order to generate
// and sign fake TLS certificates.
//
// Eli Bendersky [https://eli.thegreenplace.net]
// This code is in the public domain.
package main
@fuji246
fuji246 / llm_ai_app.md
Last active December 16, 2023 17:27
llm ai application

OpenAI's Eval tool.

Eval provides a framework and leaderboard benchmarking different language models against a standardized set of tests measuring capabilities like reasoning, knowledge, and fluency.

Eval focuses on benchmarking the core model quality - it is not a full testing solution for downstream applications and interfaces built on top of models.

The standard tests measure narrow academic metrics. Real-world applications require validation of business logic, data correctness, personalized performance etc.

Eval ranks public reference models. It does not offer environment to build custom tests for proprietary systems.

@fuji246
fuji246 / llm_traditional_test.md
Last active December 14, 2023 22:59
LLM for traditional software testing

LLMs have the potential to assist with several aspects of traditional software testing:

  • Test case generation: LLMs could analyze requirements documents and design specifications to automatically generate test cases that cover different scenarios, use cases, and edge cases. This could amplify testing significantly.

  • Test script creation: For manual testing needs, LLMs could take high-level descriptions of test scenarios and automatically generate detailed test scripts and cases ready for execution. This would reduce manual scripting effort.

  • Test data generation: Generating effective test data is crucial but challenging. LLMs may be trained on past test data to automatically generate new valid and invalid test data sets for robust testing.

  • Log analysis: Large logs produced during testing are hard to analyze manually. LLMs can be leveraged to automatically parse logs to identify software defects, anomalies, warnings to surface insights.

@fuji246
fuji246 / traffic-control-macos.sh
Created July 7, 2022 20:43
Block UDP traffic in macOS
#!/bin/bash
# kbit
LINK_BW="800"
RAND_LOSS="0.00"
# ms
DELAY=0
@fuji246
fuji246 / submodule-clean.txt
Last active June 2, 2022 18:09
fix submodule issues
git clean -dfx && git submodule foreach --recursive "git clean -dfx" && git checkout . && git pull origin master && git submodule sync && git submodule update --init --recursive
git submodule sync
git submodule foreach --recursive
git submodule update --init --recursive
git reset --hard
git clean -fdx
@fuji246
fuji246 / Xcode4TestFlightintegration.sh
Created May 1, 2022 13:36 — forked from martijnthe/Xcode4TestFlightintegration.sh
ReWrite of "Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode"
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#
@fuji246
fuji246 / keybase.md
Created March 12, 2022 18:16
keybase.md

Keybase proof

I hereby claim:

  • I am fuji246 on github.
  • I am jeromyfu (https://keybase.io/jeromyfu) on keybase.
  • I have a public key ASAtj5xF-8mOSZvCj93gfjqji5B6Lqpf4yOTr4QQX6gi8Ao

To claim this, I am signing this object:

@fuji246
fuji246 / acepcT11Ubuntu.md
Last active January 22, 2023 17:43
ACEPC T11 install ubuntu

Notes for ACEPC T11 Ubuntu installation

  1. Install Ubuntu 20.04 fix the HDMI audio issue. But need to set Start Application to choose the default audio input/output.

  2. WiFi driver:

sudo apt install dkms bc git 
git clone https://github.com/brektrou/rtl8821CU.git
cd rtl8821CU
@fuji246
fuji246 / raspbian-no-icon-fix.md
Created March 1, 2021 20:29
Fix no icon issue in Raspbian when upgrade from lite version
sudo apt-get update 
sudo apt-get -y dist-upgrade
sudo apt-get install raspberrypi-ui-mods -y

sudo apt-get install libgdk-pixbuf2.0-dev -y
sudo /usr/lib/arm-linux-gnueabihf/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders  --update-cache
sudo reboot
@fuji246
fuji246 / red_simulation.py
Created February 10, 2021 19:34
Audio RED simulation
import argparse
import random
import matplotlib.pyplot as plt
from collections import defaultdict
class PktDrop(object):
def drop(self):
return False