Skip to content

Instantly share code, notes, and snippets.

View HKAB's full-sized avatar
🌎
imagining

Nguyễn Phú Trường HKAB

🌎
imagining
View GitHub Profile
@HKAB
HKAB / squid3.conf
Created December 28, 2017 06:51
Squid.conf file to allow all.
#Recommended minimum configuration:
acl to_localhost dst 127.0.0.0/8
acl localnet src 0.0.0.0/8 192.168.100.0/24 192.168.101.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
@HKAB
HKAB / script.au3
Last active September 27, 2021 16:03
Small script `tăng võ` for 'Chân Long giáng thế'
$hWnd = WinWait("S207 - Chân Long 2016 - Google Chrome")
WinActivate($hWnd)
;ControlClick("S207 - Chân Long 2016 - Google Chrome", "", "Chrome_WidgetWin_1", "left", 1, 1047, 563)
$i = 1
@HKAB
HKAB / guild.md
Last active September 27, 2021 16:02
tf-pose-estimation setting steps
@HKAB
HKAB / compare_cassandra_mysql.html
Last active September 27, 2021 16:00
A nice UI to compare Cassandra and MySQL
<!DOCTYPE html>
<html>
<head>
<title>DBMS</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
@HKAB
HKAB / environments.txt
Last active September 27, 2021 16:00
My conda setup so that i can use my shitty GTX 960 to train pytorch model (CUDA 11.2)
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
_libgcc_mutex=0.1=main
argon2-cffi=20.1.0=pypi_0
async-generator=1.10=pypi_0
attrs=20.3.0=pypi_0
backcall=0.2.0=pyhd3eb1b0_0
bleach=3.3.0=pypi_0
ca-certificates=2021.1.19=h06a4308_0
@HKAB
HKAB / banker.py
Last active September 28, 2021 04:27
Banker algorithm in OS
import numpy as np
Allocation = np.array([ [0, 1, 0],
[2, 0, 0],
[3, 0, 2],
[2, 1, 1],
[0, 0, 2]]
)
Max = np.array([[7, 5, 3],
[3, 2, 2],
@HKAB
HKAB / xss.js
Created September 10, 2021 14:34
<script>alert("it's me!")</script>
@HKAB
HKAB / hill_cypher.py
Last active September 27, 2021 15:56
Hill Cipher Algorithm with GUI
import numpy as np
import sys
import PySimpleGUI as sg
# Tutorial: https://www.jigsawacademy.com/blogs/cyber-security/hill-cipher/
def matrix_cofactor(matrix):
return np.linalg.inv(matrix).T * np.linalg.det(matrix)
def egcd(a, b):
@HKAB
HKAB / a51.py
Last active September 27, 2021 15:55
A5/1 Cipher Algorithm
p = '111000'
# 19b, 21b, 22b
k = '1100110110101101011011001010110001101110011100010011100011101111'#1100110110101101011. 0110010101100011011100.11100010011100011101111
x = k[:19]
y = k[19:41]
z = k[41:]
s = ''
# print(x, y, z)
@HKAB
HKAB / rc4.py
Last active September 27, 2021 15:55
RC4 Cipher Algorithm
N = 10
S = [0]*256
T = [0]*256
K = [10, 20, 25, 15, 40, 60, 30, 70, 75, 90]
P = [1, 2, 2, 2]
C = []
for i in range(0, 256):
S[i] = i
T[i] = K[i % N]