Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / mysql-conf.sh
Last active December 3, 2021 11:37
MySQL Server configuration file for docker.
#!/bin/bash
export MYSQL_CNF=$(cat <<CNF
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
@lesstif
lesstif / svn2git-mig.sh
Created June 22, 2017 06:09
svn2git migration script
#!/bin/sh
## svn project
PRJS="test test2 test"
## svn repository root
SVN_ROOT=https://you-svn.examepl.com/svn/
## git ignore list
IGNORE="vim,java,maven,linux,eclipse,windows,intellij"
@lesstif
lesstif / app.php
Last active December 22, 2018 11:19
Isolate Laravel daily log and artisan log. update bootstrap/app.php
<?php
// blahblah
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
//------------------ START HERE
@lesstif
lesstif / unicode-escaped-decode.php
Last active September 7, 2018 22:51
unicode escaped string(Ex: "\ub85c") decoding example. useful for traditional java message bundle property files.
<?php
/*
spring bean configuration needed p:defaultEncoding="UTF-8"
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
p:cacheSeconds="5"
p:defaultEncoding="UTF-8"
p:basenames="/WEB-INF/message/" />
*/
@jgrossi
jgrossi / AttachJwtToken.php
Last active August 14, 2021 18:14
AttachJwtToken.php
<?php
namespace Tests\Concerns;
use App\Models\User;
use Tymon\JWTAuth\Facades\JWTAuth;
trait AttachJwtToken
{
/**
@dentechy
dentechy / WSL-ssh-server.md
Last active May 9, 2025 02:32
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@lesstif
lesstif / AttackerSuccessProbability.java
Created January 12, 2018 11:29
비트코인 공격자가 유효하지 않은 거래를 블록에 넣을 확율
package bitcoin;
import static java.lang.Math.exp;
import static java.lang.Math.pow;
public class AttackerSuccessProbability {
public static double AttackerSuccessProbability(double q, int z)
{
// p = probability an honest node finds the next block
@lesstif
lesstif / oracle-jdk-alternatives.sh
Last active December 17, 2019 07:35
oracle jdk alternative 및 PATH 설정
#!/bin/sh
JDK_VER=jdk1.8
JDK_PATH=/usr/java/${JDK_VER}
# 새로운 심볼릭 링크를 생성한다. 설치한 JDK 의 버전이 다르면 JDK 디렉터리명을 수정한다.
ln -s /usr/java/jdk1.8.0_161 ${JDK_PATH}
### 기존 심볼릭 링크를 삭제한다.
@lesstif
lesstif / nanum-font-install.sh
Last active December 13, 2020 05:03
JAVA_HOME 의 fonts/fallback 디렉터리에 나눔 폰트 설치. Confluence 의 편집 macro 에서 한글 깨짐 방지
#!/bin/sh
if [ "$#" -lt 1 ]; then
echo -e "$# is Illegal number of parameters.\n"
echo -e "Usage: $0 confluence-installed-dir\n"
echo "Example: $0 /var/atlassian/atlassian-confluence-6.7.0"
exit 1
fi
CONF_DIR=$1
@Krato
Krato / Laravel Nova snippets.md
Last active November 25, 2020 23:02
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