-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
49 lines (36 loc) · 1.08 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@default:
just --list
# Runs cargo clippy
check:
cargo clippy --all-targets -- -A clippy::module_inception -A clippy::new_ret_no_self -A clippy::zero_ptr -A clippy::new_without_default
# Watch docs
watch-docs:
cargo watch --features networking -x 'doc --no-deps --document-private-items --open'
# Setup network interface
setup-interface interface:
sudo iptables -A INPUT -i {{interface}} -j ACCEPT
sudo iptables -A OUTPUT -o {{interface}} -j ACCEPT
sudo ip addr add 192.168.69.100/24 dev {{interface}}
# ping
ping interface:
ping -I {{interface}} 192.168.69.1
# arping
arping interface:
sudo arping -I {{interface}} 192.168.69.1
# Socat listener
socat-listen:
socat TCP-LISTEN:7777 STDOUT
# Run cargo examples
example ex:
DEFMT_LOG=debug cargo run --example {{ex}}
# Print output of Rust macro
expand-macro ex:
cargo expand --example {{ex}}
# List all examples
list-examples:
#!/usr/bin/env python3
import os
import glob
examples = glob.glob("examples/*.rs")
for i, example in enumerate(examples, start=1):
print(f"{i}: {os.path.basename(example)}")