diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-01-13 13:16:06 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-01-13 13:16:06 +0100 |
commit | 9232b8d817d4cd4122947375156fa2fa1e9fba14 (patch) | |
tree | e4feb77f2e508f008b78f722e91488bb9a3f3806 /3 resources/linux | |
parent | ed0753ad224f0c65133bd7a63180257eecd9f5e3 (diff) |
vault backup: 2025-01-13 13:16:06
Diffstat (limited to '3 resources/linux')
23 files changed, 63 insertions, 23 deletions
diff --git a/3 resources/linux/APT.md b/3 resources/linux/APT.md new file mode 100644 index 0000000..9231d40 --- /dev/null +++ b/3 resources/linux/APT.md @@ -0,0 +1,5 @@ +#linux #packages #how-to + +--- +reinstall packages: +`apt reinstall <pkg>`
\ No newline at end of file diff --git a/3 resources/linux/Definitions.md b/3 resources/linux/Definitions.md new file mode 100644 index 0000000..c0ca4dd --- /dev/null +++ b/3 resources/linux/Definitions.md @@ -0,0 +1,6 @@ +#linux #definitions + +--- +NBP = Network Bootstrap Program +PXE = Preboot Execution Environment +NIC = Network Interface Card
\ No newline at end of file diff --git a/3 resources/linux/device-drivers.md b/3 resources/linux/Device drivers.md index e4fe9d2..95f1a75 100644 --- a/3 resources/linux/device-drivers.md +++ b/3 resources/linux/Device drivers.md @@ -1,3 +1,6 @@ +#linux #devices + +--- major, minor numbers major = driver (used by kernel when opening device to dispatch to correct driver) minor = used by driver to differentiate device(s) diff --git a/3 resources/linux/device-mapper.md b/3 resources/linux/Device mapper.md index f862496..059a0d1 100644 --- a/3 resources/linux/device-mapper.md +++ b/3 resources/linux/Device mapper.md @@ -1,7 +1,10 @@ +#linux #device-mapper + +--- Device mapper is a kernel driver to map physical block devices to virtual ones; this means that for example we can have many physical devices be represented by a single virtual one (linear mapping). How does it work? -[[TODO]] +[[1 projects/Inwerken Mohammed/TODO]] What is its function in relation to multipath? Logical devices using device-mapper can be managed using `man 8 dmsetup` diff --git a/3 resources/linux/lsof.md b/3 resources/linux/LSOF.md index e95b968..5a3aa95 100644 --- a/3 resources/linux/lsof.md +++ b/3 resources/linux/LSOF.md @@ -1,3 +1,7 @@ +#linux #how-to + +--- + ``` lsof -p 1111 # show open files for this PID lsof /path/to/file # show which process has this open diff --git a/3 resources/linux/Users.md b/3 resources/linux/Users.md new file mode 100644 index 0000000..885a7cc --- /dev/null +++ b/3 resources/linux/Users.md @@ -0,0 +1,22 @@ +#linux #user-management + +Change uid/gid of user +`usermod -u newnumber user` +`groupmod -g newnumber user` + +File permissions in homedir will be automatically updated; file perms outside home dir will not be automatically updated. + +Finding files of a specific user, and printing their uid/gid; +`sudo find / -user 4109 -printf '%p %u(%U) %g(%G)\n'` + +To change only the group: `chgrp`. + +Or using find to chmod/chgrp: +`sudo find / -user 4109 -group 4109 -exec chmod 998:998 {} \;` +`sudo find / -group 4109 -exec chgrp 998 {} \;` + +Dirty way to find "system users" (uid < 999) - note that this is not fool-proof, it also lists groups +`getent passwd | grep -oP '\b[0-9]{3}\b' | uniq | sort` + +--- +https://www.cyberciti.biz/faq/linux-change-user-group-uid-gid-for-all-owned-files/ diff --git a/3 resources/linux/Watch.md b/3 resources/linux/Watch.md index dafeb80..0c167b7 100644 --- a/3 resources/linux/Watch.md +++ b/3 resources/linux/Watch.md @@ -1 +1,4 @@ -`watch (1)` periodically executes the executable on argv. It can be used to reload the output of a command, like `sudo watch ovs-dpctl dump-flows` .
\ No newline at end of file +#linux #how-to + +--- +`watch (1)` periodically executes the executable on argv. It can be used to reload the output of a command, like `sudo watch ovs-dpctl dump-flows` . diff --git a/3 resources/linux/apt.md b/3 resources/linux/apt.md deleted file mode 100644 index 36a098c..0000000 --- a/3 resources/linux/apt.md +++ /dev/null @@ -1,2 +0,0 @@ -reinstall packages: -`apt reinstall <pkg>`
\ No newline at end of file diff --git a/3 resources/linux/bootloader.md b/3 resources/linux/bootloader.md deleted file mode 100644 index e9c2fff..0000000 --- a/3 resources/linux/bootloader.md +++ /dev/null @@ -1 +0,0 @@ -[[TODO]]
\ No newline at end of file diff --git a/3 resources/linux/filesystems/tmpfs.md b/3 resources/linux/filesystems/Tmpfs.md index 624c835..b8fe839 100644 --- a/3 resources/linux/filesystems/tmpfs.md +++ b/3 resources/linux/filesystems/Tmpfs.md @@ -1,3 +1,6 @@ +#linux #filesystem + +--- Is a [[virtual filesystem]] that is stored in memory; it uses both RAM and swap space. > Kernel option: CONFIG_TMPFS diff --git a/3 resources/linux/filesystems/virtual filesystem.md b/3 resources/linux/filesystems/virtual filesystem.md deleted file mode 100644 index e69de29..0000000 --- a/3 resources/linux/filesystems/virtual filesystem.md +++ /dev/null diff --git a/3 resources/linux/glibc.md b/3 resources/linux/glibc.md deleted file mode 100644 index 18d18e1..0000000 --- a/3 resources/linux/glibc.md +++ /dev/null @@ -1 +0,0 @@ -The GNU C standard library.
\ No newline at end of file diff --git a/3 resources/linux/man pages.md b/3 resources/linux/man pages.md deleted file mode 100644 index 576d4b8..0000000 --- a/3 resources/linux/man pages.md +++ /dev/null @@ -1,2 +0,0 @@ -I need to more consistently read man pages. Example is `man task` to see how taskwarrior works, after reading it today I found that it is actually quite easy. -They often contain good information on how to use a certain tool.
\ No newline at end of file diff --git a/3 resources/linux/networking/DHCP.md b/3 resources/linux/networking/DHCP.md new file mode 100644 index 0000000..e7e8e38 --- /dev/null +++ b/3 resources/linux/networking/DHCP.md @@ -0,0 +1,5 @@ +#networking #linux + +--- +Dynamic Host Configuration Protocol +Allows hosts dynamically receive an IP address.
\ No newline at end of file diff --git a/3 resources/linux/networking/ip-masquerade-nat.md b/3 resources/linux/networking/IP masquerade.md index 8b722f4..2ccc8e6 100644 --- a/3 resources/linux/networking/ip-masquerade-nat.md +++ b/3 resources/linux/networking/IP masquerade.md @@ -1,3 +1,6 @@ +#linux #networking + +--- A function in the kernel that allows guests with internal/private IPs to access the internet by using the hosts' public IP similar to 1 to many NAT. Differences with Proxy, IP Masq, NAT: diff --git a/3 resources/linux/networking/pxe-boot.md b/3 resources/linux/networking/PXE.md index d532ac3..d5fe4d1 100644 --- a/3 resources/linux/networking/pxe-boot.md +++ b/3 resources/linux/networking/PXE.md @@ -1,4 +1,7 @@ -PXE = Preboot Execution Environment. +#linux #pxe + +--- +The NBP is a bootloader that is obtained via the network typically via [[TFTP]]. It handles setting up an environment in which an OS can run or install. For example, it displays a boot menu and downloads the kernel images. It sets up hardware, for example the [[NIC]]s. PXE boot process: 1. Modified [[DHCP]] request: request to include boot information (PXE boot request). diff --git a/3 resources/linux/networking/dhcp.md b/3 resources/linux/networking/dhcp.md deleted file mode 100644 index e426d6f..0000000 --- a/3 resources/linux/networking/dhcp.md +++ /dev/null @@ -1,4 +0,0 @@ -Dynamic Host Configuration Protocol -Allows hosts dynamically receive an IP address. - -[[TODO]] learn exactly how it works
\ No newline at end of file diff --git a/3 resources/linux/networking/nbp.md b/3 resources/linux/networking/nbp.md deleted file mode 100644 index 19676ea..0000000 --- a/3 resources/linux/networking/nbp.md +++ /dev/null @@ -1,3 +0,0 @@ -Network Bootstrap Program - -Is a bootloader that is obtained via the network typically via [[TFTP]]. It handles setting up an environment in which an OS can run or install. For example, it displays a boot menu and downloads the kernel images. It sets up hardware, for example the [[NIC]]s.
\ No newline at end of file diff --git a/3 resources/linux/networking/udp.md b/3 resources/linux/networking/udp.md deleted file mode 100644 index e69de29..0000000 --- a/3 resources/linux/networking/udp.md +++ /dev/null diff --git a/3 resources/linux/nic.md b/3 resources/linux/nic.md deleted file mode 100644 index 592ad1c..0000000 --- a/3 resources/linux/nic.md +++ /dev/null @@ -1 +0,0 @@ -Network Interface Card
\ No newline at end of file diff --git a/3 resources/linux/shared anonymous memory mappings.md b/3 resources/linux/shared anonymous memory mappings.md deleted file mode 100644 index 71d1cfc..0000000 --- a/3 resources/linux/shared anonymous memory mappings.md +++ /dev/null @@ -1,2 +0,0 @@ -[[TODO]] -Linux API book: chapter 49
\ No newline at end of file diff --git a/3 resources/linux/system v shared memory.md b/3 resources/linux/system v shared memory.md deleted file mode 100644 index d1f690d..0000000 --- a/3 resources/linux/system v shared memory.md +++ /dev/null @@ -1,2 +0,0 @@ -[[TODO]] -Linux API book chapter 48
\ No newline at end of file diff --git a/3 resources/linux/tftp.md b/3 resources/linux/tftp.md deleted file mode 100644 index 259fdec..0000000 --- a/3 resources/linux/tftp.md +++ /dev/null @@ -1,2 +0,0 @@ -Trivial File Transfer Protocol -[[TODO]]
\ No newline at end of file |