Skip to content

Commit 551188e

Browse files
committed
Add some TILs
1 parent 725c07d commit 551188e

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
category: Bash
3+
title: Change a file last update date
4+
---
5+
It can be useful to change a file last update date, which can be done with `touch`:
6+
7+
```bash
8+
# To set a date in the past
9+
touch -d "10 minutes ago" ./example.txt
10+
11+
# To set it to now
12+
touch ./example.txt
13+
```
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
category: Tips
2+
category: Bash
33
title: Find a machine's IP public address
44
sources:
55
- https://ifconfig.me
66
---
77
For this we can use `curl`:
8+
89
```bash
910
curl ifconfig.me/ip
1011
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
category: Bash
3+
title: Generate random passwords
4+
sources:
5+
- https://github.com/tytso/pwgen
6+
- https://doc.ubuntu-fr.org/pwgen
7+
---
8+
The `pwgen` command can be used to generate random passwords.
9+
10+
Here's a breakdown of options:
11+
```bash
12+
pwgen -s -c -y -1 30 5
13+
│ │ │ │ │ │
14+
│ │ │ │ │ └─── Generate 5 passwords
15+
│ │ │ │ │
16+
│ │ │ │ └─── Each password is 30 characters long
17+
│ │ │ │
18+
│ │ │ └─── Print one password per line
19+
│ │ │
20+
│ │ └─── Include at least one special character
21+
│ │
22+
│ └─── Include at least one capital letter
23+
24+
└─── Generate secure, completely random passwords
25+
```

0 commit comments

Comments
 (0)