Skip to content

Instantly share code, notes, and snippets.

View giseongeom's full-sized avatar
๐Ÿ’ญ
I may be slow to respond.

GiSeong Eom giseongeom

๐Ÿ’ญ
I may be slow to respond.
View GitHub Profile
@giseongeom
giseongeom / _bash_awsrc.sh
Last active April 7, 2016 08:28
aws-select - AWS region, profile (AccessKeyId, SecretAccessKey) ์ •๋ณด๋ฅผ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์„ค์ •ํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ (as bash function)
#!/usr/bin/env bash
function aws-select {
# Changelog
# 0.1 (2016.01.11): initial release
# 0.2 (2016.01.15)
# aws-credential.txt no longer needed. only $HOME/.aws/credentials required.
# hide parts of secret key displayed
@giseongeom
giseongeom / aws-select.cmd
Last active April 6, 2016 18:11
aws-select: AWS region, profile (AccessKeyId, SecretAccessKey) ์ •๋ณด๋ฅผ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์„ค์ •ํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ
@echo off
:: -----------------------------------------------------------------
:: * Subject : AWS profile / region selection script
:: * Author : GiSeong Eom <jurist@kldp.org>
:: * Created : 2016.01.07
:: * Updated : 2016.04.07
:: -----------------------------------------------------------------
SETLOCAL ENABLEDELAYEDEXPANSION
@giseongeom
giseongeom / unix-rebase.cmd
Created January 5, 2016 08:16
cygwin ๊ณ„์—ด๋“ค์˜ rebase ์ž‘์—… ์Šคํฌ๋ฆฝํŠธ
@echo off
IF #%1# == ## (
GOTO :usage
) ELSE (
GOTO :selection
)
:selection
IF /I %1 == cygwin GOTO :cygwin
@giseongeom
giseongeom / enable-excel-preview-in-outlook2016.cmd
Created November 13, 2015 00:50
Outlook 2016์—์„œ Excel preview ๊ฐ€๋Šฅํ•˜๋„๋ก ์„ค์ • (Windows:64-bit / Office: 32-bit)
@echo off
reg delete HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\PreviewHandlers /v {00020827-0000-0000-C000-000000000046} /f
reg add HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\PreviewHandlers /v {00020827-0000-0000-C000-000000000046} /t REG_SZ /d "Microsoft Excel previewer"
@giseongeom
giseongeom / gather-system-info-and-hashoutput.ps1
Last active October 6, 2015 08:51
2015.10.06 / ๊น€์šฉ์ผ๋‹˜์ด ๋ถ€ํƒํ•œ ๋‚ด์šฉ
#requires -version 2
# 1. ์‹œ์Šคํ…œ OS๋ช… -- OsName:"Windows"
$OsName = Get-WmiObject Win32_OperatingSystem | Select-Object -ExpandProperty caption
# 2. ์‹œ์Šคํ…œ OS ์ƒ์„ธ๋ฒ„์ ผ -- OsVersion:
# Get-WmiObject Win32_OperatingSystem | Get-Member
# Get-WmiObject Win32_OperatingSystem | Format-List *
$OsVersion = Get-WmiObject Win32_OperatingSystem | Select-Object caption,OSArchitecture,CSDVersion,MUILanguages
$OsVersionValue = $OsVersion.caption + ' ' + $OsVersion.OSArchitecture + ' ' + $OsVersion.CSDVersion + ' ' + $OsVersion.MUILanguages
@giseongeom
giseongeom / msiextract.cmd
Last active September 7, 2015 14:28
.msi file ์„ ํ˜„์žฌ ํด๋”์— ์••์ถ• ํ•ด์ œ.
@echo off
SETLOCAL
IF #%1# == ## (
GOTO :usage
) ELSE (
GOTO :main
)
# get-koalra-files.ps1
# Retrieve .pptx files from Koalra Server
#
# Author : GiSeong Eom <jurist@kldp.org>
# Created: 2012-06-22
# Updated: 2013-03-16
# ChangeLog
# v0.2 Updated for SC2012 LAB files
# v0.1 Originally written
@giseongeom
giseongeom / DellServer_CheckDisk.ps1
Last active March 6, 2017 05:23
Dell OMSA Managed Node ์„ค์น˜๋œ ์„œ๋ฒ„์—์„œ omreport ๋ช…๋ น์„ ์ด์šฉํ•ด์„œ RAID ๊ตฌ์„ฑ๋œ ๋””์Šคํฌ rebuild ์ƒํƒœ๋ฅผ ์ฒดํฌ
omreport storage pdisk controller=0 -fmt ssv `
| select -Skip 4 | ConvertFrom-Csv -Delimiter ";" `
| ft Name,Progress,Revision,'Product Id' -AutoSize
Name Progress Revision Product ID
---- -------- -------- ----------
Physical Disk 0:1:0 Not Applicable GS10 ST4000NM0023
Physical Disk 0:1:1 Not Applicable GS10 ST4000NM0023
Physical Disk 0:1:2 Not Applicable GS10 ST4000NM0023
@giseongeom
giseongeom / cdate.cmd
Last active December 17, 2015 15:39
clipboard์— ํ˜„์žฌ์‹œ๊ฐ„ YYYY.MM.DD-HH:MM:SS (์˜ˆ 2013.05.23-15:25:14) ๋ณต์‚ฌ
@echo off
rem method A.
rem When %date% variable is used, the output may different according to system locale.
rem So use method B instead of A, because method A's not recommended.
rem echo %date%-%time% | tr -d \r\n| tr -d [:space:] | clip
rem method B.
rem udate.exe, tr.exe is part of GNU Win32 tools.
rem udate.exe (renamed from date.exe to avoid confusing with date command on Windows O/S)
@giseongeom
giseongeom / get_fibonacci.cmd
Last active December 16, 2015 16:59
์ƒํ™œ์ฝ”๋”ฉ ๋ฌธ์ œ: "ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์˜ ๊ฐ ํ•ญ์€ ๋ฐ”๋กœ ์•ž์˜ ํ•ญ ๋‘ ๊ฐœ๋ฅผ ๋”ํ•œ ๊ฒƒ์ด ๋ฉ๋‹ˆ๋‹ค. 1๊ณผ 2๋กœ ์‹œ์ž‘ํ•˜๋Š” ๊ฒฝ์šฐ ์ด ์ˆ˜์—ด์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... ์ง์ˆ˜์ด๋ฉด์„œ 4๋ฐฑ๋งŒ ์ดํ•˜์ธ ๋ชจ๋“  ํ•ญ์„ ๋”ํ•˜๋ฉด ์–ผ๋งˆ๊ฐ€ ๋ฉ๋‹ˆ๊นŒ?" ์ถœ์ฒ˜ : http://euler.synap.co.kr/prob_detail.php?id=2 ์ž์‹ ์ด ์‹œ๋„ํ•ด๋ณด๊ณ  ์‹ถ์€ ์–ธ์–ด๋‚˜ ๊ฐ€์žฅ ์ž˜ ์‚ฌ์šฉํ•˜๋Š” ์–ธ์–ด๋ฅผ ์‚ฌ์šฉํ•˜์…” ํ‘ธ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๊ทธ ๋‹ต์˜ ์†Œ์Šค์™€ ๋‹ต, ์„ค๋ช…์„ ๋‹ต๊ธ€๋กœ ๋‹ฌ์•„์ฃผ์„ธ์š”^^ ๊ทธ๋ฆฌ๊ณ  ๋˜๋„๋ก์ด๋ฉด ์œ„ ์‚ฌ์ดํŠธ์—๋„ ๋‹ต๋ณ€์„ ๋‹ฌ์•„์ฃผ์‹œ๊ธฐ๋ฅผ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
@echo off
SETLOCAL EnableDelayedExpansion
SET /A FIBO_MAX=4000000
SET /A FIBO_A=1
SET /A FIBO_B=2
SET /A FIBO_TMP=0
SET /A FIBO_E_SUM=0
SET FIBO_LIST=List.txt