This isn't really a guide to anything in particular, I just wanted an easily accessible reference for all the things I'm sick of wading through google results for, or otherwise seem to need help remembering. I've put it here in case someone else might find this helpful. I'll likely be adding to this as I find myself repeatedly googling things.
~/.config/khotkeysrc
. There should be a line that looks like: Uuid={77575b17-36d6-4b4e-b01f-2f1156e38583}
. Copy the contents of that line, specifically everything I have underlined there.$ kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta "org.kde.kglobalaccel,/component/khotkeys,org.kde.kglobalaccel.Component,invokeShortcut,<YOUR UUID HERE>"
$ qdbus org.kde.KWin /KWin reconfigure
pipeline | |
command | command2 | uses the output of one command as the input to the next |
command > file | saves the output of a command to a file |
command < file | uses a file as the input to a command |
command < fileA > fileB | will therefore run command with the contents of fileA as the input, and save the output to fileB |
command <<< "string or $variable" | will use the string or variable as the input to a command, the same as < file |
variables | |
variable=value | assigns a variable |
$variable | references it |
$(command) | lets you treat the output of a command like a variable reference |
$((number+variable)) | does the same thing for integer math expressions. |
$(( $(command) )) | This can also just convert strings into integers. |
"te$(command)xt" | Both can be inserted into strings. |
"some $variable text" | Both of these are valid ways to insert a variable into a string. |
grep | |
-v | inverts it, so matches are excluded |
-E "/regex/" | lets you use regex |
cut | |
-d 'string' | determines the delimiter string |
-f n | specifies a field to output, delimited by -d |
sed 's/ */ /g' | cut -d ' ' | Piping your thing through this helps with parsing a lot of Linux commands that output tabular data |
misc | |
xrandr --output <display name> --brightness <brightness> | Janky software-side display brightness setting with xrandr |
wget "https://example.com/file.zip" -O temp.zip; unzip temp.zip; rm temp.zip | Bash one-liner to unzip a file from the internet to the current directory |
<td>
element not to wrap by adding the nowrap
attribute to it.table-layout
CSS property to fixed
to force the the columns to be equal widths.date()
function in PHP returns date information. The first argument is a format string and the second is an optional integer for a Unix timestamp. The valid format characters as of PHP 8 can be found here, and examples are listed in this table:
Character | Output | Character | Output |
Y | y | ||
o | L | ||
F | M | ||
m | n | ||
t | W | ||
l | D | ||
d | j | ||
S | z | ||
N | w | ||
A | a | ||
g | G | ||
h | H | ||
i | s | ||
v | u | ||
B | I | ||
e | O | ||
P | Z | ||
U | |||
c | |||
r |
strtotime()
function does the reverse operation, converting date strings to Unix timestamps. Storing dates as Unix timestamps and converting when needed is recommended.I don't actually have a solution for this one, I just wish there was a resource for looking up the lyrics to songs and looking up songs by their lyrics that wasn't an SEO leech site.