Skip to content

Instantly share code, notes, and snippets.

View goddoe's full-sized avatar

Sungju Kim goddoe

View GitHub Profile
@goddoe
goddoe / make_tunnel.sh
Created June 5, 2018 06:24
Make ssh tunnel between client and server.
alias sshtunncml="sshpass -p{PASSWD} ssh -o StrictHostKeyChecking=no -p {SSH_PORT} -N -f -L localhost:{PORT}:localhost:{PORT} {ID}@{HOST}"
# Run on XQuartz.
alias sshxncml="sshpass -p{PASSWD} ssh -o StrictHostKeyChecking=no -p {SSH_PORT} -X {ID}@{HOST}"
@goddoe
goddoe / Shortcuts to move faster in Bash command line.txt
Created June 5, 2018 13:28
Shortcuts to move faster in Bash command line
# Reference: http://teohm.com/blog/shortcuts-to-move-faster-in-bash-command-line/
Basic moves
Move back one character. Ctrl + b
Move forward one character. Ctrl + f
Delete current character. Ctrl + d
Delete previous character. Backspace
Undo. Ctrl + -
Moving faster
Move to the start of line. Ctrl + a
@goddoe
goddoe / fixing_matplotlib_korean_issue.py
Created June 8, 2018 09:34
Fixing plot display issue which Korean doesn't display on plot in Matplotlib.
import matplotlib
import matplotlib.font_manager
print([f.name for f in matplotlib.font_manager.fontManager.ttflist if 'Nanum' in f.name])
# Select one of Korean fonts
# And set like this.
plt.rcParams['font.family'] = 'NanumBarunGothic'
@goddoe
goddoe / dirname_of_parent_of_parent.sh
Created June 14, 2018 02:45
How to get the directory name of parent of parent.
echo "$(dirname "$(dirname $PWD)")"
@goddoe
goddoe / Vim_split_commands.txt
Created June 15, 2018 02:19
Vim split commands.
(Reference: https://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally)
The basics
Create a vertical split using :vsp and horizontal with :sp.
By default, they duplicate the current buffer. This command also takes a filename:
:vsp ~/.vimrc
You can specify the new split height by prefixing with a number:
@goddoe
goddoe / tree_command_exclude_include.txt
Created June 22, 2018 02:31
Excluding or including specific file with tree command.
One way is to use patterns with the -I and -P switches:
tree -f -I "bin|unitTest" -P "*.[ch]|*.[ch]pp." your_dir/
The -f prints the full path for each file, and -I excludes the files in the pattern here separated by a vertical bar. The -P switch inlcudes only the files listed in the pattern matching a certain extension.
@goddoe
goddoe / email_cmd.md
Last active June 27, 2018 05:38
Methods of sending email from ubuntu
@goddoe
goddoe / search_from_files.sh
Last active July 4, 2018 08:20
search_from_files
# -H: Always print filename headers with output lines.
# -I: Ignore binary file.
# -r: Recursively search subdirectories listed.
grep -H -I -r 'what_you_search' * | less

[공통] 마크다운 markdown 작성법

1. 마크다운에 관하여

1.1. 마크다운이란?

Markdown은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다.

1.2. 마크다운의 장-단점

1.2.1. 장점

@goddoe
goddoe / check_os_version.md
Last active July 25, 2018 08:39
check os version

How to check OS version

CentOS

$ cat /etc/redhat-release  # CentOS Linux release 7.4.1708 (Core)
$ cat /etc/centos-release  # CentOS Linux release 7.4.1708 (Core)
$ cat /etc/os-release

NAME="CentOS Linux"
VERSION="7 (Core)"