Skip to content

Instantly share code, notes, and snippets.

View jkadbear's full-sized avatar
😑
Focusing

jkadbear jkadbear

😑
Focusing
View GitHub Profile
@jkadbear
jkadbear / gen_passwd.sh
Created November 1, 2025 09:00
random password
openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | head -c 16
sudo dmidecode -t system
cat /proc/cpuinfo | grep "model name" | uniq
free -h
lsblk -d -o NAME,MODEL,SIZE
@jkadbear
jkadbear / plot_hist.py
Created October 22, 2025 09:24
plot_hist
import matplotlib.pyplot as plt
def plot_hist(y, name="Data"):
plt.hist(y, bins=32, edgecolor='black')
plt.title(f"Histogram of {name}")
plt.xlabel('Value')
plt.ylabel('Frequency')
plt.show()
from pprint import pprint
def ff(N, di, dj, dk):
a = set([])
cnt = 0
print(di, dj, dk)
G1 = [0, 1, 5, 8, 10, 12, 15, 27, 30, 31, 33, 40, 46, 50, 52, 63, 68, 75, 76, 79, 90, 93, 95, 99, 100, 104, 106, 109, 110, 116, 123, 126]
G2 = [3, 4, 6, 9, 10, 18, 19, 20, 21, 26, 28, 36, 38, 49, 57, 58, 59, 61, 64, 65, 66, 69, 74, 85, 87, 91, 92, 101, 106, 108, 115, 119]
G3 = [2, 6, 10, 12, 13, 17, 20, 24, 27, 29, 34, 39, 41, 45, 48, 50, 53, 58, 63, 64, 83, 86, 89, 93, 102, 103, 109, 113, 114, 122, 124, 127]
for i in G1:
@jkadbear
jkadbear / rpi_gpio.py
Created June 28, 2018 08:52
RaspberryPi GPIO control
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(40, GPIO.OUT, initial=GPIO.LOW)
GPIO.output(40, GPIO.HIGH)
#GPIO.output(40, GPIO.LOW)
myip=`ip addr show wlan0 | grep 'inet ' | awk '{print $2}' | cut -d / -f 1`; curl SERVER_IP:SERVER_PORT -d "{\"name\": \"passgw\", \"ip\": \"$myip\"}" -H 'Content-Type: application/json'
nmap -sn -PE -n --min-hostgroup 1024 --min-parallelism 1024 169.254.*.* | grep -B 1 up
@jkadbear
jkadbear / nnxx.png
Last active October 9, 2017 18:09
Reduced Residue System
nnxx.png
#!/usr/bin/env python3
import re
import threading
import requests
def get_block(f):
block = []
for line in f:
if line.strip() == "":
// #include <stdio.h>
// constexpr char FLAG[] = "PLEASE_INPUT_THE_FLAG"; //input the flag !!!
// template <int _, int __> struct ___Fun1___ { enum { ___ = (_ == __) }; };
// template <int _, int __> struct ___fun2___ { enum { ___ = (_ ^ __) }; };
// template <int __> struct ___fun3___{enum { ___ = FLAG[__] };};
// template <int _,int __> struct ___fun4___{enum{___ = _ % __}; };
// template<int _, int __> struct ___fun5___ { const static int ___ = __ << _; };