Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / createdb-util.sh
Last active September 16, 2022 13:42
create postgresql database
#!/usr/bin/env bash
# list of users create DB
users="jira confluence bitbucket bamboo jsm"
for u in ${users}; do
createuser ${u} --createdb --no-superuser --no-createrole;
createdb ${u}db -O ${u} --encoding='UTF-8' --locale=en_US.UTF-8 --template=template0;
done;
@lesstif
lesstif / passwords.txt
Created November 22, 2021 01:38 — forked from w0rd-driven/passwords.txt
BFG Repo-Cleaner --replace-text example
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 October 8, 2021 11:03
Let's encrypt + nginx 에서 HPKP(Http Public Key Pinning) 활성화하기

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 July 22, 2021 01:32 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MariaDB (on Ubuntu, CentOS etc. servers)
# === 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 June 6, 2023 14:37
록키 리눅스(Rocky Linux) 미러(mirror)를 국내 포탈(navercloud)로 변경
#!/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 December 7, 2023 15:25
change centos mirror to korea's portal.(CentOS 를 카카오와 네이버로 변경)
#!/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
<?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 March 8, 2021 07:38
install php package from remi repository
#!/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 November 3, 2023 02:32
windows package install using winget package manager
## 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 January 18, 2021 10:51
nginx 가상 호스트 설정
server {
listen 80;
server_name gitlab.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name gitlab.example.com;