Skip to content

Instantly share code, notes, and snippets.

View kgmyatthu's full-sized avatar
⚙️
Thinking about stuff

Kaung Myat Thu kgmyatthu

⚙️
Thinking about stuff
View GitHub Profile
@kgmyatthu
kgmyatthu / main.rs
Created September 21, 2023 08:24
Rust TCP echo server
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;
use tokio::net::TcpListener;
use tokio::net::TcpStream;
const ECHO_SERVER_ADDRESS: &str = "127.0.0.1:1337";
#[tokio::main]
async fn main(){
@kgmyatthu
kgmyatthu / sfold.cpp
Last active May 17, 2022 15:29
Number only hash algorithm
int sfold(std::string s, int M) {
long sum = 0, mul = 1;
for (int i = 0; i < s.length(); i++) {
mul = (i % 4 == 0) ? 1 : mul * 256;
sum += s.at(i) * mul;
}
return std::abs(sum) % M;
}
/* This function takes a string as input.
@kgmyatthu
kgmyatthu / arch_linux_installation_guide.md
Created December 12, 2021 06:07
Arch Linux Installation Guide

Intro

This is a very high level summary guide on installing Arch linux. This is not step by step tutorial for beginner.

Prerequisite

  • Secure Boot Disabled
  • Check if your system is UEFI or BOIS
  • Burn the Arch linux iso on a usb device

Installation

Reboot the machine pick usb device in bootloader and proceed to following.