๋งŒ๊ฐ€์ง€ ๋™์ž‘

๋งŒ๊ฐ€์ง€์˜ ํ‚ฅ ๋™์ž‘์„ ํ•œ ๋ฒˆ์”ฉ ์—ฐ์Šตํ•œ ์‚ฌ๋žŒ์ด ๋‘๋ ค์šด ๊ฒŒ ์•„๋‹ˆ๋ผ ํ•œ๊ฐ€์ง€์˜ ๋™์ž‘์„ ๋งŒ ๋ฒˆ ์—ฐ์Šตํ•œ ์‚ฌ๋žŒ์ด ๋‘๋ ต๋‹ค - ์ด์†Œ๋ฃก (Bruce Lee)

2022-09-01 ยท 21 words

Rclone ์›๊ฒฉ ๋ฐฑ์—… ํˆด

Install $ sudo apt install rclone $ rclone --help $ rclone config n/s/q> n name> gdrive # rclone ์‚ฌ์šฉ์‹œ ์›๊ฒฉ์ง€ ๋“œ๋ผ์ด๋ธŒ ์ด๋ฆ„์œผ๋กœ ์‚ฌ์šฉ Storage> 13 # google client_id> Enter client_secret> Enter scope> 1 root_folder_id> Enter service_account_file> Enter Edit advanced config?> n Use auto config? n # ์ถœ๋ ฅ๋œ url์„ ๋ณต์‚ฌํ•˜์—ฌ ๋ธŒ๋ผ์šฐ์ €์— ์ž…๋ ฅํ•˜๊ณ  ์Šน๋ฝํ•˜๊ธฐ # ์Šน๋ฝํ•œ ํ›„ ๋ฐ›์€ key๋ฅผ ๋ณต์‚ฌ Enter verification code> key์ž…๋ ฅ Configure this as a team drive? n y) Yes this is OK (default) y q # ๋๋‚ด๊ธฐ Usage ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•: ์„ธ์„ธํ•œ ์˜ต์…˜์ด ๋งŽ์ง€๋งŒ ํ๋ฆ„์„ ์žƒ์ง€ ๋ง์ž. ํ•„์š”ํ•˜๋ฉด ๊ด€๋ จ ๋ฌธ์„œ ์ฐธ์กฐ. $ rclone ls gdrive: # list google drive files only $ rclone lsl gdrive: # list -l google drive files only $ rclone lsd gdrive: # list google drive folders $ rclone copy file1 gdrive: # copy file1 to gdrive: $ rclone copy dir1 gdrive: # copy dir1/* to gdirve: # ๋””๋ ‰ํ† ๋ฆฌ๋‚ด ํŒŒ์ผ๋ณต์‚ฌ $ rclone copy dir1 gdrive:dir1 # copy dir1 to gdirve:dir1 # dir1 ๋””๋ ‰ํ† ๋ฆฌ๋ณต์‚ฌ $ rclone delete gdrive:file1 # remove gdrive:file1 $ rclone delete gdrive:dir1 # remove gdrive:dir1 $ mkdir ~/gdrive $ rclone sync gdrive: ~/gdrive/ # sync google drive to local ~/gdrive $ rclone sync ~/gdrive gdrive: # sync ~/gdrive to google drive $ rclone sync -i ~/gdrive gdirve: # interactive mode $ rclone sync -P ~/gdrive gdirve: # view real-time transfer statistics $ rclone bisync ~/gdrive gdirve: # bidirectional sync between two paths # new, Newer, and Deleted files Mount $ rclone mount gdrive: ~/google-drive & $ ls ~/google-drive Crypt - ์•”ํ˜ธํ™” gdrive: ๋‚ด์˜ ํŠน์ • ํด๋”๋ฅผ ์•”ํ˜ธํ™”ํ•ด์„œ gdrive๋‚ด์—์„œ๋Š” ๋‚ด์šฉ์„ ๋ณผ ์ˆ˜ ์—†๊ณ  ์˜ค์ง local์—์„œ๋งŒ ๊ฐ€๋Šฅํ•˜๋‹ค. ๊ฐœ์ธ์ •๋ณด๋ฅผ ๋ณด๋‹ค ์•ˆ์ „ํ•˜๊ฒŒ ๋ณด๊ด€ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. ...

2022-08-31 ยท 618 words

Rust Install and Setup

