This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################################################### | |
# Upgrade CentOS GCC 4.4 to 4.7 | |
# | |
# CentOS6의 기본 gcc 버전은 4.4, | |
# nodejs의 node-gyp 빌드를 하다보면 C++11 컴파일이 필요한데 gcc 4.7부터 11을 지원 | |
# 이런 경우 직접 업그레이드 해줘야한다. | |
# | |
#################################################################################### | |
# INSTALL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 로그인이 아닌 Non-interactive shell에서는 프로파일을 로드하지 않는 default 설정이 들어간 경우가 있다. | |
# | |
# 예. Ubuntu default .bashrc의 시작 부분 | |
# | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Sync destination dir to source dir | |
REM retry max 10 times wait 1 second every try | |
REM output created, updated, deleted file list to both stdout and rc-list.txt file | |
robocopy %src_path% %dest_path% /MIR /R:10 /W:1 /NJH /NJS /NC /NS /NDL /NP /TEE /LOG:rc-list.txt /XF *.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################ | |
# http get request | |
################################################################################################ | |
$uri = "http://mydomain/~" | |
$webclient = [System.Net.HttpWebRequest]::Create($uri) | |
[System.Net.HttpWebResponse]$res = $webclient.GetResponse() | |
$reader = New-Object System.IO.StreamReader($res.GetResponseStream()) | |
$result = $reader.ReadToEnd() | |
################################################################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:loop | |
(echo|set /p="%date% %time% " & netstat -anon | find /c ":8002 ") >> 8002_netstat.log | |
ping localhost -n 11 > nul | |
goto loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"__inputs": [ | |
{ | |
"name": "DS_TELEGRAF", | |
"label": "telegraf", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "influxdb", | |
"pluginName": "InfluxDB" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Ubuntu | |
# apt.conf에 프록시 서버 설정 추가 | |
##################################### | |
PROXY_SERVER=$1 | |
if [ -z "$1" ]; then | |
echo "Usage: add_apt_proxy.sh [proxy_server]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Ubuntu | |
# 기본 bash 파일이 없는 경우 (.bashrc, .profile) | |
# skeleton 파일을 복사하여 추가 | |
################################## | |
if [ ! -f "~/.bashrc" ]; then | |
cp /etc/skel/* ~/ | |
source ~/.profile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# $1: key를 저장할 원격 호스트 사용자 아이디 | |
# $2: 원격 호스트 사용자의 패스워드가 기록된 파일 경로 | |
# $3: linebreak으로 구분된 원격 호스트 목록 | |
# e.g. target_hosts | |
# myhost01 | |
# myhost02 | |
# myhost03 | |
# ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Ubuntu | |
# 사용자 추가 스크립트 | |
################################# | |
if [[ -z "$1" || -z "$2" ]]; then | |
echo "Usage: add_user [user_name] [home_dir]" | |
exit 0 | |
elif [ -d "$2" ]; then |