Skip to content

Instantly share code, notes, and snippets.

KwangSeob Jeong lesstif

Block or report user

Report or block lesstif

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lesstif
lesstif / pngquant-compile.sh
Created Aug 29, 2019
compile script for pngquant on RHEL/CentOS and Amazon Linux
View pngquant-compile.sh
#!/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 Aug 22, 2019
add or remove daemon server on systemd
View systemd-service-contrl.sh
#!/bin/bash
function usage {
echo "$# is Illegal number of parameters." 1>&2
echo "USAGE: $0 param..";
echo -e "\t-s SERVICE: service full path";
echo -e "\t-d DESCRIPTION: service desc";
echo -e "\t-p PARAM: param to pass service runnin";
echo ""
@lesstif
lesstif / minio-nginx-vhost.conf
Created Aug 16, 2019
setup nginx proxy with minio server
View minio-nginx-vhost.conf
##
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 Aug 13, 2019
MinIO Storage ServiceProvider for PHP Laravel
View MinIOStorageServiceProvider.php
<?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 Aug 6, 2019
to extract malicious web request client ip and add into nginx blacl list file.7
View generate-nginx-blacklist-from-error-logfile.sh
#!/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 Aug 6, 2019
log roate script for nginx(/etc/logrotate.d/nginx)
View nginx-logrotate
/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 Jul 10, 2019
laravel nova snippets
View laravel-nova-snippets.md

Nova Resource

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

php artisan nova:resource MyResource

Pagination

@lesstif
lesstif / .gitignore
Last active Jul 3, 2019
gitignore for laravel,phpstorm(Intellij), vim, OSX, Linux
View .gitignore
## laravel default gitignore
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/nova
.env
.phpunit.result.cache
Homestead.json
@lesstif
lesstif / wsl2-troubleshooting-list.md
Last active Jun 19, 2019
WSL 2 troubleshooting
View wsl2-troubleshooting-list.md

"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 Jun 12, 2019
install redis-cli on AWS AMI2 without redis server
View aws-ami2-ec2-redis-cli.md
#!/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
You can’t perform that action at this time.