Skip to content

Commit 4836c08

Browse files
committed
some updates
1 parent bbf3c52 commit 4836c08

36 files changed

+1215
-45
lines changed

_sources/misc/mynet/switches.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Old juniper 48 port switch.
6161
+-------------+-----------+-------------+----------+
6262
| ge-0/0/26 | | | |
6363
+-------------+-----------+-------------+----------+
64-
| ge-0/0/27 | | | |
64+
| ge-0/0/27 | pine64so | blue | |
6565
+-------------+-----------+-------------+----------+
6666
| ge-0/0/28 | | | |
6767
+-------------+-----------+-------------+----------+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=====
2+
disks
3+
=====
4+
5+
identify a disk by uuid
6+
^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
There are symlinks from `/dev/disk/by-uuid` to the disk itself to help identify them.
9+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
=========
2+
firewalld
3+
=========
4+
5+
List active ports
6+
^^^^^^^^^^^^^^^^^
7+
8+
.. code-block:: console
9+
10+
firewall-cmd --list-ports
11+
12+
Get active zones
13+
^^^^^^^^^^^^^^^^
14+
15+
.. code-block:: console
16+
17+
firewall-cmd --get-active-zones
18+
19+
Open a port
20+
^^^^^^^^^^^
21+
22+
.. code-block:: console
23+
24+
firewall-cmd --permanent --zone=public --add-port=80/tcp
25+
26+
Close a port
27+
^^^^^^^^^^^^
28+
29+
.. code-block:: console
30+
31+
firewall-cmd --remove-port=
32+
33+
Enable the change
34+
^^^^^^^^^^^^^^^^^
35+
36+
.. code-block:: console
37+
38+
firewall-cmd --reload
39+
40+
Make sure the change is in effect
41+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42+
43+
.. code-block:: console
44+
45+
firewall-cmd --zone=public --query-port=80/tcp
46+
47+
Reject connections to a port
48+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49+
50+
.. code-block:: console
51+
52+
# Simply reject all traffic to 443
53+
firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" port protocol="tcp" port="443" reject'
54+
55+
# add a src ip into the mix
56+
firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" source address="10.0.0.2" port protocol="tcp" port="443" reject'
57+
58+
Forward traffic from a specific address to another port
59+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60+
61+
.. code-block:: console
62+
63+
firewall-cmd --permanent --add-forward-port=514:proto=udp:toport=8000:toaddr=10.10.10.11
64+
firewall-cmd --add-masquerade ## I guess this is necessary?
65+
firewall-cmd --reload
66+
67+
remove a traffic forwarding rule
68+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69+
70+
.. code-block:: console
71+
72+
firewall-cmd --permanent --remove-forward-port=514:proto=udp:toport=8000:toaddr=10.10.10.11
73+

_sources/operating_systems/linux/firewalls/index.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Contents:
88
.. toctree::
99
:maxdepth: 2
1010

11-
firewalld/index
12-
iptables/index
13-
nft/index
14-
ufw/index
11+
firewalld
12+
iptables
13+
nft
14+
ufw
1515