INSTALL install - ์„ค์น˜ ํ›„ ~/.bashrc์— ~/.cargo ์ž๋™ ํ™˜๊ฒฝ ์„ค์ • $ curl https://sh.rustup.rs -sSf | sh -- --help rustup ์—…๋ฐ์ดํŠธ/ ์ œ๊ฑฐ $ rustup update $ rustup self uninstall rustc ์ปดํŒŒ์ผ๋Ÿฌ ๋ฒ„์ „ํ™•์ธ $ rustc --version Hello World $ vim hello_world.rs fn main() { #println!๋Š” ํ•จ์ˆ˜๊ฐ€ ์•„๋‹Œ ๋งคํฌ๋กœ println!("Hello, world!"); } $ rustc hello_world.rs Cargo๋ฅผ ํ†ตํ•œ ๊ฐœ๋ฐœ $ cargo new hello_cargo --bin $ cd hello_cargo $ vim src/main.rs fn main() { println!("Hello, world!"); } ./target/debug/hello_cargo ๋กœ ๋ฐ”์ด๋„ˆ๋ฆฌ ์ƒ์„ฑ $ cargo run # compile and run $ cargo run # run only: source is not changed $ cargo check # compile only no exe file create (rapid compile and test) $ cargo clean # cleanup all object and binary files $ cargo run -- --help #์‹คํ–‰ํŒŒ์ผ ์ธ์ž๋ฅผ ๋ฐ›์•„์„œ ์‹คํ–‰ํ•  ๋•Œ $ cargo build $ cargo build --release (optimize for release) ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ $ cargo add ansi_term #์ž๋™์œผ๋กœ Cargo.toml์— ๋ชจ๋“ˆ์ด๋ฆ„๊ณผ ๋ฒ„์ „์ด ๋“ฑ๋ก๋œ๋‹ค. $ vim src/main.rs #use ansi_term::xxxx ์„ ๋„ฃ๊ณ  ์ฝ”๋”ฉ $ cargo run Build From Git $ git clone someurl.com/someproject $ cd someproject $ cargo build reference ์ œ์ผ ๊ถ๊ธˆํ•œ ๊ฒƒ์€ ์ „์ฒด์ ์ธ ๊ฐœ๋ฐœ ๋ฐ ๋ฐฐํฌ ๊ณผ์ •์ธ๋ฐ ์•„๋ž˜๊ฐ€ ์•„์ฃผ ์ข‹์Œ https://free-strings.blogspot.com/2017/03/cargo-cargo.html https://rust-cli.github.io/book/tutorial/packaging.html ์•„์ฃผ ํ›Œ๋ฅญํ•œ ์ฟก๋ถ์ด๋‹ค. ๋จผ์ € ๊ธฐ๋ณธ ์˜จ๋ผ์ธ๋ถ์„ ๋ณด๊ณ ์„œ ์ด๊ฒƒ์„ ๊ณต๋ถ€ํ•˜์ž. https://rust-lang-nursery.github.io/rust-cookbook/

2022-08-31 ยท 197 words

Rust Compile์‹œ ์šฉ๋Ÿ‰ ์ค„์ด๊ธฐ

Intro debug > release ์ˆœ์œผ๋กœ ์—„์ฒญ๋‚œ ๋ฐ”์ด๋„ˆ๋ฆฌ ์‚ฌ์ด์ฆˆ๋ฅผ ์ž๋ž‘ํ•œ๋‹ค. ์šฐ์„  ๊ฐœ๋ฐœ๊ณผ ๋””๋ฒ„๊น…์„ ๋ณ‘ํ–‰ํ•œ ํ›„์— ์ตœ์ข… ๋ฆด๋ฆฌ์ฆˆ์‹œ์— ์ ์šฉํ•œ๋‹ค. ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. Howto Cargo.toml์— ๋‹ค์Œ์„ ์ถ”๊ฐ€ํ•œ๋‹ค. [profile.release] lto = true codegen-units = 1 opt-level = "z" panic = 'abort' build cargo build --release reference https://www.collabora.com/news-and-blog/blog/2020/04/28/reducing-size-rust-gstreamer-plugin/ https://github.com/johnthagen/min-sized-rust

2022-08-31 ยท 44 words

LuaJit - Lua Just in Time Compiler

last updated: {{ โ€œ1736305941โ€ | date: โ€œ%Y-%m-%d %H:%Mโ€ }} Intro ํ•จ์ˆ˜๋“ค์ด ์ฒ˜์Œ ์‹คํ–‰ ๋  ๋•Œ ํ•„์š”์— ์˜ํ•ด ์ปดํŒŒ์ผ๋œ๋‹ค. ์ด๊ฒƒ์€ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ๋น ๋ฅด๊ฒŒ ์‹œ์ž‘๋˜๋Š” ๊ฒƒ๊ณผ ๋ถˆํ•„์š”ํ•œ ์ž‘์—…์„ ๋ฐœ์ƒ์‹œํ‚ค์ง€ ์•Š๋Š” ๊ฒƒ์„ ๋ณด์žฅํ•ด ์ค€๋‹ค. LuaJit์€ neovim์— ๊ธฐ๋ณธ ํƒ‘์žฌ๋˜์–ด ์žˆ๋‹ค. python, ruby ๋“ฑ์˜ Jit๋ณด๋‹ค ์šฐ์ˆ˜ํ•œ ์„ฑ๋Šฅ์„ ๋ณด์—ฌ์ค€๋‹ค. LuaJit์˜ FFI(Foreign Function Interface)๋Š” Low-Level C์–ธ์–ด ํ•จ์ˆ˜๋“ค์„ ๋ณ„๋‹ค๋ฅธ ์ž‘์—… ์—†์ด ์ง์ ‘์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋„ค์ดํ‹ฐ๋ธŒ์— ๊ฒฌ์ค„๋งŒํผ ์†๋„๊ฐ€ ๋น ๋ฅด๊ณ , ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์ด ๋งค์šฐ ์ ๋‹ค. nginx์— LuaJIT์„ ํฌํ•จ์‹œ์ผœ์„œ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•์„ ํ•œ OpenResty ์›น ์„œ๋ฒ„๋„ ์žˆ๋‹ค. ...

2022-08-30 ยท 446 words