This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note that this script is executed using powershell | |
# The limitation of this is that we can only use 1 instance of Obsidian on 1 machine at the time. Otherwise, there could be confliction and would requires manually resolved. | |
git pull | |
Start-Process "C:\Program Files\Obsidian\Obsidian.exe" -Wait | |
git add . | |
git commit -m "auto commit by system" | |
git push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-Starship-PreCommand { | |
$loc = $executionContext.SessionState.Path.CurrentLocation; | |
$prompt = "$([char]27)]9;12$([char]7)" | |
if ($loc.Provider.Name -eq "FileSystem") | |
{ | |
$prompt += "$([char]27)]9;9;`"$($loc.ProviderPath)`"$([char]27)\" | |
} | |
$host.ui.Write($prompt) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo su | |
sudo apt-get update -y && sudo apt-get upgrade -y | |
sudo apt-get install neovim -y | |
sudo apt-get install wireguard-tools -y | |
cd /etc/wireguard | |
touch wg0.conf | |
wg genkey > privatekey | |
wg pubkey < privatekey > publickey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Luv Cún!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async fn main() -> anyhow::Result<()> { | |
let http_client = build_http_client()?; | |
//we are searching for the word "access" here. | |
let html = http_client | |
.get("http://tratu.coviet.vn/hoc-tieng-anh/tu-dien/lac-viet/A-V/access.html") | |
.send() | |
.await? | |
.text_with_charset("utf-8") | |
.await?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[tokio::main] | |
async fn main() -> anyhow::Result<()> { | |
let http_client = build_http_client()?; | |
//we are searching for the word "access" here. | |
let html = http_client.get("http://tratu.coviet.vn/hoc-tieng-anh/tu-dien/lac-viet/A-V/access.html") | |
.send().await? | |
.text_with_charset("utf-8").await?; | |
dbg!(html); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[tokio::main] | |
async fn main() -> anyhow::Result<()> { | |
let http_client = build_http_client()?; | |
// Note that the code is incomplete here | |
Ok(()) | |
} | |
fn build_http_client() -> reqwest::Result<reqwest::Client> { | |
let client_builder = reqwest::ClientBuilder::new().gzip(true); | |
let client = client_builder.build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "crawler" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
tl = "0.7.7" | |
reqwest = { version = "0.11.18", features = ["gzip"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "crawler" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
tl = "0.7.7" | |
reqwest = { version = "0.11.18", features = ["gzip"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Program.cs file |
NewerOlder