Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / laravel-deploy-on-linux-ami2.sh
Last active June 15, 2021 09:15
laravel & php 7.3 & mysql install on amazon linux ami2
#!/bin/bash
sudo yum update
## mkswap
## see https://aws.amazon.com/ko/premiumsupport/knowledge-center/ec2-memory-swap-file/
sudo dd if=/dev/zero of=/swapfile bs=1G count=4
## install python3, php, nginx, redis
sudo amazon-linux-extras install python3 php7.3 nginx1 redis4.0 epel
@lesstif
lesstif / nginx.service
Created April 28, 2019 11:47
nginx service systemd 등록 파일
### save as /lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
@lesstif
lesstif / confluence-login-attacker-block.sh
Last active April 24, 2019 17:14
confluence login attacker block
#!/bin/bash
## login.action 을 호출한 IP 중에 차단 제외 ip
MYIP=180.68.199.167
## apache httpd 일 경우 변경 필요
BLACKLIST=$(grep -h login.action /var/log/nginx/*.access.log |awk '{print $1}'|grep -v ${MYIP} |sort |uniq)
## firewall zone
ZONE=dmz
@lesstif
lesstif / ssh_config
Last active April 3, 2019 01:48
~/.ssh/config
Host gitlab
HostName gitlab.com
User git
PubkeyAcceptedKeyTypes +ssh-rsa
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab-key/id_rsa
Host github
HostName github.com
User git
@lesstif
lesstif / Laravel Nova snippets.md
Created April 2, 2019 01:12 — forked from Krato/Laravel Nova snippets.md
A set of snippets I use in Laravel Nova

A set of snippets I use in Laravel Nova

Snippets

Vue,js devtools (Only with manual installation)

cd ./nova 
yarn
mv webpack.mix.js.dist webpack.mix.js
@lesstif
lesstif / ALPHASSL CA SHA256 G2.crt
Last active October 30, 2019 02:35
SSL/TLS 인증서 체인 검증을 위한 CA/ROOT CA 인증서 모음(SSL/TLS Intermediate Certificate archive for chain validation)
## Root 인증서는 하단의 GlobalSign Root CA - R1
## Version: 3 (0x2)
## Serial Number:
## 04:00:00:00:00:01:44:4e:f0:36:31
## Signature Algorithm: sha256WithRSAEncryption
## Issuer: C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA Validity
## Not Before: Feb 20 10:00:00 2014 GMT
## Not After : Feb 20 10:00:00 2024 GMT
## Subject: C = BE, O = GlobalSign nv-sa, CN = AlphaSSL CA - SHA256 - G2
@lesstif
lesstif / yum-mirror-change.php
Last active March 21, 2019 06:35
change to yum mirror repository to korea ISP.
<?php
// mirror list
$mirror_list = [
'cdnetworks' => 'http://centos.mirror.cdnetworks.com/$releasever/os/$basearch/',
'naver' => 'http://mirror.navercorp.com/centos/$releasever/os/$basearch/',
'kakao' => 'http://mirror.kakao.com/centos/$releasever/os/$basearch/',
];
// root 가 아니면 현재 폴더에 생성
@lesstif
lesstif / nginx-with-tls13-compile.sh
Last active July 12, 2024 00:36
openssl 1.1 & nginx compile script for TLS 1.3 support on RHEL/CentOS 7
#!/bin/bash
## nginx
NGINX=nginx-1.19.4.tar.gz
if [ ! -f "${NGINX}" ];then
wget https://nginx.org/download/${NGINX}
fi
ND=$(basename $NGINX .tar.gz)
@lesstif
lesstif / curl-http-status.sh
Created February 20, 2019 15:39
cur l로 HTTP 서버 상태 체크
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "$# is Illegal number of parameters."
echo "Usage: $0 http://example.org"
exit 1
fi
SERVER=$1
@lesstif
lesstif / firewallcmd-drop-client.sh
Last active September 2, 2020 23:21
fail2ban 으로 jail 된 IP 를 firewall 에서 차단하기 위한 script
#!/bin/bash
function usage {
echo "USAGE: $0 -z ZONE -i BLOCK-IP1,BLOCK-IP2"
echo ""
echo "$0 -z dmz -i block-ip1,block-ip2"
echo "$0 -z dmz -f block-ip-file"
exit 1
}