Linux:Services: Difference between revisions
From Cheatsheet
Jump to navigationJump to search
(→Docker) |
|||
| Line 1: | Line 1: | ||
[[Category:Cheatsheet|Cheatsheets]] | [[Category:Cheatsheet|Cheatsheets]] | ||
== dhcpd == | |||
'''/etc/dhcp/dhcpd.conf''' | |||
Basic configuration file | |||
<syntaxhighlight lang="bash"> | |||
# Set the domain clients should use when resolving hostnames (equivalent to search domain) | |||
option domain-name "brammerloo.nl"; | |||
# Set the domain name servers for DHCP clients | |||
option domain-name-servers ns1.brammerloo.nl, 8.8.8.8; | |||
default-lease-time 600; | |||
max-lease-time 7200; | |||
log-facility local7; | |||
# Best practice = define any connected subnets, but don't configure DHCP for them | |||
subnet 192.168.1.0 netmask 255.255.255.0 { | |||
} | |||
# Basic DHCP for a subnet configuration | |||
subnet 192.168.0.0 netmask 255.255.255.0 { | |||
range 192.168.0.100 192.168.0.150; | |||
option routers 192.168.0.1; | |||
} | |||
</syntaxhighlight> | |||
== Docker == | == Docker == | ||
Revision as of 13:03, 20 October 2023
dhcpd
/etc/dhcp/dhcpd.conf
Basic configuration file
# Set the domain clients should use when resolving hostnames (equivalent to search domain)
option domain-name "brammerloo.nl";
# Set the domain name servers for DHCP clients
option domain-name-servers ns1.brammerloo.nl, 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
# Best practice = define any connected subnets, but don't configure DHCP for them
subnet 192.168.1.0 netmask 255.255.255.0 {
}
# Basic DHCP for a subnet configuration
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.150;
option routers 192.168.0.1;
}
Docker
Checks
# List Docker containers docker ps # List all Docker container IDs docker ps -aq # List logs for container 987sdh3qrasdhj docker logs 987sdh3qrasdhj # List RAM/CPU usage for Docker container asdlkasd67k docker stats asdlkasd67k # Show verbose container information such as commands run, network, ID, etc docker inspect oiu2398sda87
Commands
# Enter the shell inside a docker container
docker exec -ti a89sd98sa7d /bin/bash
# Execute a command inside a container as a specific user, root in this case
docker exec -it -u root asd87289hasdadz tail /var/log/nginx/access.log
docker exec -u 0 -it as892asnj2as /bin/bash
# Restart docker container yoga
docker restart yoga
# Restart the 3 given containers
docker restart 79f71c7f4d91 bbb3d3f5c3b1 b0a3204d4098
# Start this container
docker start as9823nzxc0
# Stop this container
docker stop as9823nzxc0
# Restart all unhealthy Docker containers
for i in $(docker ps | grep unhealthy | awk '{print $1}'); do docker restart "$i"; done;
PowerDNS
- https://doc.powerdns.com/authoritative/index.html
- https://doc.powerdns.com/authoritative/manpages/pdns_server.1.html
- https://doc.powerdns.com/authoritative/manpages/pdnsutil.1.html
Checks
# List commands pdns_server --help # Check config and parse for errors pdns_server --config=check
# List available commands pdnsutil --help # Check config and parse for errors pdnsutil --config=check # List all available zones pdnsutil list-all-zones # List all domains in the primary zone pdnsutil list-all-zones primary # See zone information for a specific domain pdnsutil show-zone mydomain.com pdnsutil show-zone 77.5.10.in-addr.arpa # Check zone for errors pdnsutil check-zone mydomain.com # List all created TSIG keys pdnsutil list-tsig-keys
Commands
# Activate TSIG key for domain "myexample.com" in the primary zone pdnsutil " myexample.com transfer primary
MAAS
Checks
Logs in either place: /var/log/maas/ /var/snap/maas/common/log
# List status of MAAS services maas status # List MAAS commands maas --help # List available arguments for the init command maas init --help