Skip to content

Commit e80f8b1

Browse files
committed
Update rust, linux date and arch maintenance notes
1 parent 2d4eb1d commit e80f8b1

File tree

4 files changed

+58
-3
lines changed

4 files changed

+58
-3
lines changed

notes/language/rust/cargo.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,29 @@ cargo OPTIONS COMMAND
2121
| `test` | Run the tests. |
2222
| `update` | Update dependencies in the `Cargo.lock` file. |
2323

24+
Creating new rust project:
25+
2426
```shell
2527
cargo new myproject
26-
cd myproject
28+
```
29+
30+
Add new dependency and feature:
31+
32+
```shell
2733
cargo add iced
28-
# Create your script...
34+
cargo add bevy -F wayland
35+
```
36+
37+
Build and run for development:
38+
39+
```shell
2940
cargo run
3041
```
3142

32-
More details on `cargo update` and `Cargo.toml`
43+
:::tip
44+
More details on how `cargo update` and `Cargo.toml` works
3345
[here](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html).
46+
:::
3447

3548
### Release builds
3649

notes/language/rust/crates/std.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ is useful to write lines to the file
7373
```rust
7474
use std::fs;
7575
use std::io::prelude::*;
76+
use std::io::BufReader;
7677

7778
let path = "config";
7879

notes/tool/linux/arch/maintenance.md

+18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ title: Maintenance
33
ref: https://wiki.archlinux.org/title/System_maintenance
44
---
55

6+
## Downgrade package
7+
8+
[Arch Wiki reference](https://wiki.archlinux.org/title/Downgrading_packages)
9+
10+
Check the latest updates in `/var/log/pacman.log`.
11+
To downgrade a package, run (example of `svt-av1`):
12+
13+
```shell
14+
sudo pacman -U file:///var/cache/pacman/pkg/svt-av1-2.2.1-1-x86_64.pkg.tar.zst
15+
```
16+
17+
Then to prevent upgrade of that package,
18+
edit `/etc/pacman.conf`:
19+
20+
```txt
21+
IgnorePkg = svt-av1
22+
```
23+
624
## System cleanup
725

826
Every week, delete all cached versions of installed and uninstalled packages,

notes/tool/linux/package/date.md

+23
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,32 @@ title: Date
44

55
## Usage
66

7+
```shell
8+
date OPTIONS FORMAT
9+
```
10+
11+
| Option | Description |
12+
| -- | -- |
13+
| `-d` `--date` | Use specified date instead of now. |
14+
15+
## Examples
16+
17+
Get formatted current time:
18+
719
```shell
820
date # Wed 20 May 2020 01:17:13 PM JST
921
date '+%Y-%m-%d %H:%M:%S' # 2020-05-20 13:18:19
22+
```
23+
24+
Specify date relative to now:
25+
26+
```shell
1027
date -d '+1 year'
1128
date -d '1 year ago'
1229
```
30+
31+
Specify date using a timestamp:
32+
33+
```shell
34+
date -d @1735976522
35+
```

0 commit comments

Comments
 (0)