Skip to content

Instantly share code, notes, and snippets.

View ammarfaizi2's full-sized avatar
๐Ÿ€
Baby Opossum Posse

Ammar Faizi ammarfaizi2

๐Ÿ€
Baby Opossum Posse
View GitHub Profile
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* Copyright (C) 2023 Ammar Faizi <[email protected]>
*
* This is the freshtea file transfer. It's just a simple file
* transfer app using io_uring.
*
*/
/**
* Fresh tea file transfer.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <assert.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
<?php
// SPDX-License-Identifier: Public domain
/**
* @author Ammar Faizi <[email protected]>
*
* A simple example for uploading a file via bot Telegram.
*
* Link: https://discord.com/channels/845302963739033611/845302963739033613/1057316446662819860
*/
const BOT_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxx";
@ammarfaizi2
ammarfaizi2 / main.c
Last active December 16, 2022 17:51
Extreme GNU/Weeb HTTP Server
// SPDX-License-Identifier: GPL-2.0-only
/**
* Copyright (C) 2022 Ammar Faizi <[email protected]>
*
* This is the Extreme GNU/Weeb HTTP Server. I wrote this program
* because of a challenge from Alviro. The challenge is to create
* a web server application *without including any library*. The
* web server has to show the directory list and handle download
* file. It must also be able to handle 10K concurrent requests.
*
// SPDX-License-Identifier: Public Domain
/*
* @author Ammar Faizi <[email protected]>
*
* A simple Telegram bot example for @nekonyameow.
*
* Goals:
* - Parallel messages processing.
* - Single getUpdate thread.
* - Workqueue implementation.
#include <queue>
#include <stack>
#include <cstdio>
#include <cerrno>
#include <vector>
#include <cstring>
#include <list>
enum QueryType {
/*
* A syscall decoder to solve a challenge from Alviro.
*
* Link: https://t.me/GNUWeebTDD/7955
*/
#include <sys/syscall.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/user.h>
<?php
/*
* @author Ammar Faizi <[email protected]>
*
* A simple HTTP Server. I make this program just to do a challenge
* from @codenoid.
*
* Link: https://t.me/GNUWeebTDD/7822
* Link: https://twitter.com/imrenagi/status/1591659569637634048
*/
const { CNRingMaster } = require('../../chnet/chnet.js');
function do_http_get() {
let ring = new CNRingMaster;
let ch = ring.CreateNet("https://www.google.com");
/*
* This user data can be set to anything. It will
* be passed into the callback and accessible via
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
#include <stdbool.h>
#include <limits.h>
#include <stdlib.h>
#include <errno.h>