cleanup
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
---
|
||||
title: "keyboard"
|
||||
tags: [ "Documentation", "basics" ]
|
||||
---
|
||||
# Set Layout
|
||||
|
||||
Set layout to British English.
|
||||
|
||||
> setxkbmap -layout gb
|
||||
|
||||
Or Polish with:
|
||||
|
||||
> setxkbmap -layout pl
|
||||
|
||||
| Language | short |
|
||||
|:--------|:------|
|
||||
| Polish | pl |
|
||||
| Serbian | rs |
|
||||
|
||||
Set 'alt + shift', as the command which cycles through the British English, Polish and Serbian keyboard layout.
|
||||
|
||||
> setxkbmap -layout gb,pl,rs -option grp:alt_shift_toggle
|
||||
|
@@ -1,61 +0,0 @@
|
||||
---
|
||||
title: "logs"
|
||||
tags: [ "Documentation", "basics" ]
|
||||
---
|
||||
## Syslog Management Protocols
|
||||
|
||||
Let's look at the programs filling in things on our /var/log/ directory.
|
||||
|
||||
* rsyslog (common)
|
||||
|
||||
* syslog (old)
|
||||
|
||||
* syslog-ng (lots of content-based filtering)
|
||||
|
||||
* klogd (kernel-focussed)
|
||||
|
||||
# `rsyslog`
|
||||
|
||||
The config rests in /etc/rsyslog.conf, which then references /etc/rsyslog.d/.
|
||||
|
||||
# Systemd
|
||||
This thing makes its own logs with journald, and the journal's own logging system writes to /var/log/journal/ directory, which is then filled with nonsense.
|
||||
|
||||
You can obtain nonsense in systemd's own format by entering:
|
||||
|
||||
journalctl -e
|
||||
|
||||
This thing generates so much nonsense it can crash your system, but can at least be checked with:
|
||||
|
||||
> journalctl --disk-usage
|
||||
|
||||
... in case you can't remember the `du` command.
|
||||
|
||||
You can limit the nonsense by editing the /etc/systemd/journald.conf file, and finding `#SystemMaxFileSize=`
|
||||
|
||||
# Logger
|
||||
|
||||
You can log things at any time with the logger:
|
||||
|
||||
> logger Server is being a dick!
|
||||
|
||||
Put things into a specific log with `-p`. They can enter into, e.g., lpr (printer) log file with a priority of "critical", with:
|
||||
|
||||
> logger -p lpr.crit Help!
|
||||
|
||||
Logfiles rotate around and eventually get deleted. Rotation means they get compressed.
|
||||
|
||||
Edit the config in /etc/logrotate.conf.
|
||||
|
||||
A few apps have their own special log rotation rules, kept in /etc/logrotate.d/.
|
||||
|
||||
The major variables to change are `weekly`, which compresses log files weekly, and `rotate 4`, which keeps 4 weeks worth of backlogs before deletion.
|
||||
|
||||
# Force Log Rotation
|
||||
|
||||
> sudo systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service
|
||||
|
||||
or just
|
||||
|
||||
> sudo systemctl restart systemd-journald.service
|
||||
|
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: "swap"
|
||||
tags: [ "Documentation", "basics" ]
|
||||
---
|
||||
# Making a Swap File
|
||||
|
||||
> sudo mkdir -v /var/cache/swap
|
||||
|
||||
> cd /var/cache/swap
|
||||
|
||||
> sudo dd if=/dev/zero of=swapfile bs=1K count=4M
|
||||
|
||||
This creates a swapfile of (1k x 4M) 4 Gigs.
|
||||
Change 4M to XM for an XGig swap.
|
||||
|
||||
> sudo chmod 600 swapfile
|
||||
|
||||
> sudo mkswap swapfile
|
||||
|
||||
> sudo swapon swapfile
|
||||
|
||||
Test it's working with top
|
||||
|
||||
> top -bn1 | grep -i swap
|
||||
|
||||
or:
|
||||
|
||||
> echo "/var/cache/swap/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
|
||||
|
||||
Test it'll work at boot with:
|
||||
|
||||
> sudo swapoff swapfile
|
||||
|
||||
> sudo swapon -va
|
||||
|
||||
# Partition Swaps
|
||||
|
||||
Put this in /etc/fstab:
|
||||
|
||||
`UUID=blah-blah none swap sw 0 0`
|
||||
|
||||
Then test it works with:
|
||||
|
||||
> sudo swapon -va
|
||||
|
||||
Test other partitions in fstab with:
|
||||
|
||||
> sudo mount -a
|
||||
|
Reference in New Issue
Block a user