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 / payA.ps1
Created April 22, 2013 07:15
์ƒํ™œ์ฝ”๋”ฉ ๋ฌธ์ œ: "1์›, 5์›, 10์›, 50์›, 100์›, 500์›์งœ๋ฆฌ๊ฐ€ ๊ฐ๊ฐ C1, C5, C10, C50, C100, C500๊ฐœ์”ฉ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ€๋Šฅํ•œ ์ ์€ ์ˆ˜์˜ ๋™์ ์œผ๋กœ A์›์„ ์ง€๋ถˆํ•˜๋ ค๋ฉด, ๋ช‡ ๊ฐœ์˜ ๋™์ „์ด ์žˆ์–ด์•ผ ํ• ๊นŒ์š”? ์ง€๋ถˆ ๋ฐฉ๋ฒ•์€ ์ ์–ด๋„ 1๊ฐœ๋Š” ์กด์žฌํ•œ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค."
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[int]$A
)
[int]$C1 = 0
[int]$C5 = 0
[int]$C10 = 0
@giseongeom
giseongeom / stacklimit-testing.ps1
Created April 23, 2013 00:49
์žฌ๊ท€๋ฅผ ์ด์šฉํ•œ stack limit ํ…Œ์ŠคํŠธ PowerShell v1 ์—์„œ๋Š” 100์ด ์ตœ๋Œ€์˜€๋‹ค๊ณ  ํ•œ๋‹ค.
function myfunc([int]$n)
{
if ($n -gt 0) { Write-Host $n ; myfunc($n-1) }
}
@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
@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 / 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
# get-koalra-files.ps1
# Retrieve .pptx files from Koalra Server
#
# Author : GiSeong Eom <[email protected]>
# Created: 2012-06-22
# Updated: 2013-03-16
# ChangeLog
# v0.2 Updated for SC2012 LAB files
# v0.1 Originally written
@giseongeom
giseongeom / msiextract.cmd
Last active September 7, 2015 14:28
.msi file ์„ ํ˜„์žฌ ํด๋”์— ์••์ถ• ํ•ด์ œ.
@echo off
SETLOCAL
IF #%1# == ## (
GOTO :usage
) ELSE (
GOTO :main
)
@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 / 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 / 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