A set of snippets I use in Laravel Nova
cd ./nova
yarn
mv webpack.mix.js.dist webpack.mix.js
#!/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 |
### 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 |
#!/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 |
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 |
## 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 |
<?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 가 아니면 현재 폴더에 생성 |
#!/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) |
#!/bin/bash | |
if [ "$#" -lt 1 ]; then | |
echo "$# is Illegal number of parameters." | |
echo "Usage: $0 http://example.org" | |
exit 1 | |
fi | |
SERVER=$1 |
#!/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 | |
} |