Skip to content

Instantly share code, notes, and snippets.

@bojieli
bojieli / 2.1.cpp
Created May 17, 2015 18:33
Exercise 2.1
// compile with "g++ -std=c++11"
// to_string in C++11 is used
using namespace std;
#include <iostream>
#include <string>
#include <stdexcept>
class Date {
private:
int year;
@bojieli
bojieli / 2.2.cpp
Created May 17, 2015 18:34
Exercise 2.2
using namespace std;
#include <iostream>
#include <cmath>
class Complex {
private:
double real;
double im;
public:
@bojieli
bojieli / CVE-2015-5477.c
Created July 29, 2015 16:36
CVE-2015-5477 POC
/* CVE-2015-5477 POC
* An error in handling TKEY queries can cause named to exit with a REQUIRE assertion failure
* Affected software: ISC named (bind) 9.1.0 -> 9.8.x, 9.9.0->9.9.7-P1, 9.10.0->9.10.2-P2
*
* Copyleft Bojie Li <[email protected]>
*
* Free to modify and redistribute this program.
* Use at your own risk and you are responsible for what you are doing.
*/
#include<stdio.h>
### Keybase proof
I hereby claim:
* I am bojieli on github.
* I am boj (https://keybase.io/boj) on keybase.
* I have a public key ASBJWJNZ_y1nUZxwz_dbJj6-lTwHscbg-FgiF5pu-XA_0Ao
To claim this, I am signing this object:
@bojieli
bojieli / bypass-congestion-control.sh
Created April 24, 2025 06:59
Script to disable TCP congestion control and Nagle's algorithm for a specific IP address or domain
#!/bin/bash
# Script to disable TCP congestion control and Nagle's algorithm for a specific IP address or domain
# Automatically installs dependencies and compiles a kernel module if needed
# Check if script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root" >&2
exit 1
fi