mirror of https://github.com/cheat/cheat.git
new cheatsheets
This commit is contained in:
parent
2d7fdb5425
commit
ab86ac970d
|
@ -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
|
|
@ -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
|
|
@ -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)
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue