본문 바로가기

전체 글293

[Kali] Kali 설치 - USB 8GB ==> 4GB 등 용량이 부족한 디스크로 하면 설치하다가 에러날 수 있다. 1) Kali 공식 홈페이지에서 iso 다운로드 ==> Installer Images. recommended 버전으로 다운로드 ==> https://www.kali.org/get-kali/#kali-installer-images Get Kali | Kali Linux Home of Kali Linux, an Advanced Penetration Testing Linux distribution used for Penetration Testing, Ethical Hacking and network security assessments. www.kali.org 2) Rufus 프로그램 설치 및 부팅 USB 제작 ==>.. 2023. 2. 27.
[Rust] Scraping : Naver 메인 페이지 예제 (60일차) # Cargo.toml # ... 중략 [dependencies] reqwest = { version = "0.11.14", features = ["blocking"] } scraper = "0.14.0" // src\main.rs use reqwest::blocking::Client; use scraper::{Html, Selector}; fn main() -> Result { // Create an HTTP client let client = Client::new(); // Make a GET request to the homepage of www.naver.com let res = client.get("https://www.naver.com").send()?; // Extract the HTML r.. 2023. 2. 20.
[Rust] Scraping 예제 (59일차) // cargo add select use select::document::Document; use select::predicate::Name; fn main() { let html = "Hello, world!"; let document = Document::from(html); let h1 = document.find(Name("h1")).next().unwrap(); println!("{}", h1.text()); } // cargo add scraper use scraper::{Html, Selector}; fn main() { let html = "Hello, World!"; let document = Html::parse_document(html); let selector = Selector:.. 2023. 2. 19.
[Rust] Variable : Python 코드 비교 예제 (58일차) [Python] if __name__ == '__main__': x = 1; print(x); # bind x again shadows old one from above x = 'i'; print(x) # declare, init something = None; x = 5; print("x, something", x, something); something = x * 5; print("x, something", x, something); # mutability y = 0; y = y * 2 + x; print(y); BLAH = 42; # only const by convention y *= BLAH; [Rust] fn main() { let x = 1; println!("x: {}", x); // bi.. 2023. 2. 18.
[HTML] HREF 란? - HREF : Hypertext REFerence 의 줄임말 - Anchor 태그 속성 - HREF 는 2가지 요소를 가짐 1) URL : 실제 Link 2) Page에 보이는 클릭 가능한 Text : Anchor 태그라고 불리는 ++ HyperText 란? - 단어, 구문(phase), Text 덩어리를 일컫음. - Textual 혹은 Graphical 한 Hyperlink를 통칭 - HyperText가 없으면 다른 Link와 연결이 불가능(원색적인 의미에서 Web 탐색 불가) - Web 페이지는 HyperText Markup Language(HTML)을 통해 상호 참조-연결을 함. ++ HyperLink 란? - 각기 다른 문서의 어떤 부분을 연결하는 HTML 문서 element. - Source를.. 2023. 2. 16.
[Rust] Web Spider 예제 (57일차) # Cargo.toml # ... 중략 [dependencies] spider = "1.18.9" tokio = { version = "1.25.0", features = ["full"] } // src/main.rs extern crate spider; use spider::website::Website; use spider::tokio; #[tokio::main] async fn main() { let url = "https://choosealicense.com"; let mut website: Website = Website::new(&url); website.crawl().await; for page in website.get_pages() { println!("- {}", page.get_url.. 2023. 2. 12.
[Rust] 실시간 Chat App in Rocket (56일차) # root폴더/Cargo.toml [package] name = "chat-app" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] rocket = { version = "0.5.0-rc.1", features = ["json"] } [dev-dependecies] rand = "0.8" // root폴더/src/main.rs #[macro_use] extern crate rocket; #[cfg(test)] mod tests; use rocket::{tokio::sync::broadcast.. 2023. 2. 9.
[Rust] Web Crawler 예제 (55일차) ==> HTTP Request 생성 # Cargo.toml # ...중략 [dependencies] reqwest = { version = "0.11", features = ["json", "blocking"] }# Request with JSON parsing support futures = "0.3"# for our async / await blocks tokio = { version = "1.12.0", features = {"full"} } # for our async runtime // src/main.rs use std::io::Read; fn main() { let client = reqwest::blocking::Client::new(); let origin_url = "https://ro.. 2023. 2. 8.