utilities

RPM Package Manager

May 25, 2022
linux, sysadmin, utilities

RPM Package Manager # rpm Querying packages # Query Options Description -q (--query) Queries and displays packages -qa (--query --all) Lists all installed packages -qc (--query --configfiles) Lists configuration files in a package -qd (--query --docfiles) Lists documentation files in a package -qf (--query --file) Exhibits what package a file comes from -qi (--query --info) Shows installed package information -qip (--query --info --package) Shows installable package information -ql (--query --list) Lists all files in a package -qR (--query --requires) Lists files and packages a package depends on (requires) -q --whatprovides Lists packages that provide the specified package or file -q --whatrequires Lists packages that require the specified package or file Package management # Install/Remove Options Description -e (--erase) Removes a package --force Installs and replaces a package or files of the same version -F (--freshen) Upgrades an installed package -h (--hash) Shows installation progress with hash marks -i (--install) Installs a package --import Imports a public key -K Validates the signature and package integrity -U (--upgrade) Upgrades an installed package or loads it if it is not already installed -v (--verbose) or -vv Displays detailed information -V (--verify) Verifies the integrity of a package or package files Manually extract files from a package # rpm2cpio (8) - Extract cpio archive from RPM Package Manager (RPM) package. ...

SSH

November 11, 2020
security, utilities, linux, networking

Secure Shell (SSH) # Allows a terminal or client to connect to a host terminal with data encrypted as it traverses the network. Protocol: TCP Port: 22 Replaced telnet SSH servers use public-key cryptography and challenge-response authentication . Process: # Server sends public key to client After the client receives the key, it creates a session ID and encrypts it with the public key. The server decrypts the session ID and uses it in all data transfers going forward. ...

Awk

awk, utilities

Notes # Awk Notes Resources # Official project Awk Power and Promise Tutorials # The GNU Awk User’s Guide Written by the maintainer Understanding Awk * Debugging # AWK REPL

Awk Notes

awk, utilities

Printing # In Awk each line is a record and each column is a field. You can print the whole line or individual fields like so. i[akraker@localhost:~/awk]$ echo "one two three" | awk '{ print }' one two three i[akraker@localhost:~/awk]$ echo "one two three" | awk '{ print $1 }' one i[akraker@localhost:~/awk]$ echo "one two three" | awk '{ print $2 }' two i[akraker@localhost:~/awk]$ echo "one two three" | awk '{ print $3 }' three Note, fields aren’t 0 indexed and start at 1. ...

chmod

utilities

chmod # Change a file’s mode. Supports octal or symbolic notation.

find

utilities

find # Search for files in a directory hierarchy. Examples: find ~ -type d | wc -l List number of directories in home dir find ~ -type f | wc -l List number of regular files in home dir File Types # File Type Description b Block special device file c Character special device file d Directory f Regular file l Symbolic link find ~ -type f -name "*. ...

Git

utilities, dev, scm

Git # Wikipedia - Git Commits # How to Write a Git Commit Message Resources # Git Cheatsheet How to rebase forked repo with upstream master: How to update a forked repo with git rebase Organizing multiple Git identities Books # Pro Git Book * Recommended in Unix And Linux System Administration Handbook as a spectacular reference. ...

GNU Stow

linux, utilities

I use GNU Stow to manage my dotfiles . Resources # Using GNU Stow to manage your dotfiles

Linux Commands

linux, sysadmin, utilities

Linux Commands # adduser alias - Create an alias for a command apropos - Display a list of appropriate commands aspell - Interactive spell checker aspell check textfile Can be used to spell-check specific file types like HTML for example. bc bg - Place a job in the background bzip2 - A block sorting file compressor Similar to gzip but uses different compression algorithm. ...

logger

linux, utilities

logger # Write to system logs using syslogd, rsyslogd, systemd-journald, etc.