Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / pngquant-compile.sh
Created August 29, 2019 07:38
compile script for pngquant on RHEL/CentOS and Amazon Linux
#!/bin/bash
git clone https://github.com/kornelski/pngquant
cd pngquant
git checkout -b 2.12.3
sudo yum install libpng-devel -y
make
sudo make install
@lesstif
lesstif / systemd-service-contrl.sh
Last active January 3, 2020 02:10
add or remove daemon server on systemd
#!/bin/bash
function usage {
echo "USAGE: $0 param..";
echo -e "\t-s SERVICE: service full path";
echo -e "\t-d DESCRIPTION: service desc";
echo -e "\t-r RUNAS : specify the Unix user/group of processes";
echo -e "\t-p PARAM: param to pass service running";
echo -e "\t-t TARGET: param to pass target(default multi-user)";
@lesstif
lesstif / minio-nginx-vhost.conf
Created August 16, 2019 02:23
setup nginx proxy with minio server
##
server {
listen 80;
server_name minio.example.com;
# To allow special characters in headers
ignore_invalid_headers off;
# Allow any size file to be uploaded.
# Set to a value such as 1000m; to restrict file size to a specific value
client_max_body_size 0;
# To disable buffering
@lesstif
lesstif / MinIOStorageServiceProvider.php
Created August 13, 2019 05:26
MinIO Storage ServiceProvider for PHP Laravel
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;
use Storage;
@lesstif
lesstif / generate-nginx-blacklist-from-error-logfile.sh
Last active August 6, 2019 08:22
to extract malicious web request client ip and add into nginx blacl list file.7
#!/bin/bash
TMP1=/tmp/tmp-black-list
NGINX_LOG=/var/log/nginx/error.log
grep '.php\|.cfg' ${NGINX_LOG} | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | sort | uniq | awk '{print "deny "$0";"}' > ${TMP1}
## copy original block ips file
D=$(date '+%Y-%m-%d')
@lesstif
lesstif / nginx-logrotate
Last active August 6, 2019 07:36
log roate script for nginx(/etc/logrotate.d/nginx)
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
@lesstif
lesstif / laravel-nova-snippets.md
Last active July 10, 2019 07:21
laravel nova snippets

Nova Resource

아래 명령어로 생성하는 nova resource 관련 snippets.

php artisan nova:resource MyResource

Pagination

@lesstif
lesstif / .gitignore
Last active December 24, 2019 09:29
global gitignore for laravel,phpstorm(Intellij), vim, OSX, Linux
##
## git config --global core.excludesfile ~/.gitignore
## laravel default gitignore
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/nova
@lesstif
lesstif / wsl2-troubleshooting-list.md
Last active June 19, 2019 04:59
WSL 2 troubleshooting

"A device attached to the system is not functioning."

"시스템에 부착된 장치가 작동하지 않습니다." 란 메시지가 나오고 WSL 이 동작 안 함.

  1. windows 서비스에 "Host Network Service"(호스트 네트워크 서비스)가 구동되었는지 확인
  2. "Technitium DNS server" 나 "Acrylic DNS Proxy" 같은 DNS 서버가 떠 있는지 확인(laravel valet 때문에 "Acrylic DNS Proxy" 를 설치했더니 저 에러 발생함
@lesstif
lesstif / aws-ami2-ec2-redis-cli.md
Created June 12, 2019 10:33
install redis-cli on AWS AMI2 without redis server
#!/bin/bash
sudo yum install gcc -y
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make MALLOC=libc