Skip to content

Instantly share code, notes, and snippets.

View Zxce3's full-sized avatar
💤
Sleep for a while

Memet Zx Zxce3

💤
Sleep for a while
View GitHub Profile
@Zxce3
Zxce3 / phm.sh
Created February 23, 2024 16:36
php version manager bash script, to make it easier change between php version on debian/ubuntu
#!/bin/bash
# Function to display usage information
display_usage() {
echo "Usage: $0 [option] [version]"
echo "Options:"
echo " list : List available PHP versions"
echo " set-default : Set the default PHP version"
echo " switch : Switch PHP version"
echo "Example:"
@Zxce3
Zxce3 / index.php
Last active April 3, 2024 08:06
server dashboard in one file [WIP]
<?php
/**
* This file contains functions to retrieve system information and display it in a single file server dashboard.
* The functions include generating a safe ID, parsing lines, getting CPU info, load average, basic server info,
* CPU usage, memory usage, disk usage, and disk space.
*
* @author Zxce3
* @version 1.1
*/
@Zxce3
Zxce3 / config.conf
Created October 11, 2023 10:53
Kernel config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.6.0-rc5 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="Ubuntu clang version 16.0.6 (++20230710042046+7cbf1a259152-1~exp1~20230710162136.105)"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=160006
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=160006
<?php
const SECTIONS = [
"profile" => "Edit profile",
"password" => "Change password",
];
if (isset(SECTIONS[$section])) {
$opt["title"] = "Settings | " . SECTIONS[$section];
} else {
@Zxce3
Zxce3 / phloc.sh
Last active February 23, 2024 16:30
I don't know, it's just simple script
#!/bin/bash
# Script name: phloc
# Usage:
# phloc [port] [doc_root]
# port: port number to listen on (default: 8080)
# doc_root: document root (default: current directory)
# Description:
# Starts a PHP server on the specified port and document root.
# If no port is specified, the default port 8080 is used.
# If no document root is specified, the current directory is used.
@Zxce3
Zxce3 / main.c
Created January 16, 2023 00:03
Simple hello world! with libmicrohttpd
// libmicrohttpd-dev
// gcc -o main main.c -lmicrohttpd
#include <stdio.h>
#include <string.h>
#include <microhttpd.h>
const char *response_str = "<html><body>Hello, World!</body></html>";
int handle_request(void *cls,
@Zxce3
Zxce3 / wtf.c
Created January 14, 2023 20:26
wtf is this?
// create a mail server without include any library
// compile: gcc -o wtf wtf.c
// run: ./wtf
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@Zxce3
Zxce3 / ghostmd.py
Created January 2, 2023 04:52
Ghostwriter with openai
import requests
import os
import openai
import pathlib
import codecs
import lxml.etree
from lxml import etree
import argparse
from io import BytesIO
@Zxce3
Zxce3 / index.js
Created December 15, 2022 14:23
animein ref 1
const axios = require('axios');
const sharp = require('sharp');
const md5 = require("md5");
const fs = require("fs");
const { SocksProxyAgent } = require("socks-proxy-agent")
const { convertTo64 } = require('../utils/base64');
let httpsAgent = new SocksProxyAgent("socks5://47.243.240.46:1080" )
let fileName = "AniMeXin - "+ Math.random().toString(36).substr(2, 3) + "-" + Math.random().toString(36).substr(2, 3) + "-" + Math.random().toString(36).substr(2, 4);
httpsAgent.timeout = 30000;
const getAnime = (image) => {
[Unit]
Description=Guard-Bot Levina
Requires=network.target
[Service]
Type=simple
User=levina
Group=levina
# edit your working directory
WorkingDirectory=/home/levina/guard-bot