๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set("display_errors", true); | |
header("Content-Type: application/json"); | |
require __DIR__."/../bootstrap/autoload.php"; | |
loadConfig("api"); | |
loadConfig("telegram_bot"); | |
function get_messages(PDO $pdo, int $chat_id, ?int $last_tmsg_id = NULL, | |
?int $limit = NULL): ?array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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]; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <endian.h> | |
#ifdef __x86_64__ | |
#define NOLIBC_ARCH_HAS_U128 | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-2.0-only | |
/* | |
* gwp2p - GNU/Weeb behind NAT Peer-to-Peer implementation. | |
* | |
* Copyright (C) 2023 Ammar Faizi <[email protected]> | |
* Copyright (C) 2023 Alviro Iskandar Setiawan <[email protected]> | |
* | |
* Thanks to Matthew Patrick <[email protected]> for the idea. | |
* | |
* Link: https://t.me/GNUWeeb/782010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-2.0-only | |
/* | |
* tc-nat.c - A simple NAT implementation using BPF. | |
* | |
* Copyright (C) 2023 Muhammad Aldin Setiawan <[email protected]> | |
* Copyright (C) 2023 Ammar Faizi <[email protected]> | |
*/ | |
#include <linux/if_ether.h> | |
#include <linux/pkt_cls.h> | |
#include <linux/types.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "tdx.h" | |
namespace tgbot { | |
void clean_pending_requests(Tdx *tdx) | |
{ | |
td_api::object_ptr<td_api::processChatJoinRequests> r; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-2.0-only | |
/* | |
* Copyright (C) 2023 Ammar Faizi <[email protected]> | |
*/ | |
class GWRouter { | |
parse_title(body) | |
{ | |
let m = body.match(/<title>(.*?)<\/title>/s); | |
if (m) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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> |