Skip to content

Instantly share code, notes, and snippets.

View shanenoi's full-sized avatar
🚧
building my own culture

Shane Nguyễn shanenoi

🚧
building my own culture
View GitHub Profile
#include <cmath>
#include <string.h>
#include <iostream>
using namespace std;
class Integer {
public:
char* value[2] = { strdup("0"), strdup("+") };
@shanenoi
shanenoi / server.py
Created June 21, 2020 10:15
Actually this file is /usr/lib/python3.8/http/server.py, but I want when i run `python3 -m http.server` and it will show lan ip insteal 0.0.0.0!
"""HTTP server classes.
Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.
It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.
Notes on CGIHTTPRequestHandler
@shanenoi
shanenoi / cpu_ram.py
Last active July 31, 2020 01:59
hiện thông số hoạt động của máy tính lên wallpaper (cpu, ram, ....)
# python3 -m pip install psutil
# python3 -m pip install opencv-python
import cv2
import copy
import os
import psutil
import time
import shutil
@shanenoi
shanenoi / .bashrc
Last active September 14, 2020 03:30
Đây là cái bashrc của mình 😆
# ......... append these lines into your bashrc file ......... #
# run schedule.sh
if [ -f $HOME/schedule.sh ]; then
echo " __________"
echo -e "}~~~~[ SCHEDULE ]"
echo " ▔▔▔▔▔▔▔▔▔▔"
. $HOME/schedule.sh
fi
@shanenoi
shanenoi / HowToBuildJarFile.sh
Created August 18, 2020 10:26
Tìm hiểu Java khá lâu rồi nay mới biết cách build file jar bằng command :)
FILE=hello_world
CONTENT=$(cat <<-END
public class $FILE {
public static void main(String[] args) {
System.out.println(
"Excuse me, what the fuck!\\\n" +
"U dont know how to build jar by command?"
);
}
}
@shanenoi
shanenoi / locate.sh
Created August 19, 2020 13:42
Tại sao lại phải install Mlocate 🦧 trong khi chúng ta có thể code được chức năng chính của nó 🤯 Tốc độ thì không gọi là quá chậm 🦛🐷🐮
update_data () {
printf "[+] Update Data, Please Wait!\n"
rm ~/..locate_*
sudo find />~/..locate_$(date +%s) 2>/dev/null
exit 0
}
if [ "$1" = "--update" ];
then
update_data
@shanenoi
shanenoi / Kén Chọn :))).js
Last active November 14, 2020 06:28
Sort các video có lượt view cao trên Youtube
/* === Map on Vietnamese === */
// Units
MAP_VALUE = {
N: Math.pow(10,3),
Tr: Math.pow(10,6),
T: Math.pow(10,9)
}
// Details Regex
DETAILS = /(([\d,]+).+lượt xem)/
/* ================================= */
@shanenoi
shanenoi / find_by_name_or_content.py
Last active November 16, 2020 18:30
I love using Vim on Terminal. However if you want to open a file, you have to cd to the correct folder, too slow!!! This searching source will help our to open file correctly with some regex patterns (base on name or content search) [support InvertingMatch]
"""
|>>> I WILL PULBLISH THIS SOURCE AS A OFFICAL REPOSITORY AS SOON AS POSSIBLE
|>>> AND HOW TO INSTALL DUE TO EXPORTING AS SESSION VAR IN TERMINAL
# HOW TO USE??
+ python3 % -n name\.txt$ -v danh (search by name)
+ python3 % -n "password:[^ ]+" (search by contect)
"""
from os import popen, system, path, listdir
@shanenoi
shanenoi / Make Assembly Great Again.map
Created November 18, 2020 14:23
Ideas are coming up
# Make Assembly Great Again(linux)!!! #
[+] Hello world
````
section .data
msg db 'Hello, world!' ;string to be printed
len equ $ - msg ;length of the string
section .text
global _start ;must be declared for linker (ld)
@shanenoi
shanenoi / tasking.rb
Created November 22, 2020 12:41
Series Learning Ruby
def get_namespace(url)
namespace = ""
url.length.times { |i|
position = url.length - i - 6
if url[position] == "/"
break
end
namespace = url[position] + namespace
}
return namespace