Skip to content

Instantly share code, notes, and snippets.

View rojenzaman's full-sized avatar
🏴
Why?

Rojen Zaman rojenzaman

🏴
Why?
  • localhost
  • Istanbul, Turkey
  • 06:03 (UTC +03:00)
View GitHub Profile
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@rojenzaman
rojenzaman / curl.sh
Created November 26, 2020 04:07
Bash get file from web to stdout without curl or wget as using /dev/tcp
function __curl() {
read proto server path <<<$(echo ${1//// })
DOC=/${path// //}
HOST=${server//:*}
PORT=${server//*:}
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80
exec 3<>/dev/tcp/${HOST}/$PORT
echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3
(while read line; do
@rojenzaman
rojenzaman / README.md
Last active July 16, 2026 11:22
windows-remote-access-audit

Windows Remote-Access Security Auditor

A read-only PowerShell security auditor for Windows 10 and Windows 11. It helps an authorized computer owner review remote-access software, RMM agents, persistence, listening ports, active connections, remote sessions, local administrators, Windows remote-management exposure, and Microsoft Defender configuration.

The tool reports evidence; it does not remove software, stop services, change firewall rules, quarantine files, or upload system information.

@rojenzaman
rojenzaman / dynmotd
Last active February 7, 2026 17:12 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# Installation:
#
# 1. nano /etc/ssh/sshd_config
# PrintMotd no
#
# 2. nano /etc/profile
# /usr/bin/dynmotd # Place at the bottom
#
@rojenzaman
rojenzaman / termux.sh
Created December 22, 2020 09:55
termux env into adb shell
#!/system/bin/sh
export PREFIX='/data/data/com.termux/files/usr'
export HOME='/data/data/com.termux/files/home'
export LD_LIBRARY_PATH='/data/data/com.termux/files/usr/lib'
export PATH="/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:$PATH"
export LANG='en_US.UTF-8'
export SHELL='/data/data/com.termux/files/usr/bin/bash'
cd "$HOME"
exec "$SHELL" -l
@rojenzaman
rojenzaman / dynmotd.sh
Last active November 24, 2025 16:01
Rocky Linux dynamic motd
#!/bin/bash
# Installation:
#
# 1. nano /etc/ssh/sshd_config
# PrintMotd no
#
# 2. nano /etc/profile
# /usr/bin/dynmotd # Place at the bottom
#
@rojenzaman
rojenzaman / update-cdn.sh
Created September 6, 2020 14:21
firewalld rules for cloudflare cdn IPs (Red Hat, CentOS, Fedora)
#!/bin/bash
curl https://www.cloudflare.com/ips-v4 > .ips-v4
curl https://www.cloudflare.com/ips-v6 > .ips-v6
firewall-cmd --new-zone=cloudflare --permanent
firewall-cmd --reload
for i in `<.ips-v4`; do firewall-cmd --zone=cloudflare --add-source=$i; done
for i in `<.ips-v6`; do firewall-cmd --zone=cloudflare --add-source=$i; done
@rojenzaman
rojenzaman / README.md
Created June 18, 2021 21:38
Spotify Adblock Fedora 34

Spotify Adblock Fedora 34

Install Spotify

First install the spotify package from negativo17's repository.

Enable negativo17 repo:

dnf config-manager --add-repo=https://negativo17.org/repos/fedora-spotify.repo
@rojenzaman
rojenzaman / haproxy.cfg
Created January 17, 2025 10:33
HAProxy Configuration for Amazon WorkMail IMAP and SMTP SSL Passthrough (Alpine Linux)
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local0 # Enable logging to syslog
chroot /var/lib/haproxy # HAProxy chroot directory
pidfile /var/run/haproxy.pid # PID file location
maxconn 4000 # Maximum number of connections
user haproxy # User to run HAProxy as
group haproxy # Group to run HAProxy as
@rojenzaman
rojenzaman / README.md
Last active November 8, 2024 10:54
WordPress Dynamic Data Table Shortcode

WordPress Dynamic Data Table Shortcode

This shortcode generates a paginated, searchable, and sortable data table in WordPress with customizable role-based access control. Ideal for displaying data to specific users with an interactive and secure interface.

Features

  • Search: Supports both global and column-specific searches.
  • Sort: Allows sorting by any column by clicking on headers.
  • Pagination: Includes pagination controls for easy navigation.
  • Access Control: Specify user roles or capabilities with an auth parameter, e.g., [show_data auth="administrator, editor"].