Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / nginx-ssl-tls-secure.conf
Created November 3, 2020 23:47
SSL/TLS secure configuration for nginx web server.
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
@lesstif
lesstif / yum-list-installed.sh
Created October 22, 2020 04:46
RHEL 계열 배포판에서 yum/dnf 로 설치한 패키지 목록을 "dnf insatll " 구문을 붙여서 재출력(다른 서버에서 재활용하려고)
#!/bin/sh
PACKAG="php"
dnf list installed | grep ${PACKAG} | awk 'BEGIN {printf "dnf install -y " } {printf $1 " "}'
@lesstif
lesstif / win95vercheck.c
Created October 7, 2020 09:44
windows 95가 버전 3.95인 이유 - 윈도우 개발 282 스토리에서 발췌
UINT Ver = GetVersion();
UINT MajorVersion = LOBYTE(uVer);
UINT MinorVersion = HIBYTE(uVer);
if (MajorVersion < 3 || MinorVersion < 10) {
Error("This program requires Windows 3.1");
}
@lesstif
lesstif / run-every-x-seconds.sh
Last active October 5, 2020 11:10
run some task every x second through cron
#!/usr/bin/env bash
SLEEP_SECOND=7
iter=0;
PARAM="s:h"
MUTEX=${HOME}/.run-x-seconds
LOGFILE=${HOME}/run-logfile
@lesstif
lesstif / manjaro-aur-package.sh
Last active September 30, 2020 13:46
만자로 리눅스(manjaro linux) AUR 패키지
#!/bin/bash
## install devel package
sudo pacman -Sy base-devel git
## install AUR-helper
sudo pacman -Sy yay
## install chrome
yay -Sy google-chrome
@lesstif
lesstif / sed-example.txt
Created September 16, 2020 07:59
example text file for sed
unix is great os. unix is opensource. unix is free os.
learn operating system.
unix linux which one you choose.
unix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.
@lesstif
lesstif / argon2_example.php
Last active September 15, 2020 00:57
argon2 php example code
<?php
$password = 'secret';
$options = [
'memory_cost' => 1<<17, // 128 Mb
'time_cost' => 4, // time_cost
'threads' => 2, // parallel thread
];
@lesstif
lesstif / argon2_example.py
Last active September 14, 2020 10:00
argon2 password hasing algorithm
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
memory_cost = 1 << 17
time_cost = 4
parallelism = 2
ph = PasswordHasher(time_cost, memory_cost, parallelism)
## 암호
@lesstif
lesstif / phpstan.neon.dist
Last active October 4, 2023 12:58
phpstan.neon.dist for laravel
includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters:
paths:
- app
# The level 8 is the highest level
level: 5
@lesstif
lesstif / Temperature.php
Created August 10, 2020 04:47
PHP mockery logic class.
<?php
namespace App;
class Temperature
{
private $service;
public function __construct($service)
{