Banner

My Tech Blog (Coding)

1. How can users access AWS ? - To access AWS, you have three options:    •   AWS Management Console (protected by password + MFA)    •  AWS Command Line Interface (CLI): protected by access keys    •  AWS Software Developer Kit (SDK) - for code: protected by access keys  - Access Keys are generated through the AWS Console  - Users manage their own access keys  - Access Keys are secret, just lik..
IAM Policies StructureIAM JSON ํŒŒ์ผ์€ AWS์—์„œ IAM(Identity and Access Management) ์ •์ฑ…์„ ์ •์˜ํ•  ๋•Œ ์‚ฌ์šฉ๋˜๋Š” ํŒŒ์ผ ํ˜•์‹์ด๋‹ค. ์ด ํŒŒ์ผ์€ JSONํ˜•์‹์œผ๋กœ ์ž‘์„ฑ๋˜๋ฉฐ, ์‚ฌ์šฉ์ž, ๊ทธ๋ฃน, ์—ญํ• (Role) ๋“ฑ์— ๋Œ€ํ•œ  ๊ถŒํ•œ(permissions)์„ ์„ค์ •ํ•˜๋Š” ๋ฐ ์“ฐ์ธ๋‹ค.  IAM JSON StructureIAM JSON ํŒŒ์ผ์€ AWS ๋ฆฌ์†Œ์Šค์— ๋Œ€ํ•ด ํ—ˆ์šฉ(Allow)ํ•˜๊ฑฐ๋‚˜ ๊ฑฐ๋ถ€(Deny)ํ•  ์ž‘์—…์„ ๋ช…์‹œํ•˜๋Š” ์ •์ฑ…(policy)์„ ์ •์˜ํ•œ๋‹ค.์ด๋ฅผ ํ†ตํ•ด ์–ด๋–ค ์‚ฌ์šฉ์ž๊ฐ€ ์–ด๋–ค AWS ์„œ๋น„์Šค์—์„œ ์–ด๋–ค ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋Š”์ง€๋ฅผ ์ œ์–ดํ•œ๋‹ค.JSON ํŒŒ์ผ ์˜ˆ์‹œ JSON ํŒŒ์ผ ํ•„๋“œConsists of• Version: policy language version, always incl..
IAM Identity and Access Management- ์‚ฌ์šฉ์ž๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๊ทธ๋ฃน์— ๋ฐฐ์น˜ํ•˜๊ธฐ ๋•Œ๋ฌธ์— Global Service- Root account created by default, shouldn't be used or shared - Users are people within your organization, and can be grouped- Groups only contain users, not other groups- Users don't have to belong to a group, and user can belong to multiple groups IAM: Permissions- Users or Groups can be assinged JSON documents called po..
Sensor1_X:66,Sensor1_Y:69,Sensor1_Z:61,Sensor2_X:-14,Sensor2_Y:20,Sensor2_Z:-20….(์ค‘๋žต)>์ด๋Ÿฐ ๊ฒŒ ๊ณ„์† ๋ฐ˜๋ณต๋จ , ๊ธฐ์ค€์œผ๋กœ ๋ฐ์ดํ„ฐ ๋‚˜๋ˆ„๋ ค๊ณ  ํ•จ. data = "Sensor1_X:70,Sensor1_Y:53,Sensor1_Z:73,Sensor2_X:1,Sensor2_Y:1,Sensor2_Z:1" # ์˜ˆ์‹œ ๋ฐ์ดํ„ฐ# ','๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋‚˜๋ˆ”sensor_data = data.split(',')# ':'๋กœ ๋‹ค์‹œ ๋‚˜๋ˆ„์–ด์„œ ๊ฐ๊ฐ์˜ ์„ผ์„œ ๊ฐ’ ์ถ”์ถœsensor_dict = {}for sensor in sensor_data: sensor_name, value = sensor.split(':') sensor_dict[sensor_name] = int(..
# ํ…œํ”Œ๋ฆฟ ๋ฆฌํ„ฐ๋Ÿด(Template Literal)ES6๋ถ€ํ„ฐ ์ƒˆ๋กœ ๋„์ž…๋œ ๋ฌธ์ž์—ด ํ‘œ๊ธฐ๋ฒ•๋ฌธ์ž์—ด ์ƒ์„ฑ์‹œ ๋”ฐ์˜ดํ‘œ ๋Œ€์‹ , ๋ฐฑํ‹ฑ(`)์„ ์‚ฌ์šฉvar str_01 = `hello world`;//๋ฐฑํ‹ฑ ์‚ฌ์šฉconst x='x';const y='y';const z='z';console.log(`${x}๋Š” x, ${y}๋Š” y, ${z}๋Š” z์ด๋‹ค. `); //x๋Š” x, y๋Š” y, z๋Š” z์ด๋‹ค. โ–ถ๏ธŽ ๋ฐฑํ‹ฑ(`)์€ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ JS ES6(ECMAScript 2015)๋ถ€ํ„ฐ ๋„์ž…๋˜์—ˆ๋‹ค.โ–ถ๏ธŽ ๊ฐœํ–‰ ๋ฌธ์ž(\n)๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ์ž๋™ ์ค„๋ฐ”๊ฟˆ โ–ถ๏ธŽ ์ƒ๊น€์ƒˆ๊ฐ€ ์ž‘์€๋”ฐ์›€ํ‘œ(')์™€ ๋น„์Šทํ•˜๋‹ˆ ํ—ท๊ฐˆ๋ฆฌ์ง€ ์•Š๋„๋ก ์ฃผ์˜# ํ…œํ”Œ๋ฆฟ ๋ฆฌํ„ฐ๋Ÿด - ๋ฐฑํ‹ฑ(`)์˜ ๊ธฐ๋Šฅ ์ค„๋ฐ”๊ฟˆ(๊ฐœํ–‰: Multi-line strings)  โ–ถ๏ธŽ ๋ฐฑํ‹ฑ(`)์œผ๋กœ ํ…œํ”Œ๋ฆฟ ๋ฆฌํ„ฐ๋Ÿด์„ ์‚ฌ์šฉํ•˜๋ฉด..
// JSON ๋ฐ์ดํ„ฐ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•œ JS ์‚ฌ์šฉ๋ฒ•// [1] : ๋ฐ์ดํ„ฐ const person = [ `{"name":"์ด์ˆœ์‹ ","age":20,"nationality":"๋Œ€ํ•œ๋ฏผ๊ตญ"}`, {"name":"๋งฅ์•„๋”","age":30,"nationality":"๋ฏธ๊ตญ"}, {"name":"์—˜๋ฆฌ์ž๋ฒ ์Šค","age":40,"nationality":"์˜๊ตญ"}, {"name":"์ž”๋‹ค๋ฅดํฌ","age":50,"nationality":"ํ”„๋ž‘์Šค"},]; console.log(typeof person); // objectconsole.log(typeof person[0]); // stringconsole.log(typeof person[1]); // object ์ฒซ๋ฒˆ์งธ ์š”์†Œ๋ฅผ ์ž‘์€ ๋”ฐ์˜ดํ‘œ๋กœ ๊ฐ์‹ธ๋ฉด string ..
Visual Studio Code (VSCode)์—์„œ Python์„ ์„ค์น˜ํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• 1. Python ์„ค์น˜์ผ๋‹จ ์ฃผ์˜ํ•  ์ ์€ Python ๊ณต์‹ ์›น์‚ฌ์ดํŠธ์—์„œ ๋‹ค์šด๋กœ๋“œํ•˜๊ธฐ ๋งˆ์ดํฌ๋กœ์†Œํ”„ํŠธ ์Šคํ† ์–ด ์•ฑ ๋‹ค์šด X ์ค‘์š”ํ•œ ์ !์„ค์น˜ ๊ณผ์ •์—์„œ ๋ฐ˜๋“œ์‹œ "Add Python to PATH" ์ฒดํฌ๋ฐ•์Šค๋ฅผ์„ ํƒํ•ด์•ผ ํ™˜๊ฒฝ๋ณ€์ˆ˜์— ์ž๋™์œผ๋กœ ๋“ฑ๋กํ•จ.(์ด ์˜ต์…˜์„ ์„ ํƒํ•˜์ง€ ์•Š์œผ๋ฉด VSCode์—์„œ Python์„ ์‹คํ–‰ํ•  ๋•Œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ์Œ)์‹œ์Šคํ…œ > ํ™˜๊ฒฝ๋ณ€์ˆ˜์— ํŒŒ์ด์ฌ ์ง์ ‘ ๋“ฑ๋กํ•ด ์ฃผ์–ด์•ผ ํ•จ ์ด๋ ‡๊ฒŒ ๋‘ ๊ฐœ ๋“ฑ๋กํ•ด ์ฃผ์–ด์•ผ ํ•จ. C:\Python39 ๋˜๋Š” C:\Users\YourUser\AppData\Local\Programs\Python\Python39 (์„ค์น˜ ๊ฒฝ๋กœ)C:\Python39\Script 2. VSCode์—์„œ Python ํ™•์žฅ..
์ž๋ฐ” JDBC๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์—ฐ๊ฒฐํ•  ๋•Œ ์‚ฌ์šฉํ•œ ์ž์›์€ `connection.close()` ์ฒ˜๋Ÿผ `close()` ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋‹ซ์•„ ์ฃผ์–ด์•ผ ํ•œ๋‹ค. ํ•˜์ง€๋งŒ try with resources ๊ตฌ๋ฌธ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋ณ„๋„๋กœ ์ž์›ํ•ด์ œ๋ฅผ ์•ˆ ํ•ด ์ค˜๋„ ๋œ๋‹ค. try ๊ตฌ๋ฌธ์—์„œ ์ž์›์„ ์„ ์–ธํ•˜๋ฉด ์ž๋™์œผ๋กœ ํ•ด์ œ๋˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.์ด์ฒ˜๋Ÿผ try-with-resources๋Š” ๋ฆฌ์†Œ์Šค ๊ด€๋ฆฌ๊ฐ€ ์ค‘์š”ํ•œ ํ”„๋กœ๊ทธ๋žจ์—์„œ ์˜ค๋ฅ˜๋ฅผ ๋ฐฉ์ง€ํ•˜๊ณ  ์ฝ”๋“œ ํ’ˆ์งˆ์„ ๋†’์ด๋Š” ๋งค์šฐ ์œ ์šฉํ•œ ๊ธฐ๋Šฅ์ด๋‹ค. ํŒŒ์ผ ์ž…์ถœ๋ ฅ, ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—ฐ๊ฒฐ, ๋„คํŠธ์›Œํฌ ์†Œ์ผ“ ๋“ฑ ๋‹ค์–‘ํ•œ ์ƒํ™ฉ์—์„œ ํ™œ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค. ๊ธฐ๋ณธ์‚ฌ์šฉ๋ฒ•์ฝ”๋“œ์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋“ฏ์ด try-with-resources์˜ ๊ธฐ๋ณธ ํ˜•์‹์€ try๋ฌธ ์•ˆ์—์„œ ์ž์›์„ ์„ ์–ธํ•˜๋Š” ๊ฒƒ์ด๋‹ค.try (๋ฆฌ์†Œ์Šค_ํƒ€์ž… ๋ฆฌ์†Œ์Šค_์ด๋ฆ„ = new ๋ฆฌ์†Œ์Šค_ํƒ€์ž…()) {..
์ธ์ ˆ๋ฏธ์˜€๋˜๊ฒƒ
'Coding' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก
์ƒ๋‹จ์œผ๋กœ