Skip to content

Instantly share code, notes, and snippets.

View hsnks100's full-sized avatar
😍
wow

Han Gyoung-Su hsnks100

😍
wow
View GitHub Profile
@hsnks100
hsnks100 / binary_util.go
Created April 14, 2022 12:27
golang snif
package main
import (
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
)
func uintToLittleEndian(u uint64, b int) []byte {
@hsnks100
hsnks100 / i3config
Last active November 26, 2021 02:17
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
#
@hsnks100
hsnks100 / main.rs
Created October 7, 2021 04:51
tcp 비동기 통신 rust 예제
use async_std::io::WriteExt;
use async_std::task;
use async_std::prelude::*;
use async_std::net::{TcpListener, TcpStream};
use async_std::sync::{Arc, Mutex};
use async_std::channel::{Receiver, Sender, self};
use bytes::{Bytes, BytesMut};
fn main() {
@hsnks100
hsnks100 / attack.go
Last active October 6, 2021 02:37
같은 일을 하는 golang 서버와 공격 클라이언트
package main
import (
"fmt"
"log"
"net"
"time"
)
func worker(id int, jobs <-chan int, results chan<- uint64) {
@hsnks100
hsnks100 / async-tcp.rs
Last active October 5, 2021 16:55
rust 통신 예제 제작중
use tokio::net::TcpListener;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use bytebuffer::ByteBuffer;
use core::convert::TryInto;
use bytes::{Bytes, BytesMut, Buf, BufMut};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let listener = TcpListener::bind("0.0.0.0:3333").await?;
@hsnks100
hsnks100 / main.rs
Created October 5, 2021 10:16
rust 구조체 개념박기
fn main() {
println!("area: {}", area(10, 10));
println!("area2: {}", area2((10, 10)));
let rect = Rectangle{h:10, w:10};
println!("area3: {}", area3(&rect));
println!("area3-1: {:?}", rect);
println!("area4: {:?}", rect.area());
} // 여기서 x는 스코프 밖으로 나가고, s도 그 후 나갑니다. 하지만 s는 이미 이동되었으므로,
@hsnks100
hsnks100 / main.rs
Created October 5, 2021 09:48
rust 소유권 개념 박살내기
fn main() {
f1();
f2();
f3();
f4();
f5();
} // 여기서 x는 스코프 밖으로 나가고, s도 그 후 나갑니다. 하지만 s는 이미 이동되었으므로,
// 별다른 일이 발생하지 않습니다.
@hsnks100
hsnks100 / config
Created October 1, 2021 11:55
i3 config
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
#
@hsnks100
hsnks100 / base64.cpp
Created March 29, 2021 02:25
base64 with binary
#include "base64.h"
#include <iostream>
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
static inline bool is_base64(BYTE c) {
docker ps -a
docker commit -m "coredump" 92b8935a7cd7
docker run -it <created image ID> /bin/bash
good luck.