Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / serve-tomcat.sh
Last active November 30, 2018 02:46
nginx virtualhost serve script for tomcat
#!/usr/bin/env bash
## Installation
# curl -o serve-tomcat.sh https://gist.githubusercontent.com/lesstif/4d162c4c8df756a65286/raw
# sudo mv serve-tomcat.sh /usr/local/bin/
# sudo chmod +x /usr/local/bin/serve-tomcat.sh
if [ "$#" -lt 2 ]; then
echo "Error: missing required minimal 2 parameters.";
echo "Usage: ";
@lesstif
lesstif / sentry-control.sh
Last active November 19, 2016 11:26
On-Premise Edition of Sentry server(https://getsentry.com) control(start, stop, status) script on RHEL/CentOS platform.
#!/bin/sh
# Source function library.
. /etc/rc.d/init.d/functions
MASTER_PID=""
CELERY_PID=""
BEAT_PID=""
if [ ! -d log ];then
@lesstif
lesstif / InstallCert.java
Last active November 30, 2021 06:24
extract peer's SSL certificate and import to java's keystore file using keytools
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active August 3, 2025 17:45
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

--exclude='$RECYCLE.BIN' --exclude='$Recycle.Bin' --exclude='.AppleDB' --exclude='.AppleDesktop' --exclude='.AppleDouble' --exclude='.com.apple.timemachine.supported' --exclude='.dbfseventsd' --exclude='.DocumentRevisions-V100*' --exclude='.DS_Store' --exclude='.fseventsd' --exclude='.PKInstallSandboxManager' --exclude='.Spotlight*' --exclude='.SymAV*' --exclude='.symSchedScanLockxz' --exclude='.TemporaryItems' --exclude='.Trash*' --exclude='.vol' --exclude='.VolumeIcon.icns' --exclude='Desktop DB' --exclude='Desktop DF' --exclude='hiberfil.sys' --exclude='lost+found' --exclude='Network Trash Folder' --exclude='pagefile.sys' --exclude='Recycled' --exclude='RECYCLER' --exclude='System Volume Information' --exclude='Temporary Items' --exclude='Thumbs.db'
@Pusnow
Pusnow / 한글과유니코드.md
Last active July 15, 2025 01:14
한글과 유니코드

한글과 유니코드

유니코드에서 한글을 어떻게 다루는지를 정리하였다.

유니코드

  • 유니코드(Unicode)는 전 세계의 모든 문자를 컴퓨터에서 일관되게 표현하고 다룰 수 있도록 설계된 산업 표준 (위키 백과)
  • 단순히 문자마다 번호를 붙임
  • 계속 업데이트되며 현재는 Unicode Version 9.0.0 이 최신이다.

UTF

  • 유니코드를 실제 파일 등에 어떻게 기록할 것인지를 표준화한 것이다.
@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@lesstif
lesstif / compile-build-php7.sh
Last active October 15, 2020 01:55
compile build script for standalone php 7 on RHEL CentOS Ubuntu
#!/bin/sh
PHP_VER=7.3.21
#PHP_VER=7.1.20
FMT=.tar.xz
MAJOR=`echo ${PHP_VER}|awk -F. '{print $1}'`
MINOR=`echo ${PHP_VER}|awk -F. '{print $2}'`
### download latest
@lesstif
lesstif / change-ubuntu-mirror.sh
Last active August 21, 2024 13:20
우분투(ubuntu)의 apt 기본 미러(mirror)를 다음 카카오(kakao), 카이스트(kaist), 부경대(harukasan) 으로 변경
#!/usr/bin/env bash
SL=/etc/apt/sources.list
PARAM="r:hm:dnak"
KAKAO=mirror.kakao.com
KAIST=ftp.kaist.ac.kr
HARU=ftp.harukasan.org
@lesstif
lesstif / auto_start_docker_container.sh
Last active March 20, 2022 00:22
docker container auto start template generator for systemd.
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root." 1>&2
exit 1
fi
##@see https://docs.docker.com/engine/admin/host_integration/
SYSTEMD_DIR=/etc/systemd/system/