Skip to content

Instantly share code, notes, and snippets.

free 4 ever

Aysad Kozanoglu AysadKozanoglu

free 4 ever
View GitHub Profile
AysadKozanoglu / nginx_log4j_protection.conf
Created November 1, 2022 23:11
nginx lua scripting against log4j protection
View nginx_log4j_protection.conf
# LUA block to detect, block and log Log4Shell attacks (C) Infiniroot 2021 (@infiniroot)
# with lua fixes and other enhancements from Andreas Nanko (@andreasnanko)
rewrite_by_lua_block {
function decipher(v)
local s = tostring(v)
if string.find(s, "${base64:") then
t=(string.gsub(s, "${${base64:([%d%a%=]+)}}", "%1"))
s=string.gsub(s, "${base64:([%d%a%=]+)}", tostring(ngx.decode_base64(t)))
AysadKozanoglu / preseed.cfg
Created October 26, 2022 20:55
debian preseed file for kvm automation
View preseed.cfg
# Author: Aysad Kozanoglu
# Version: 0.1
# changed: Wed 26 Oct 2022 08:56:15 PM CEST
# please note: while injecting this file, filename must be named exactly preseed.cfg (debian defaults)
# example -> /var/lib/config/buster/preseed.cfg
# -initrd-inject=/var/lib/libvirt/images/preseeds/buster/preseed.cfg
# full command example for virt-install
#### Contents of the preconfiguration file (for squeeze)
AysadKozanoglu / molokai.vim
Created October 26, 2022 18:41
my vim configuration
View molokai.vim
" mkdir ~/.vim/config
" ~/.vim/config/molokai.vim
" Vim color file
" Author: Tomas Restrepo <>
" Note: Based on the Monokai theme for TextMate
" by Wimer Hazenberg and its darker variant
AysadKozanoglu /
Created September 24, 2022 14:10 script handling for standalone mode
in this script webserver is nginx, so pre handling is only for nginx but you can change it to your needs and webserver
/root/ --standalone --issue -d www.${ACMEDOMAIN} -d ${ACMEDOMAIN} \
--cert-file /etc/ssl/${ACMEDOMAIN}-cert.pem \
--key-file /etc/ssl/${ACMEDOMAIN}-priv.pem \
--fullchain-file /etc/ssl/${ACMEDOMAIN}-fullchain.pem \
--pre-hook "nginx -s stop; killall nginx" \
--post-hook "nginx"
AysadKozanoglu / telegram.desktop
Created September 9, 2022 21:14
telegram app desktop config shortcut for menu entry item
View telegram.desktop
### create desktop file
#### user specific shortcut ~/.local/share/applications/telegram.desktop
#### globaly for all users shortcut /usr/share/applications/telegram.desktop
[Desktop Entry]
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
AysadKozanoglu / scp over multiple
Last active March 18, 2022 17:39
scp file over multiple hops
View scp over multiple

local copy remote file over hops with command scp

server A: (hops over)
server B: (remote file is here)

scp -oProxyJump=<user>@serverA <user>@<serverB>:<PATHtoFile> Downloads/

AysadKozanoglu / NGINX log4J JNDI
Last active December 17, 2021 11:49
NGINX log4J JNDI protection

put in server section of your virtual Host configuration following regex

server {

if ($request_uri ~* "jndi:*|\$\{*") {
              return 403;
AysadKozanoglu / roundcube spellcheck config
Created September 15, 2021 09:20
roundcube spellcheck with php-pspell moudle and aspell-de aspell-en dictonary
View roundcube spellcheck config

check your php extentions for spell extension existing

php -m | grep spell

info: you have to see pspell in the output, if not than install the php extension (see notice below)

AysadKozanoglu / shell php SHA256 hash
Last active September 14, 2021 13:14
shell php SHA256 hash encryption
View shell php SHA256 hash



$keystr = $argv[1];

echo "\n\nplain String:\n$keystr \n\nsha256 hash:\n". hash('sha256', $keystr ) ."\n\n" ;

AysadKozanoglu / AWS, digitalocean, scaleway all subnets blocking
Last active September 3, 2021 11:03
AWS, digitalocean, scaleway all subnets blocking iptables
View AWS, digitalocean, scaleway all subnets blocking

####SIBIT - / Germany

get by known AWS ip the originAS for whole AWS network

whois | grep "OriginAS"

you would get in the output originAS like

OriginAS: AS16509 #--> AWs ripe ORIGIN