Skip to content

Instantly share code, notes, and snippets.

Avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / passwords.txt
Created Nov 22, 2021 — forked from w0rd-driven/passwords.txt
BFG Repo-Cleaner --replace-text example
View passwords.txt
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@lesstif
lesstif / lets_encrypt-HPKP.md
Last active Oct 8, 2021
Let's encrypt + nginx 에서 HPKP(Http Public Key Pinning) 활성화하기
View lets_encrypt-HPKP.md

SSL 인증서내 SPKI(Subject 구하기)

lesstif.com 은 SPKI 를 추출할 사이트 주소로 변경

openssl s_client -servername lesstif.com -connect lesstif.com:443 | \
openssl x509 -pubkey -noout | \
openssl rsa -pubin -outform der | \
openssl dgst -sha256 -binary | \
@lesstif
lesstif / my.cnf
Last active Jul 22, 2021 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MariaDB (on Ubuntu, CentOS etc. servers)
View my.cnf
# === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated February 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@lesstif
lesstif / change-rocklinux-mirror.sh
Last active Mar 30, 2022
록키 리눅스(Rocky Linux) 미러(mirror)를 국내 포탈(navercloud)로 변경
View change-rocklinux-mirror.sh
#!/usr/bin/env bash
##
REPOS_FILES="AppStream BaseOS"
PARAM="hn"
#KAKAO="mirror.kakao.com\/centos"
NAVER="mirror.navercorp.com\/rocky"
@lesstif
lesstif / change-centos-mirror.sh
Last active Sep 11, 2021
change centos mirror to korea's portal.(CentOS 를 카카오와 네이버로 변경)
View change-centos-mirror.sh
#!/usr/bin/env bash
BASE_REPOS=/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
PARAM="r:hkn"
KAKAO="mirror.kakao.com\/centos"
NAVER="mirror.navercorp.com\/centos"
if [ "$(id -u)" != "0" ]; then
echo "'$0' must be run as root" 1>&2
View phpseclib_mcrypt_test.php
<?php
$string = 'hello';
$en_str = phpseclib_mcrypt_encrypt(MCRYPT_3DES, $secretKey, $string, MCRYPT_MODE_ECB);
dump(bin2hex($en_str));
$de_str = phpseclib_mcrypt_decrypt(MCRYPT_3DES, $secretKey, $en_str, MCRYPT_MODE_ECB);
@lesstif
lesstif / install-php-from-remi.sh
Last active Mar 8, 2021
install php package from remi repository
View install-php-from-remi.sh
#!/bin/bash
VERS="70 71 72 73 74 80"
PKGS="php72 php72-php-bcmath php72-php-cli php72-php-common php72-php-gd \
php72-php-gmp php72-php-intl php72-php-json php72-php-mbstring \
php72-php-mysqlnd php72-php-pdo php72-php-sodium \
php72-php-xml php72-runtime php72-php-fpm php72-php-process \
php72-php-pecl-igbinary php72-php-pecl-redis5 php72-php-pecl-zip "
@lesstif
lesstif / winget-package-install.ps1
Last active Apr 6, 2021
windows package install using winget package manager
View winget-package-install.ps1
## copy from https://gist.github.com/cdekkerpossibilit/d023602c29fdf039c7eabadf64f708e9
function Confirm-Choice {
param (
[string]$Message
)
$yes = new-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Yes";
$no = new-Object System.Management.Automation.Host.ChoiceDescription "&No","No";
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no);
$answer = $host.ui.PromptForChoice("", $message, $choices, 1)
@lesstif
lesstif / nginx-vhost-docker-gitlab.conf
Created Jan 18, 2021
nginx 가상 호스트 설정
View nginx-vhost-docker-gitlab.conf
server {
listen 80;
server_name gitlab.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name gitlab.example.com;
@lesstif
lesstif / nginx-ssl-tls-secure.conf
Created Nov 3, 2020
SSL/TLS secure configuration for nginx web server.
View nginx-ssl-tls-secure.conf
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7