Merge pull request #234 from t-stark/master

New cheatsheets
This commit is contained in:
Chris Lane 2015-09-09 17:56:52 -04:00
commit da65ea32d8
8 changed files with 166 additions and 0 deletions

22
cheat/cheatsheets/cups Normal file
View File

@ -0,0 +1,22 @@
# Manage printers through CUPS:
http://localhost:631 (in web browser)
# Print file from command line
lp myfile.txt
# Display print queue
lpq
# Remove print job from queue
lprm 545
or
lprm -
# Print log location
/var/log/cups
# Reject new jobs
cupsreject printername
# Accept new jobs
cupsaccept printername

View File

@ -0,0 +1,32 @@
# Display all hardware details
sudo lshw
# List currently loaded kernel modules
lsmod
# List all modules available to the system
find /lib/modules/$(uname -r) -type f -iname "*.ko"
# Load a module into kernel
modprobe modulename
# Remove a module from kernel
modprobe -r modulename
# List devices connected via pci bus
lspci
# Debug output for pci devices (hex)
lspci -vvxxx
# Display cpu hardware stats
cat /proc/cpuinfo
# Display memory hardware stats
cat /proc/meminfo
# Output the kernel ring buffer
dmesg
# Ouput kernel messages
dmesg --kernel

23
cheat/cheatsheets/lib Normal file
View File

@ -0,0 +1,23 @@
# Display available libraries
ldconfig -p
# Update library resources
ldconfig
# Display libraries and file location
ldd
# Libraries available to apps in real-time
"Dynamic Libraries" (.so.)
# Libraries only available to apps when installed (imported)
"Static Libraries" (.a.)
# Standard (usual) library file location
/lib
# Sofware-accessible source for library info
/etc/ld.so.cache # (binary)
# Human-readable source for library info
/etc/ld.so.conf # (points to /etc/ld.so.conf.d)

33
cheat/cheatsheets/ntp Normal file
View File

@ -0,0 +1,33 @@
# Verify ntpd running:
service ntp status
# Start ntpd if not running:
service ntp start
# Display current hardware clock value:
sudo hwclock -r
# Apply system time to hardware time:
sudo hwclock --systohc
# Apply hardware time to system time:
sudo hwclock --hctosys
# Set hwclock to local time:
sudo hwclock --localtime
# Set hwclock to UTC:
sudo hwclock --utc
# Set hwclock manually:
sudo hwclock --set --date="8/10/15 13:10:05"
# Query surrounding stratum time servers
ntpq -pn
# Config file:
/etc/ntp.conf
# Driftfile:
location of "drift" of your system clock compared to ntp servers
/var/lib/ntp/ntp.drift

5
cheat/cheatsheets/ping Normal file
View File

@ -0,0 +1,5 @@
# ping a host with a total count of 15 packets overall.
ping -c 15 www.example.com
# ping a host with a total count of 15 packets overall, one every .5 seconds (faster ping).
ping -c 15 -i .5 www.example.com

View File

@ -4,6 +4,9 @@ rpm -ivh <rpm>
# To remove a package:
rpm -e <package>
# To remove a package, but not its dependencies
rpm -e --nodeps <package>
# To find what package installs a file:
rpm -qf </path/to/file>
@ -17,3 +20,12 @@ rpm -q --whatrequires <file>
# To list all installed packages:
rpm -qa
# To find a pkg's dependencies
rpm -i --test <package>
# Display checksum against source
rpm -K <package>
# Verify a package
rpm -V <package>

View File

@ -0,0 +1,21 @@
'rss2email -- converts rss feeds and emails them to your inbox'
# List all feeds
r2e list
# Convert RSS entries to email
r2e run
# Add a new feed
r2e add <feed address>
# Add a new feed with new email address
r2e add <feed address> [newemail address]
# Delete a feed
r2e delete <# of feed in list/>
# Help
r2e -h

18
cheat/cheatsheets/systemd Normal file
View File

@ -0,0 +1,18 @@
# Display process startup time
systemd-analyze
# Display process startup time at service level
systemd-analyze blame
# List running units
systemctl list-units
# Load a unit at startup
systemctl enable foo.service
# Start or Stop a unit
systemctl <start | stop> foo.service
# Unit file locations
/etc/systemd/system
/usr/lib/systemd/system