Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
free 4 ever

Aysad Kozanoglu AysadKozanoglu

💭
free 4 ever
View GitHub Profile
@AysadKozanoglu
AysadKozanoglu / mailserver_openRelay_check_telnet.sh
Last active Oct 27, 2020
mailserver openrelay check manuelly over telnet
View mailserver_openRelay_check_telnet.sh
```
telnet mail.MailserverDomain.com 25
#Trying 76.33.23.xxx...
#Connected to mail.MailserverDomain.com.
#Escape character is '^]'.
#220 mail.MailserverDomain.com ESMTP Postfix
helo GIVEANYEXISTINGDOMAIN.COM
@AysadKozanoglu
AysadKozanoglu / redis_server_sample.conf
Created Sep 19, 2020
sample redis server bind to localhost protected mode enabled
View redis_server_sample.conf
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
View nginx weak ciphers issue fix.conf
# compile nginx with openssl1.1.1
# params: --with-openssl=/source/openssl-1.1.1g --with-stream --with-threads --with-file-aio --with-http_stub_status_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt=-Wl,-z,relro --sbin-path=/usr/local/sbin --with-http_stub_status_module --with-http_ssl_module --user=www-data --group=www-data
# generate diffie hellman
openssl dhparam -out /etc/cert/dhparams.pem 4096
# add following params in vhost config
ssl_protocols TLSv1.2;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA HIGH !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
View nginx_proxy_pass_to_HTTPS
location / {
proxy_pass https://example.de;
proxy_http_version 1.1;
proxy_set_header Accept-Encoding "";
proxy_set_header Cache-Control no-cache;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Real-IP $remote_addr;
proxy_ssl_server_name on;
}
@AysadKozanoglu
AysadKozanoglu / .ssh-agent_bashrc
Created Feb 24, 2020
Sharing the same `ssh-agent` among multiple login sessions
View .ssh-agent_bashrc
# put the following code to your .bashrc
# Sharing the same `ssh-agent` among multiple login sessions
SSH_ENV=$HOME/.ssh/environment
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo succeeded
chmod 600 ${SSH_ENV}
View bashrc_template.sh
#
# aurhor: Aysad Kozanoglu
# email: aysadx@gmail.com
#
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
View apt-mirror-install.sh
#!/bin/sh
# Author: Aysad Kozanoglu
# Dists: debian 9, 10 (stretch buster)
# ubuntu 18 and above
which apt-get && apt-get install -y --yes apt-mirror || apt install apt-mirror -y --yes
apt-mirror
@AysadKozanoglu
AysadKozanoglu / rc-local.service
Last active Dec 5, 2019
execute rc.local on boot startup on systemd OS types
View rc-local.service
#
# file: rc-local.service
# author: Aysad Kozanoglu
# OS types: systemd
#
# Description
# ============
# execute rc.local on boot startup
# systemd-rc-local-generator if /etc/rc.local is executable.
#
@AysadKozanoglu
AysadKozanoglu / kvm-libvirt-restart-network.sh
Created Dec 4, 2019
Effectively restarting kvm/libvirt network
View kvm-libvirt-restart-network.sh
#!/bin/bash
# Author: Aysad Kozanoglu
# Effectively restarting kvm/libvirt network
set -e
set -u
NET_NAME=default
# NET_HOOK=/etc/libvirt/hooks/qemu
You can’t perform that action at this time.