Hi๐Ÿ‘‹๐Ÿผ Iโ€™m HAHWUL.

Offensive Security Engineer, Rubyist/Crystalist/Gopher and H4cker

Posts - Page 41 of 86

Rails App ์‹œ์ž‘ ์‹œ ํŠน์ • ์ฝ”๋“œ ์‹คํ–‰ํ•˜๊ธฐ(How to startup code on Ruby on Rails with initialize)

  • 1 min read

Rails ์•ฑ ๊ตฌ๋™ ์‹œ ํŠน์ • ์ž‘์—…์ด๋‚˜ ๋กœ์ง์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์–ด๋–ป๊ฒŒ ํ• ๊นŒ? ๊ณ ๋ฏผ์„ ์˜ˆ์ „์— ํ–ˆ์—ˆ๋Š”๋ฐ, ๊ทธ๋•Œ initialize๋กœ ํ•ด๊ฒฐํ–ˆ๋˜ ๊ธฐ์–ต์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ„๋งŒ์— ๋™์ผํ•œ ๊ณ ๋ฏผ์„ ์ž ๊นํ•˜๊ฒŒ ๋ฌ์—ˆ๋Š”๋ฐ, ๊ฒธ์‚ฌ๊ฒธ์‚ฌ ๊ธ€๋กœ ์ •๋ฆฌํ•ด๋‘ก๋‹ˆ๋‹ค.

Read More

Rails crono๋ฅผ ์ด์šฉํ•˜์—ฌ ์Šค์ผ€์ค„๋งํ•˜๊ธฐ(Scheduling with crono on Rails)

  • 2 min read

๋ณดํ†ต ์œ ๋‹‰์Šค ๊ธฐ๋ฐ˜ PC์—์„  ์Šค์ผ€์ค„๋ง์„ ์œ„ํ•ด crontab ๋˜๋Š” at๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , ์œˆ๋„์šฐ์—์„  ์„œ๋น„์Šค์— ๋“ฑ๋กํ•˜๋Š”์‹์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ์œ„ํ•ด์„  ์‹œ์Šคํ…œ์—์„œ crontab ๊ฐ™์€ ๋„๊ตฌ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•ด์•ผํ•˜๋ฉฐ, PaaS ์ด์ƒ์˜ ์ถ”์ƒํ™”๊ฐ€ ์ด๋ฃจ์–ด์ง„ ํ”Œ๋žซํผ์—์„  ์‚ฌ์šฉํ•˜๊ธฐ ์–ด๋ ค์šด ๊ฒฝ์šฐ๊ฐ€ ๋Œ€๋‹ค์ˆ˜์ž…๋‹ˆ๋‹ค.

Read More

Rails์—์„œ kaminari๋ฅผ ์ด์šฉํ•˜์—ฌ Pagination ๊ตฌํ˜„ํ•˜๊ธฐ(How to make pagination on rails(with kaminari)

  • 1 min read

Rails์—์„œ ํŽ˜์ด์ง€(Pagination)๋ฅผ ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” kaminari, will_paginate ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ์ค‘์—์„œ ์˜ค๋Š˜์€ kaminari๋ฅผ ๊ฐ€์ง€๊ณ  ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“œ๋Š” ๋‚ด์šฉ์œผ๋กœ ๊ธ€ ์ž‘์„ฑํ•ด๋ด…๋‹ˆ๋‹ค.

Read More

๋ฃจ๋น„์—์„œ string-similarity๋กœ ๋ฌธ์ž์—ด ํผ์„ผํŠธ๋กœ ๋น„๊ตํ•˜๊ธฐ(Comparing string-similarity percent in Ruby)

  • ~1 min read

ํ•œ ๋‘๋‹ฌ? ์ •๋„์ „์— ๋ฃจ๋น„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ค‘์— ๊ดœ์ฐฎ์€๊ฑฐ ํ•˜๋‚˜ ๋ด๋‘”๊ฒŒ ์žˆ์—ˆ๋Š๋ฐ, ์ด์ œ์„œ์•ผ ๊ธ€๋กœ ์ž‘์„ฑํ•˜๋„ค์š”. ๋ฌธ์ž์—ด ๋น„๊ต ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ธ๋ฐ, ๋งค์นญ๋ฅ ์„ ํผ์„ผํŠธ๋กœ ๋ฝ‘์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ™œ์šฉ์ฒ˜๊ฐ€ ๋งŽ์„๋“ฏํ•˜์—ฌ ๋ฉ”๋ชจํ•ด๋‘ก๋‹ˆ๋‹ค.

Read More

How to protect iframe XSS&XFS using sandbox attribute(+CSP)

  • 1 min read

iframe์—๋Š” sandbox๋ผ๋Š” ์†์„ฑ์ด ํ•˜๋‚˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” iframe ์‚ฌ์šฉ์— ์žˆ์–ด์„œ ์ข€ ๋” ์•ˆ์ „ํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ณด์กฐํ•ด์ฃผ๋Š” ์ •์ฑ…์ธ๋ฐ์š”, CSP์™€ ํ•จ๊ป˜ ์ž˜ ์‚ฌ์šฉ๋œ๋‹ค๋ฉด ๊ต‰์žฅํžˆ ํŠผํŠผํ•œ iframe ์ •์ฑ…์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ์–ด์ง‘๋‹ˆ๋‹ค.

Read More