Skip to content

Instantly share code, notes, and snippets.

View geunho's full-sized avatar
🎯
Focusing

Geunho Kim geunho

🎯
Focusing
View GitHub Profile
@geunho
geunho / Install_Scripts.md
Created February 11, 2016 23:33
Install Scripts

Linux Install snippets

  • ambari-install.sh
  • oracle-java-8-install.sh
  • sbt-install.sh
@geunho
geunho / Dockerfile.sh
Last active July 14, 2016 01:14
docker timezone setup
FROM registry.ebaykorea.com/ubuntu:trusty-buildpack
...
# ref: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
@geunho
geunho / JsonInterceptor$Builder.java
Last active July 20, 2016 01:53
apache-flume-implement-custom-interceptor
e.g. agent.sources.s1.interceptors.ci.isISO8601Format = true
...
public void configure(Context context) {
boolean isISO8601Format = context.getBoolean("isISO8601Format", true);
}
@geunho
geunho / add_user.sh
Last active August 24, 2016 00:19
Ubuntu 사용자 추가 스크립트
#!/bin/bash
#
# Ubuntu
# 사용자 추가 스크립트
#################################
if [[ -z "$1" || -z "$2" ]]; then
echo "Usage: add_user [user_name] [home_dir]"
exit 0
elif [ -d "$2" ]; then
@geunho
geunho / copy-ssh-keys.sh
Created August 24, 2016 00:23
원격 호스트에 ssh key를 한번에 복제
#!/bin/bash
#
# $1: key를 저장할 원격 호스트 사용자 아이디
# $2: 원격 호스트 사용자의 패스워드가 기록된 파일 경로
# $3: linebreak으로 구분된 원격 호스트 목록
# e.g. target_hosts
# myhost01
# myhost02
# myhost03
# ...
@geunho
geunho / add_bashrc.sh
Created August 24, 2016 00:43
Ubuntu bash skeleton 파일 추가
#!/bin/bash
#
# Ubuntu
# 기본 bash 파일이 없는 경우 (.bashrc, .profile)
# skeleton 파일을 복사하여 추가
##################################
if [ ! -f "~/.bashrc" ]; then
cp /etc/skel/* ~/
source ~/.profile
@geunho
geunho / add_apt_proxy.sh
Last active March 17, 2020 10:47
apt.conf 생성 및 프록시 서버 추가
#!/bin/bash
#
# Ubuntu
# apt.conf에 프록시 서버 설정 추가
#####################################
PROXY_SERVER=$1
if [ -z "$1" ]; then
echo "Usage: add_apt_proxy.sh [proxy_server]"
{
"__inputs": [
{
"name": "DS_TELEGRAF",
"label": "telegraf",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
},
@geunho
geunho / netstat_8002_count_each_10s.bat
Created January 10, 2019 02:02
cmd batch to keep track of specific tcp connection count from netstat
:loop
(echo|set /p="%date% %time% " & netstat -anon | find /c ":8002 ") >> 8002_netstat.log
ping localhost -n 11 > nul
goto loop
@geunho
geunho / web_req.ps1
Created January 14, 2019 06:35
powershell 2 web get request
################################################################################################
# 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()
################################################################################################