This page contains troubleshooting tips that have been used on a Linux based system (Ubuntu). It is not guarenteed to work on all systems, and is mostly used to keep track of successful commands used.
Another page with configuration files that is helpful is the dotfiles page.
One nice utility is rename,
which can rename multiple files with a regex. One example of this is
rename 's/old/new/' *.pdf
.
One way to check file size using the terminal for folders is to use ncdu
. This method
makes it easy to find files in folders that take up space, and can remove the files. An
alternate method is to use find -type f -ls | sort -k 7 -r -n | head -10
.
One tool to find files would be find. This can be used to find files with the command
find . -name "file"
, where the dot (.) signifies the current directory.
One way this can be used is to find and remove .sw* files (or other temporary compiler
files). The command find . -type f -name "*.sw[klmnop]" -delete
removes all of the files
(from swk to swp). To remove files that macOS places, use the command
find . -type f -name "._*" -delete
.
Sometime permissions for a home directory could be broken, and need to be fixed. The correct permissions for the home directory is usually 0755, for ~/.ssh is 0700, for files 0644, and for private directories is 0600. The commands to do this automatically instead of using chmod xxxx is:
find /path/home -type d -print0 | xargs -0 chmod 0775
find /path/home -type f -print0 | xargs -0 chmod 0664
Finally, to be able to compare folders, use the command
diff --brief -r folder1/ folder2/
to be able to find the differences.
The output of programs can either be shown to the screen or to a file (stdout). One method
to do both is to do command | tee outputfile
to do both.
Sometimes when restarting a Thinkpad, the buttons on the trackpad do not work. The basic method is to reconnect the device, along with reset some of the xinput settings as necessary.
It can be helpful to restart the networkmanager if it fails to work correctly. This can alse be used on different services as necessary.
Sometimes when turning off a computer, there is a delay from the NetworkManager-wait-online.service. To change this setting, edit the file in /lib/systemd/system/NetworkManager-wait-online.service and change the timeout to 10 from 90.
There are multiple methods to get the boot time of the system. systemd-analyze blame
shows how long each service took to startup. systemd-analyze critical-chain
shows the
chain of calling services, along with which ones delayed the following service. Finally,
systemd-analyze plot > plot.svg
plots all of the services onto a time graph.
Grub is the default way Ubuntu and other Linux distributions use in order to start Linux,
Windows, or other OSes. Some of the configuration settings that can be used include
GRUB_DEFAULT=saved
and GRUB_SAVEDEFAULT=true
which saves the last entry (nice when
updating windows), GRUB_TIMEOUT=1
for quick booting, and GRUB_CMDLINE_LINUX_DEFAULT=""
to view boot messages instead of the normal graphical view.
On Ubuntu 20.04 there is an issue when using Grub and Secure boot where sometimes the grub
menu can be hidden (for example only showing the vender logo like Lenovo). To fix this
issue uncomment the graphical
terminal
GRUB_TERMIANL=console
.
In order to start wireshark without using sudo, several things need to be changed.
First, use sudo adduser $USER wireshark
to add the current user to the wireshark group.
Next, run the following two commands. The first should be set as yes to allow access.
a2ps is a program to print files (like code) to
postscript or pdf along with having nice formatting. Some
options that
are nice to have include -P pdf
for printing to pdf (or --printer=
),
--file-align=virtual
so there are no blank spots on pages, --medium=Letter
to change
from the default page size, --header=
or --left-footer="text"
to change the headers
(with meta sequences like %E for
date in local format), and -T 4
(or –tabsize) for 4 spaces per tab.
An overall command could then be a2ps -P pdf <files> --file-align=virtual --medium=Letter
--header= --left-footer="Name - %E" -T 4
.