Skip to content

Commit

Permalink
Update rust, linux date and arch maintenance notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yutsuten committed Jan 5, 2025
1 parent 2d4eb1d commit e80f8b1
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
19 changes: 16 additions & 3 deletions notes/language/rust/cargo.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,29 @@ cargo OPTIONS COMMAND
| `test` | Run the tests. |
| `update` | Update dependencies in the `Cargo.lock` file. |

Creating new rust project:

```shell
cargo new myproject
cd myproject
```

Add new dependency and feature:

```shell
cargo add iced
# Create your script...
cargo add bevy -F wayland
```

Build and run for development:

```shell
cargo run
```

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

### Release builds

Expand Down
1 change: 1 addition & 0 deletions notes/language/rust/crates/std.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ is useful to write lines to the file
```rust
use std::fs;
use std::io::prelude::*;
use std::io::BufReader;

let path = "config";

Expand Down
18 changes: 18 additions & 0 deletions notes/tool/linux/arch/maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ title: Maintenance
ref: https://wiki.archlinux.org/title/System_maintenance
---

## Downgrade package

[Arch Wiki reference](https://wiki.archlinux.org/title/Downgrading_packages)

Check the latest updates in `/var/log/pacman.log`.
To downgrade a package, run (example of `svt-av1`):

```shell
sudo pacman -U file:///var/cache/pacman/pkg/svt-av1-2.2.1-1-x86_64.pkg.tar.zst
```

Then to prevent upgrade of that package,
edit `/etc/pacman.conf`:

```txt
IgnorePkg = svt-av1
```

## System cleanup

Every week, delete all cached versions of installed and uninstalled packages,
Expand Down
23 changes: 23 additions & 0 deletions notes/tool/linux/package/date.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,32 @@ title: Date

## Usage

```shell
date OPTIONS FORMAT
```

| Option | Description |
| -- | -- |
| `-d` `--date` | Use specified date instead of now. |

## Examples

Get formatted current time:

```shell
date # Wed 20 May 2020 01:17:13 PM JST
date '+%Y-%m-%d %H:%M:%S' # 2020-05-20 13:18:19
```

Specify date relative to now:

```shell
date -d '+1 year'
date -d '1 year ago'
```

Specify date using a timestamp:

```shell
date -d @1735976522
```

0 comments on commit e80f8b1

Please sign in to comment.