Skip to content

Instantly share code, notes, and snippets.

View NP-chaonay's full-sized avatar
🎆
HNY 2025 and been RICKROLL

Nuttapong Punpipat NP-chaonay

🎆
HNY 2025 and been RICKROLL
View GitHub Profile
@NP-chaonay
NP-chaonay / ML_DL_AI_Snippets_1.py
Created September 10, 2020 13:55
Snippet for ML/DL/AI
# Check for data entries amount of dense layer (count weight+bias+output)
def dense_layer_datanum(in_shape,dense_out,axis=-1):
in_shape=list(in_shape)
dense_in=in_shape[axis]
in_shape[axis]=dense_out
result_out=1
for i in in_shape: result_out*=i
return (dense_in+1)*dense_out+result_out
@NP-chaonay
NP-chaonay / disk_overwriting.py
Last active December 26, 2020 14:16
Bytes Overwriting on Entire Disk, using Python
# [USER_PARAM] Path to device file
path='/dev/sda'
# [USER_PARAM] Physical Sector Size of Disk (Used only in buffer_size and information displaying, can be ignore)
physical_sector_size=4096
# [USER_PARAM] Buffer Size
buffer_size=physical_sector_size*2
# [USER_PARAM] Writing Bytes Value (Set to 0 to overwrite disk to zero, else set to 255 for overwriting to ones)
writing_bytes_value=0
# User Confirmation
@NP-chaonay
NP-chaonay / TCAS64_Snippets.md
Last active January 14, 2021 08:39
TCAS64 Scripts and Snippets for Python
@NP-chaonay
NP-chaonay / NewYearCountdownOnPython.py
Last active December 30, 2022 17:13
New Year Countdown But On Python
# WARNING: beware when using relative path, pls check working directory too.
# REMARK: pls see all comments, and in near actual NY event, run this script before time that "Countdown Final Alert" is occured (23:45 of NY Eve).
import subprocess as sp
import datetime,time
# Path to song
main_song_path='./Music/Edited/Events/NewYear2023/'
# Timestamp for "Countdown Final Alert" which alert before NY. 15minutes