Skip to content

Instantly share code, notes, and snippets.

View dev-gwang's full-sized avatar
🏠
Working from home

dev-gwang dev-gwang

🏠
Working from home
View GitHub Profile
#!/usr/bin/env groovy
import groovy.sql.Sql
import com.mysql.jdbc.*
/**
* A small example script on how to connect to a mysql database in a groovy script.
*
* @author: Marcel Maatkamp (m.maatkamp avec gmail dot com)
*/
@dev-gwang
dev-gwang / get_memory_percentage.sh
Last active October 5, 2019 08:19
centos6, centos5 free -m memory percentage check
DATE=`date`;
MEM_TOTAL_REAL=`free -m | head -n 2 | tail -n 1 | awk {'print $2'}`
MEM_USED=`free -m | head -n 2 | tail -n 1 | awk {'print $3'}`
MEM_BUFFER=`free -m | head -n 2 | tail -n 1 | awk {'print $6'}`
MEM_CACHED=`free -m | head -n 2 | tail -n 1 | awk {'print $7'}`
TEST=$(($MEM_USED-$MEM_BUFFER-$MEM_CACHED));
RESULT=$(($TEST*100))
RESULT=$(($RESULT/$MEM_TOTAL_REAL))

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

1. 마크다운에 관하여

1.1. 마크다운이란?

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

1.2. 마크다운의 장-단점

1.2.1. 장점

@dev-gwang
dev-gwang / kitchen.yml
Last active October 5, 2019 08:18
CHEF kitchen test 사용 방법 정리
driver:
name: vagrant
driver_config:
box: centos/7
# box_url: http://
auto_update: false
Description: >
1. box_url
Box URL 설정이 필요할 경우 URL을 작성한다. (개인 사설 서버를 사용할 경우 유용함)
@dev-gwang
dev-gwang / .synergy.conf
Created October 29, 2019 02:41 — forked from afrontend/.synergy.conf
Synergy 컴파일 하기 위한 스크립트 (v1.8.8) 그리고 synergy 설정 파일, https://agvim.wordpress.com/2018/02/24/synergy/
# sample synergy configuration file
#
# comments begin with the # character and continue to the end of
# line. comments may appear anywhere the syntax permits.
section: screens
# three hosts named: moe, larry, and curly
moe:
larry:
curly:
@dev-gwang
dev-gwang / Bamboo Install Vagrantfile
Created April 28, 2020 13:02
Bamboo Install Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.56.101"
config.vm.provider "virtualbox" do |vb|
vb.memory = 1024
vb.cpus = 1
DEBUG provider: Searching for cap: snapshot_list
DEBUG provider: Checking in: virtualbox
DEBUG provider: Found cap: snapshot_list in virtualbox
DEBUG provider: Searching for cap: snapshot_list
DEBUG provider: Checking in: virtualbox
DEBUG provider: Found cap: snapshot_list in virtualbox
INFO provider: Execute capability: snapshot_list [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>] (virtualbox)
INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "snapshot", "705bd14e-d49f-4c29-bc26-271aa0caea43", "list", "--machinereadable"]
DEBUG subprocess: Command not in installer, not touching env vars.
INFO subprocess: Command not in installer, restoring original environment...
@dev-gwang
dev-gwang / bamboo_play_result_parsing.py
Last active May 25, 2020 08:24
bamboo plan result xml parsing / Bamboo plan 결과 파싱 스크립트
import requests
import xml.etree.ElementTree as elemTree
import sys
from requests.auth import HTTPBasicAuth
import json
import sys
list_issues = []
IP = "<BAMBOO SERVER IP>"
ISSUE_KEY = "<JIRA ISSUE_KEY>"
@dev-gwang
dev-gwang / Vagrantfile
Created May 27, 2020 04:10
chef server install Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", ip: "192.168.33.10"
@dev-gwang
dev-gwang / Vagrantfile
Created July 29, 2020 09:09
Vagrantfile yum install nginx
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at