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 <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 / 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