Skip to content

Instantly share code, notes, and snippets.

@Delta-in-hub
Delta-in-hub / CVE-2024-3094.bt
Created April 2, 2024 14:11
bpf prog to catch CVE-2024-3094.
#!/bin/env -S BPFTRACE_LOG_SIZE=33554432 bpftrace --unsafe
/*
Date: 2024 04 02 22:10:43 CST UTC+8
Author: Delta<DeltaMail@qq.com>
Copyright © [2024]. All rights reserved.
*/
uprobe:/lib/x86_64-linux-gnu/libc.so.6:system
/ comm == "sshd" /
@Delta-in-hub
Delta-in-hub / block_ip_list.sh
Last active March 16, 2023 12:11
fetch and add blocked ip list to iptables
#!/usr/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:"$PATH"
ipsum_url="https://raw.githubusercontent.com/stamparm/ipsum/master/ipsum.txt"
firehol_level2_url="https://iplists.firehol.org/files/firehol_level2.netset"
blocklist_net_ua_url="https://iplists.firehol.org/files/blocklist_net_ua.ipset"
firehol_abusers_1d_url="https://iplists.firehol.org/files/firehol_abusers_1d.netset"
flush_ipset() {
ipset -q flush "$1"
@Delta-in-hub
Delta-in-hub / public-dns.txt
Last active January 10, 2023 10:17
smartdns & adguard home
# alidns
tls://dns.alidns.com
https://dns.alidns.com/dns-query
https://223.6.6.6/dns-query
https://223.5.5.5/dns-query
# dnspod
tls://dns.pub
tls://1.12.12.12
tls://120.53.53.53
https://doh.pub/dns-query
@Delta-in-hub
Delta-in-hub / marp.code-snippets
Created December 2, 2022 16:34
marp.code-snippets
{
"end-page-of-slide": {
"prefix": "end",
"body": [
"<!-- _backgroundColor: black -->",
"<!-- _color: white -->",
"<!-- _paginate: false -->",
"",
"<div align=\"center\" style=\"font-size: 100px\">",
"END",
@Delta-in-hub
Delta-in-hub / slidev.code-snippets
Created December 1, 2022 15:03
slidev.code-snippets
{
"Image-with-css": {
"prefix": "img",
"body": [
"<img src=\"${1}\" style=\"padding: 1% 1% 1% 1%; width: 100%; \" align=\"\" />"
],
"description": "Image-with-css(t r b l)"
},
"Img-Center": {
"prefix": "img-center",
@Delta-in-hub
Delta-in-hub / Template.md
Last active February 16, 2024 13:59
Obsidian-Zotero-Integration Template

{{title}}

[!info] Bibliography {{bibliography|replace("\n"," ")}}

Information

Key Value
Date {% if date %} {{date
Author {{authors}}{{directors}}
#!/bin/sh
smartdns_Bin="/etc/storage/smartdns-mipsel"
smartdns_Conf="/etc/storage/smartdns_m.conf"
smartdns_port="6053"
smartdns_Bin_Name="smartdns-mipsel"
# iptables -t nat -L
# netstat -tulpn | grep LISTEN
@Delta-in-hub
Delta-in-hub / ucp.cc
Last active April 18, 2022 11:10
ucp
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdint.h>
@Delta-in-hub
Delta-in-hub / alloc.cc
Last active April 5, 2022 06:25
alloc.cc
// #define NDEBUG
#include <bits/stdc++.h>
#define DEBUGPRINTF
#undef DEBUGPRINTF
using namespace std;
int cpuid = 0;
mutex _map_mutex;
#include <ciso646>
#include <string>
#include <string_view>
#include <iostream>
constexpr auto MAX_CMD_LINE = 1024;
#ifdef _WIN32
#include <windows.h>