Skip to content

Instantly share code, notes, and snippets.

View ammarfaizi2's full-sized avatar
🥷
Hurr durr I'ma ninja sloth

Ammar Faizi ammarfaizi2

🥷
Hurr durr I'ma ninja sloth
View GitHub Profile
#include <stdio.h>
#include <string.h>
static const char store_file[] = "./todo_data.bin";
static const char store_file_tmp[] = "./todo_data.bin.tmp";
struct todo {
char data[255];
};
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <endian.h>
#ifdef __x86_64__
#define NOLIBC_ARCH_HAS_U128
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "../io_ring_internal.h"
#include "../dns/dns_resolver.h"
#include "../dns/dns_ares.h"
#define MAX_TRY_COUNT 5
struct dns_arg {
// SPDX-License-Identifier: GPL-2.0-only
/*
* gwp2p - GNU/Weeb behind NAT Peer-to-Peer implementation.
*
* Copyright (C) 2023 Ammar Faizi <ammarfaizi2@gnuweeb.org>
* Copyright (C) 2023 Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
*
* Thanks to Matthew Patrick <ThePhoenix576@gnuweeb.org> for the idea.
*
* Link: https://t.me/GNUWeeb/782010
<?php
if (!isset($_GET["key"]) || $_GET["key"] !== "secure your endpoint") {
http_response_code(403);
exit(0);
}
header("Content-Type: text/plain");
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER["REMOTE_ADDR"] ?? "";
echo file_get_contents("https://freedns.afraid.org/dynamic/update.php?your_key=x&address=".urlencode($ip));
// SPDX-License-Identifier: GPL-2.0-only
/*
* tc-nat.c - A simple NAT implementation using BPF.
*
* Copyright (C) 2023 Muhammad Aldin Setiawan <aldinsetiawan99@gmail.com>
* Copyright (C) 2023 Ammar Faizi <ammarfaizi2@gnuweeb.org>
*/
#include <linux/if_ether.h>
#include <linux/pkt_cls.h>
#include <linux/types.h>
#include <iostream>
#include "tdx.h"
namespace tgbot {
void clean_pending_requests(Tdx *tdx)
{
td_api::object_ptr<td_api::processChatJoinRequests> r;
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2023 Ammar Faizi <ammarfaizi2@gnuweeb.org>
*/
class GWRouter {
parse_title(body)
{
let m = body.match(/<title>(.*?)<\/title>/s);
if (m)
#include <ares.h>
#include <ares_dns.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <threads.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>