Skip to content

Instantly share code, notes, and snippets.

View hktaskin's full-sized avatar

Halil Kemal TASKIN hktaskin

View GitHub Profile
@hktaskin
hktaskin / wifi_wpa_crack
Last active May 1, 2023 09:33
WPA Handshake Capture and Crack the Passphrase
# Capture WPA Handshake and use a dictionary to find the WiFi passphrase
# https://www.aircrack-ng.org/doku.php?id=cracking_wpa
# https://www.kali.org/tools/aircrack-ng/
# Install Wi-Fi Adapter Drivers and reboot
sudo apt install firmware-ath9k-htc
sudo reboot
# Check interface name
@hktaskin
hktaskin / DisplayLayerAndLineOnLCD.py
Last active June 25, 2021 06:51
CURA G-Code Post Processing Plugin
# Cura PostProcessingPlugin
# Author: Amanda de Castilho
# Date: August 28, 2018
# Modified: September 27, 2020 by HKT
# Description: This plugin shows custom messages about your print on the Status bar...
# Please look at the 3 options
# - Scolling (SCROLL_LONG_FILENAMES) if enabled in Marlin and you arent printing a small item select this option.
# - Name: By default it will use the name generated by Cura (EG: TT_Test_Cube) - Type a custom name in here
# - Max Layer: Enabling this will show how many layers are in the entire print (EG: Layer 1 of 265!)
#!/bin/bash
# CA icin private key uret
sudo openssl genrsa -out ca.key 2048
# CA sertifikasini selfsigned olarak olustur
echo "------------------------------------------"
echo " CA SERTIFIKA OLUSTURMA "
echo "------------------------------------------"
sudo openssl req -new -x509 -key ca.key -out ca.crt
# Uygulama icin private key uret
sudo openssl genrsa -out cert1.key 2048
#! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import datetime
import socket
# Yet Another Humble Banner Grabber
# 03.07.2020
# https://hkt.me
#
@hktaskin
hktaskin / apache_ssl_example
Last active August 29, 2022 19:20
Apache & OpenSSL example
---------------------
Ubuntu & Apache & SSL
---------------------
# Install Apache
sudo apt-get install apache2
# Generate 2048-bit RSA private key
openssl genrsa -out server.key 2048
@hktaskin
hktaskin / pow_expected_value.md
Last active May 11, 2020 21:18
PoW Wasted Power
// 2020.05.11 23:30 GMT+3
// https://btc.com/stats/pool?pool_mode=all
// http://magma.maths.usyd.edu.au/calc/
a := [230830, 54202, 48949, 32935, 32893, 23083, 20836, 19513, 18027, 17378, 15315, 12733, 11387, 11355, 6464, 6392, 629, 5753, 5672, 4845, 4177, 3595, 3127, 2445, 2428, 2093, 1918, 1895, 183, 1824, 1641, 1508, 1291, 129, 1254, 1002, 908, 816, 745, 703, 676, 623, 583, 517, 449, 445, 441, 346, 333, 333, 303, 297, 293, 285, 239, 226, 197, 188, 162, 153, 133, 116, 114, 113, 105, 91, 86, 77, 54, 52, 48, 48, 46, 44, 43, 42, 41, 40, 39, 29, 26, 22, 22, 20, 20, 16, 10, 10, 9, 8, 6, 5, 3, 1, 1, 1, 1, 1];
t := &+[i : i in a];
p := &+[(a[i]/t)*(1-(a[i]/t)) : i in [1..#a]]+0.;
print p;

// 0.835175146537319895727358956437

@hktaskin
hktaskin / WHO_handrub_formulation.md
Last active April 8, 2020 18:12
WHO-recommended Handrub Formulation #2

WHO-recommended Handrub Formulation #2

Scaled from 10L to 250mL and measurements converted to gram

Grams at 20 °C

ISOP 7515mL / 40 = 187.875mL * 0.785  g/mL = 147.481g ~ 147.5g
H2O2  417mL / 40 =  10.425mL * 1.007  g/mL =  10.498g ~  10.5g

GLYC 145mL / 40 = 3.626mL * 1.261 g/mL = 4.572g ~ 4.6g

@hktaskin
hktaskin / tsc_assets_diff.py
Created January 23, 2020 07:50
Tenable.sc Asset Difference Checker
from tenable.sc import TenableSC
import datetime
import difflib
from shutil import copyfile
import os
import smtplib
# crontab
# At 08:30 on every day-of-week from Monday through Friday.
# 30 8 * * 1-5 python /home/user/tsc_assets/tsc_assets.py >> /home/user/tsc_assets/log.txt