1616

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
========
2+
iptables
3+
========
4+
5+
Save the current iptables ruleset
6+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
.. note::
9+
10+
I've done this on an appliancized Debian 8.4.
11+
No clue where else it may work.
12+
13+
This saves the currently running ruleset to a file that can then be modified,
14+
and loaded as below.
15+
16+
.. code-block:: console
17+
18+
iptables-save > FILE
19+
20+
Load a ruleset
21+
^^^^^^^^^^^^^^
22+
23+
.. code-block:: console
24+
25+
iptables-restore FILE
26+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
===
2+
nft
3+
===
4+
5+
oh god it gets worse
6+
7+
In `nft` there are tables, chains, and rules (and probably other stuff, fml).
8+
Each piece can be operated on.
9+
10+
list all rules
11+
^^^^^^^^^^^^^^
12+
13+
I think this lists everything.
14+
15+
.. code-block:: console
16+
17+
nft list ruleset
18+
19+
list rules in a table
20+
^^^^^^^^^^^^^^^^^^^^^
21+
22+
.. code-block:: console
23+
24+
nft list table firewalld
25+
26+
Unless there is an address family.
27+
There can be a `firewalld` table for each address family.
28+
Address families include (but are not limited to) ip (ipv4), ip6 (ipv6), inet (ipv4 and ipv6), etc.
29+
30+
.. code-block:: console
31+
32+
nft list table inet firewalld
33+
34+
list rules in a chain
35+
^^^^^^^^^^^^^^^^^^^^^
36+
37+
.. code-block:: console
38+
39+
nft --handle list chain inet firewalld filter_FWDO_FedoraServer
40+
41+
deleting rules
42+
^^^^^^^^^^^^^^
43+
44+
Deleting rules requires a handle as well as the table, chain, and possibly address family.
45+
The handle is a number for the rule, starting from 0.
46+
This seems to start from the beginning of the ruleset (I think).
47+
Don't count though, there's a command to get the handles.
48+
I think the `--handle` should just be default.
49+
50+
Get the handle:
51+
52+
.. code-block:: console
53+
54+
nft --handle list table inet firewalld
55+
56+
Delete the rule:
57+
58+
.. code-block:: console
59+
60+
nft delete rule inet firewalld filter_IN_FedoraServer_allow handle 65
61+
62+
Links
63+
^^^^^
64+
65+
Of course the `Arch Wiki <https://wiki.archlinux.org/index.php/nftables>`_ has useful information on `nft`.
66+
67+
The nft wiki `Simple Rule Management <https://wiki.nftables.org/wiki-nftables/index.php/Simple_rule_management>`_ page is anything but simple.
68+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
===
2+
ufw
3+
===
4+
5+
So I know where to find this info later when I have to look it up.
6+
Again.
7+
8+
9+
Basic stuff:
10+
^^^^^^^^^^^^
11+
12+
From the man page.
13+
14+
.. code-block:: console
15+
16+
ufw allow in on eth0 from 192.168.0.0/16
17+
ufw allow out on eth1 to 10.0.0.0/8
18+
ufw route allow in on eth0 out on eth1 to 10.0.0.0/8 from 192.168.0.0/16
19+
ufw limit 2222/tcp comment 'SSH port'
20+
21+
Note form the man page:
22+
^^^^^^^^^^^^^^^^^^^^^^^
23+
.. code-block:: console
24+
25+
ufw allow 8080/tcp
26+
ufw allow proto tcp from 192.168.17.11 to 192.168.17.8 port 8080
27+
28+
29+
On ubuntu 14.04 rules are saved in:
30+
31+
.. code-block:: console
32+
33+
/etc/ufw # system rules
34+
/lib/ufw # user rules
35+

_sources/operating_systems/linux/systemd/systemctl.rst.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
systemctl
33
=========
44

5+
show enabled but not running services
6+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
`failed` is probably the state I'm really curious about.
9+
10+
```
11+
systemctl list-units -all --state=inactive
12+
systemctl list-units -all --state=failed
13+
```
14+
515
systemctl enable SOMETHING.something: "Failed to execute operation: No such file or directory"
616
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
717

_sources/ssl/ca_certs.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ tab delimited
3535
5. filename or unknown
3636
6. Certificate distinguished name
3737

38+
update the db
39+
^^^^^^^^^^^^^
40+
41+
This will expire certs and stuff.
42+
43+
.. code-bock:: console
44+
45+
openssl ca -updatedb -config ./intermediateCA-openssl.cnf
46+

_sources/tools/git/git.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
===
2+
git
3+
===
4+
5+
see all of the changes to a single file
6+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
8+
```
9+
git log --follow --patch -- FILENAME
10+
```
11+

0 commit comments

Comments
 (0)