๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

IT-Engineering135

Git Push๋ฅผ ๊ท€์ฐฎ๊ฒŒ ๋งŒ๋“œ๋Š” ์—๋Ÿฌ ํ•ด๊ฒฐ: Enter passphrase for key '~/.ssh/id_rsa' ๋ฌธ์ œ์™€ Could not open a connection to your authentication agent. ๋ฌธ์ œ ๋‘˜๋‹ค ํ•ด๊ฒฐํ•˜๊ธฐ ์–ธ์  ๊ฐ€๋ถ€ํ„ฐ https๋กœ git repository๋กœ๋ถ€ํ„ฐ ์†Œ์Šค๋ฅผ ๋ฐ›์„ ๋•Œ ์ž๊พธ ๊ณ„์ • ํ™•์ธ์ด ๋œจ๋Š”๊ฒŒ ๊ท€์ฐฎ์•˜๋‹ค. ๊ทธ๋ž˜์„œ ssh key๋“ฑ๋ก์„ ํ•˜๊ณ  ํ•œ๋ฒˆ ๊ท€์ฐฎ์Œ์„ ๊ฐ์ˆ˜ํ•˜๊ณ  ๊ณ„์† ํŽธํ•˜๊ฒŒ ํ•˜๋ ค๊ณ  ssh ์„ค์ •์„ ๊ฐํ–‰ํ–ˆ๋‹ค. git push์‹œ ์ž๋™ ๋กœ๊ทธ์ธ ์„ค์ • - username, password๊ทธ๋งŒ ์ž…๋ ฅํ•˜์ž github respository์— git push -u origin master ๋ฅผ ํ–ˆ์„ ๋•Œ ์•„๋ž˜์™€ ๊ฐ™์ด ์ž๊พธ ๋กœ๊ทธ์ธ์„ ์š”์ฒญํ•˜๋Š” ๊ฒฝ์šฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ์ •๋ฆฌ. repository์ฃผ์†Œ๋ฅผ https ๋กœ ๋ฐ›์•„์„œ ์ฒ˜๋ฆฌํ•˜๋˜ ๊ฒฝ์šฐ์— ํ”„๋กœํ† ์ฝœ์„ ssh ๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค.. gentlesark.tistory.com ํ•จ๊ป˜๋ณด๋ฉด ์ข‹์€ ๊ธ€ ๊ทธ๋Ÿฐ๋ฐ ์–ด์ฉ ์ผ์ธ์ง€ ์ž‘์—…ํ•˜๋Š” ์ปดํ“จํ„ฐ ์ค‘ ํ•œ ๋†ˆ์€ ์ง€์†์ ์œผ๋กœ ์•„๋ž˜์˜ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฑ‰๋Š” ๊ฒƒ์ด ์•„๋‹Œ๊ฐ€? (์ฐธ๊ณ .. 2020. 9. 11.
Windowsํ™˜๊ฒฝ์—์„œ Python mysql ์ ‘์† ๋ฌธ์ œ ํ•ด๊ฒฐ (Alchemy, MySQLdb ์‚ฌ์šฉ์‹œ) ์ด๋ฒˆ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์˜ ์ฝ”๋“œ์ฒ˜๋Ÿผ pandas์˜ DataFrame๊ฐ์ฒด๋ฅผ mysql db์— ์‚ฝ์ž…ํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์˜€๋‹ค. engine = create_engine('mysql+mysqlconnector://'+MYSQL_USER+':'+MYSQL_PASSWORD+'@'+MYSQL_HOST_IP+':'+MYSQL_PORT+'/'+MYSQL_DATABASE, echo=False) df = pd.read_csv("./test.csv") with engine.connect() as conn, conn.begin(): df.to_sql('Table1', conn, if_exists='replace') ์—๋Ÿฌ ๋‚ด์šฉ์€ ๊ฐœ๋žต์ ์œผ๋กœ ์•„๋ž˜์™€ ๊ฐ™๋‹ค. MySQLdb._exceptions.OperationalError: (2059.. 2020. 9. 3.
Python ๋ฆฌ์ŠคํŠธ(list) csv ํŒŒ์ผ๋กœ ์ฝ๊ณ  ์“ฐ๊ธฐ(๋ถˆ๋Ÿฌ์˜ค๊ธฐ, ์ €์žฅํ•˜๊ธฐ) ๋”ฅ๋Ÿฌ๋‹ ๋“ฑ AI๊ด€๋ จ ์ž‘์—…์„ ํ•˜๋‹ค๋ณด๋ฉด csv๋ฅผ ๊ฐ€์ ธ์™€์„œ ์—ด๊ณ  ์ž‘์—…์„ ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ œ๋ฒ• ๋งŽ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ, ๋ง‰์ƒ ์ง์ ‘ ๋งŒ๋“  ์ฝ”๋“œ์—์„œcsv๋ฅผ ๋ฝ‘์•„๋‚ด๊ณ  ๊ทธ ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ๋“ค์ด๋ ค๋‹ค ๋ณด๋ฉด ์ฝ”๋“œ ์ž‘์„ฑ์ด ํ—ท๊ฐˆ๋ฆด ๋•Œ๊ฐ€ ์žˆ๋”ฐ. ๊ทธ๋ž˜์„œ ํŠน์ • ์˜ˆ์ œ๋ฅผ ๋งŒ๋“ค์–ด csvํŒŒ์ผ์„ ์ฝ๋Š” ๊ณผ์ •๊ณผ ์“ฐ๋Š” ๊ณผ์ •์„ ๊ฐ๊ฐ ๋ณด์ด๋„๋ก ํ•˜๊ฒ ๋‹ค. Python ๋ฆฌ์ŠคํŠธ csv๋กœ ์ €์žฅํ•˜๊ธฐ ํŒŒ์ด์ฌ ๋ชจ๋“ˆ์ธ csv ๋ชจ๋“ˆ์„ importํ•˜๊ณ  ๋ฐ์ดํ„ฐ๋Š” ๋‚ ์งœ ๋ฐ์ดํ„ฐ, ์ •์ˆ˜ ๋ฐ์ดํ„ฐ, ๋ถ€๋™์†Œ์ˆ˜์  ์ž๋ฃŒํ˜• ๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ–ˆ๋‹ค. ์—‘์…€๋กœ ๊ทธ๋ฆฐ๋‹ค๋ฉด ์—ด ๋ฐฉํ–ฅ์œผ๋กœ ๊ทธ๋ฆด ๊ฒƒ ๊ฐ™์ง€๋งŒ, ํŒŒ์ด์ฌ ๋ฆฌ์ŠคํŠธ๋กœ ํ‘œํ˜„ํ•˜์—ฌ ํ–‰ ๋ฐฉํ–ฅ์œผ๋กœ ๋‚˜์—ด๋˜์—ˆ๋‹ค. # csv ๋ชจ๋“ˆ importํ•˜๊ธฐ import csv # list ๋งŒ๋“ค๊ธฐ date = ['200801','200802','200803','200804','20080.. 2020. 8. 7.
Python์œผ๋กœ ์‹ค์‹œ๊ฐ„ ๋กœ๊ทธ ํŒŒ์ผ ๋ชจ๋‹ˆํ„ฐ๋ง ์ฝ”๋“œ ๊ตฌํ˜„ ํŒŒ์ด์ฌ(Python)์œผ๋กœ ์‹ค์‹œ๊ฐ„(real-time) ๋กœ๊ทธ(log) ํŒŒ์ผ ๋ชจ๋‹ˆํ„ฐ๋ง(monitoring) ์ฝ”๋“œ ๊ตฌํ˜„ Python์œผ๋กœ ํ”„๋กœ๊ทธ๋žจ์„ ๊ตฌํ˜„ํ•  ๋•Œ ๊ณ„์†ํ•ด์„œ ๋กœ๊ทธ๋ฅผ ์ฐ๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ์ด ๋•Œ ๋˜ ๋‹ค๋ฅธ ํ”„๋กœ๊ทธ๋žจ์€ ์ฐํžˆ๋Š” ๋กœ๊ทธ๋ฅผ ๊ณ„์†ํ•ด์„œ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด ๊ณ ์„ฑ๋Šฅ HPC์—์„œ ์ž‘์—…์„ ๋Œ๋ฆฌ๊ณ  ํ•ด๋‹น PC์—์„œ logํŒŒ์ผ์„ ์ถœ๋ ฅํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ํด๋ผ์ด์–ธํŠธ ์žฅ๋น„์ธ ๋‚ด ์ปดํ“จํ„ฐ์—์„œ ํ•ด๋‹น logํŒŒ์ผ์„ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ด๋Ÿฐ ๊ฒฝ์šฐ๊ฐ€ ๋˜๊ฒ ๋‹ค. ๋จผ์ € ๋กœ๊ทธํŒŒ์ผ์„ ์ฐ๋Š” ์˜ˆ์‹œ์ฝ”๋“œ์ด๋‹ค. logging.py with open("log.txt", "w") as f: for i in range(100): text = "I love sark. %d\n" % i print(text, .. 2020. 7. 30.
Python format ํ•จ์ˆ˜ ์‚ฌ์šฉ์‹œ ์•ˆ์— ๊ด„ํ˜ธ ๋„ฃ๊ธฐ - ํŒŒ์ด์ฌ ๊ฟ€ํŒ Python formatํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ต‰์žฅํžˆ ํŽธํ•˜๊ฒŒ ๋‹ค์–‘ํ•œ ๋ณ€์ˆ˜๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๋‹ค. ์•„๋ž˜์˜ ์˜ˆ์ฒ˜๋Ÿผ { } ์ค‘๊ด„ํ˜ธ ํ‘œ์‹œ์™€ ๊ด„ํ˜ธ ์•ˆ์— :์ „์ฒด์ž๋ฆฌ์ˆ˜.์†Œ์ˆ˜์ ์ž๋ฆฌ์ˆ˜+์˜ต์…˜ ํ˜•ํƒœ๋กœ ํŽธํ•˜๊ฒŒ string์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. homepath = '/home/sark/dev/python/test' this_job = 3 num_job = 10 progress = this_job/num_job job_status = "Running" print(("Path:{}, Job({}/{}), Progress:{:4.2%}, Status:{}") .format(homepath,this_job,num_job,progress,job_status)) ์ถœ๋ ฅ๊ฒฐ๊ณผ Path:/home/sark/dev/python/test, Job(.. 2020. 7. 27.
์ž๋ฐ”(Java) ๋ฒ„์ „ ํ™•์ธ ๋ฐ ๊ธฐ๋ณธ์œผ๋กœ ์‚ฌ์šฉํ•  Java ๋ฒ„์ „ ๋ณ€๊ฒฝํ•˜๊ธฐ(JDK ์—ฌ๋Ÿฌ๊ฐœ ์‚ฌ์šฉ์‹œ) ๋ฆฌ๋ˆ…์Šค(Linux)์—์„œ ์ž๋ฐ”(Java) ๊ฒฝ๋กœ๋ฅผ ๋จผ์ € ํ™•์ธํ•˜๊ณ ์ž ํ•œ๋‹ค๋ฉด, ์•„๋ž˜์˜ ๊ธ€์„ ์ฝ์–ด๋ณด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค! ์šฐ๋ถ„ํˆฌ(Ubuntu)์—์„œ ์ž๋ฐ”(Java) ๊ฒฝ๋กœ(path) ์ฐพ๊ธฐ ๊ฐ€๋” ์šฐ๋ถ„ํˆฌ์—์„œ ์ž‘์—…ํ•˜๋‹ค ๋ณด๋ฉด, ๋‚ด๊ฐ€ ์ž๋ฐ”๋ฅผ ๋”ฐ๋กœ ์••์ถ•ํŒŒ์ผ์„ ๋ฐ›์•„์„œ ์„ค์น˜ํ–ˆ๋Š”์ง€ apt-get ๋ช…๋ น์–ด๋กœ ์„ค์น˜ํ–ˆ๋Š”์ง€๋„ ํ—ท๊ฐˆ๋ฆด ๋•Œ๊ฐ€ ์žˆ๋‹ค. (feat.๊ธฐ์–ต๋ ฅ ๊ฐํ‡ด) ์ด์— ์„ค์น˜๋œ ์ž๋ฐ” ๊ฒฝ๋กœ๋ฅผ ์ฐพ๋Š” ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ• gentlesark.tistory.com Java ๋ฒ„์ „์„ ํ™•์ธํ•˜๋Š” ๋ช…๋ น์–ด๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค. java -version openjdk version "1.8.0_252" OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09) OpenJDK 64-Bit Server VM (bui.. 2020. 7. 17.
์šฐ๋ถ„ํˆฌ(Ubuntu) 16 ์—์„œ 18๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ๊ฐ€ ์•ˆ ๋  ๋•Œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ์–ด๋Š ๋‚ ์ธ๊ฐ€๋ถ€ํ„ฐ ์ง€์†์ ์œผ๋กœ Ubuntu 18๋กœ ์—…๋ฐ์ดํŠธํ•˜๋ผ๋Š” ๋ฉ”์‹œ์ง€๊ฐ€ ๋–ด๋Š”๋ฐ, OK ์•Œ๊ฒ ์–ด ํ•˜๊ณ  ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ๋„ ๋ฐ˜์‘์ด ์—†๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์•˜๋‹ค. ์—ฌ๋Ÿฌ๋ฒˆ ๋ฐ˜๋ณต๋˜๋‹ˆ '์ด๊ฑด ํ„ฐ๋ฏธ๋„์—์„œ ํ•ด๊ฒฐํ•ด์•ผํ•  ๋ฌธ์ œ๊ฒ ๊ตฐ'ํ•˜๋ฉฐ ํ„ฐ๋ฏธ๋„์—์„œ ์ด๋ž˜์ €๋ž˜ ๋งŒ์ ธ๋ดค๋Š”๋ฐ, ์ž˜๋˜์ง€ ์•Š๋‹ค๊ฐ€ ๊ฒฐ๊ตญ์€ ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ํ•˜๊ฒŒ ๋˜์–ด ๊ธฐ์œ ๋งˆ์Œ์œผ๋กœ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ๊ณต์œ ํ•œ๋‹ค. ๋ณธ ๊ฒฝ์šฐ๋Š” Ubuntu 16.04 LTS์—์„œ 18.04 LTS๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•œ ํ›„๊ธฐ์ด๋‹ค. LTS๋Š” Long-Term Support๋กœ ์˜ค๋žœ๊ธฐ๊ฐ„ ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ๋˜๋Š” ์•ˆ์ •ํ™”๋œ ๋ฒ„์ „์„ ๋œปํ•œ๋‹ค. ๋ฌธ์ œ๋Š” ํฌ๊ฒŒ ๋‹ค์Œ์˜ ๋‘๊ฐ€์ง€ ๋ฐฉ์‹์œผ๋กœ ๋‚˜ํƒ€๋‚  ๊ฒƒ์ด๋‹ค. ๋จผ์ € ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ํ•˜๊ธฐ ์ „์— ๋‹ค์Œ์˜ ๋ช…๋ น์–ด๋“ค์„ ์ž…๋ ฅํ•ด๋ณด์ž. sudo apt update sudo apt upgrade sudo apt dist-upgrade sudo.. 2020. 7. 17.
์šฐ๋ถ„ํˆฌ(Ubuntu) LTS ๋ฒ„์ „ ์ด๋ฆ„ (์ฝ”๋“œ๋ช…) ํ˜„์žฌ๋Š” 16.04, 18.04, 20.04 ์ •๋„์˜ LTS(Long-Term Support)๊ฐ€ ๊ฐ€์žฅ ๋งŽ์ด ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋Š” ๋“ฏํ•˜๋‹ค. ์ด์ „ ๊ฒƒ๋“ค์€ ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ๋˜์ง€ ์•Š๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ผ ๊ฒƒ. ์–ด์ฐŒ๋๋“  LTS ์ด๋ฆ„ ์ •๋„๋Š” ์•Œ์•„๋‘๋ฉด ๊ฐ์ข… ์ž๋ฃŒ๋ฅผ ๋ณผ ๋•Œ ๋‚˜๋ฆ„ ๋„์›€์ด ๋˜๋Š” ๋ฉด์ด ์žˆ๋‹ค. 10.04 Lucid Lynx 12.04 Precise Pangolin 14.04 Trusty Tahr 16.04 Xenial Xerus 18.04 Bionic Beaver 20.04 Focal Fossa ๊ฐ€๋ณ๊ฒŒ ์™ธ์›Œ๋‘๋„๋ก ํ•ด์•ผ์ง€. 2020. 7. 17.
Docker Desktop Windows 10์—์„œ ์‚ฌ์šฉ์‹œ 'Cannot enable Hyper-V service' ์—๋Ÿฌ ํ•ด๊ฒฐํ•˜๊ธฐ ๋ถ„๋ช… PC์˜ Hyper-V๋„ ์ผœ๋‘์—ˆ๊ณ , Oracle VirtualBox๋„ ์ž˜ ๋Œ๋ฆฌ๊ณ  ์žˆ์—ˆ๋Š”๋ฐ, Docker๋ฅผ ์‹คํ–‰ํ•˜๋‹ˆ ๋‹ค์Œ์˜ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚ฌ๋‹ค. Cannot enable Hyper-V service ์›น์„ ์ฐพ์•„๋ดค๋Š”๋ฐ๋„ Hyper-V๊ฐ€ ๊บผ์ ธ์žˆ๋‹ค๋Š” ์ •๋„๋งŒ ๋‚˜์™€์„œ ํ—ค๋งธ๋Š”๋ฐ, 'ํ†ต๋ฐฅ'์œผ๋กœ ํ•ด๊ฒฐํ–ˆ๋‹ค. ๋งŒ์•ฝ ์ง„์งœ Hyper-V ๋ฌธ์ œ๋ผ๋ฉด ํ˜น์‹œ PC ๋ฐ”์ด์˜ค์Šค ์„ค์ •์—์„œ ๊ฐ€์ƒํ™”๊ฐ€ ๊บผ์ ธ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  Windows์˜ Hyper-V๋ฅผ ํ™•์ธํ•˜๋ฉด ๋  ๋“ฏํ•˜๋‹ค. ์ด ๋ถ€๋ถ„์€ Oracle VirtualBox์„ ์‚ฌ์šฉํ•  ๋•Œ๋„ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์„ ๋ฌธ์ œ์ด๋‹ˆ ๊ตฌ๊ธ€๋ง์œผ๋กœ ์‰ฝ๊ฒŒ ์ฐพ์„ ์ˆ˜ ์žˆ์„ ๋“ฏํ•˜๋‹ค. ๋ฐ”์ด์˜ค์Šค๊ฐ€ ์•„๋‹Œ Windows์—์„œ์˜ Hyper-V ์„ธํŒ…์€ ๋ณธ ํฌ์ŠคํŒ…์—์„œ ํ•จ๊ป˜ ๋‹ค๋ฃจ๋„๋ก ํ•˜๊ฒ ๋‹ค. ๋จผ์ € ๋งจ ํ•˜๋‹จ ์œˆ๋„์šฐ ์•„์ด์ฝ˜์— ๋งˆ์šฐ์Šค ์šฐํด๋ฆญ์„ ํ•ด์ฃผ์ž. ๋นจ๊ฐ„์ƒ‰์œผ.. 2020. 7. 9.