mirror of
https://github.com/cheat/cheat.git
synced 2025-09-01 17:48:30 +02:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
3d8343a878 | |||
a5352ad9e5 | |||
f5ee3d5e29 | |||
e64babc972 | |||
cd465ef84f | |||
96e26a38d4 | |||
998ed00424 | |||
1fd03d3305 | |||
77cba58599 | |||
c5a738a8b1 | |||
250a265b25 | |||
c232721119 | |||
55492c50ac | |||
d9df28e3f2 | |||
710c7bcf70 | |||
efba736aee | |||
95774db7c5 | |||
da63c5d27f | |||
2e1cda114a | |||
353fe48d60 | |||
a96bd229a6 | |||
27482cbabd |
@ -38,7 +38,7 @@ from docopt import docopt
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# parse the command-line options
|
# parse the command-line options
|
||||||
options = docopt(__doc__, version='cheat 2.1.3')
|
options = docopt(__doc__, version='cheat 2.1.4')
|
||||||
|
|
||||||
# list directories
|
# list directories
|
||||||
if options['--directories']:
|
if options['--directories']:
|
||||||
|
16
cheat/cheatsheets/dnf
Normal file
16
cheat/cheatsheets/dnf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# To install the latest version of a package:
|
||||||
|
dnf install <package name>
|
||||||
|
|
||||||
|
# To search package details for the given string
|
||||||
|
dnf search <string>
|
||||||
|
|
||||||
|
# To find which package provides a binary
|
||||||
|
dnf provides <path to binary>
|
||||||
|
|
||||||
|
# The following are available after installing "dnf-plugins-core"
|
||||||
|
|
||||||
|
# Download a package
|
||||||
|
dnf download <package name>
|
||||||
|
|
||||||
|
# install the build dependencies for a SRPM or from a .spec file
|
||||||
|
dnf builddep <srpm/.spec file>
|
@ -4,6 +4,9 @@ docker -d
|
|||||||
# start a container with an interactive shell
|
# start a container with an interactive shell
|
||||||
docker run -ti <image_name> /bin/bash
|
docker run -ti <image_name> /bin/bash
|
||||||
|
|
||||||
|
# "shell" into a running container (docker-1.3+)
|
||||||
|
docker exec -ti <container_name> bash
|
||||||
|
|
||||||
# inspect a running container
|
# inspect a running container
|
||||||
docker inspect <container_name> (or <container_id>)
|
docker inspect <container_name> (or <container_id>)
|
||||||
|
|
||||||
|
11
cheat/cheatsheets/dpkg
Normal file
11
cheat/cheatsheets/dpkg
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Install the package or upgrade it
|
||||||
|
dpkg -i test.deb
|
||||||
|
|
||||||
|
# Remove a package including configuration files
|
||||||
|
dpkg -P test.deb
|
||||||
|
|
||||||
|
# List all installed packages with versions and details
|
||||||
|
dpkg -I
|
||||||
|
|
||||||
|
# Find out if a Debian package is installed or not
|
||||||
|
dpkg -s test.deb | grep Status
|
@ -19,8 +19,8 @@ ip route
|
|||||||
# Display all routes for IPv6
|
# Display all routes for IPv6
|
||||||
ip -6 route
|
ip -6 route
|
||||||
|
|
||||||
# Add route via gateway IP
|
# Add default route via gateway IP
|
||||||
ip route add 192.168.0.0/24 via 192.168.1.1
|
ip route add default via 192.168.1.1
|
||||||
|
|
||||||
# Add route via interface
|
# Add route via interface
|
||||||
ip route add 192.168.0.0/24 dev eth0
|
ip route add 192.168.0.0/24 dev eth0
|
||||||
|
@ -19,3 +19,14 @@ journalctl /usr/bin/dbus-daemon
|
|||||||
# Filter by PID
|
# Filter by PID
|
||||||
journalctl _PID=123
|
journalctl _PID=123
|
||||||
|
|
||||||
|
# Filter by Command, e.g., sshd
|
||||||
|
journalctl _COMM=sshd
|
||||||
|
|
||||||
|
# Filter by Command and time period
|
||||||
|
journalctl _COMM=crond --since '10:00' --until '11:00'
|
||||||
|
|
||||||
|
# List all available boots
|
||||||
|
journalctl --list-boots
|
||||||
|
|
||||||
|
# Filter by specific User ID e.g., user id 1000
|
||||||
|
journalctl _UID=1000
|
||||||
|
5
cheat/cheatsheets/p4
Normal file
5
cheat/cheatsheets/p4
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Print details related to Client and server configuration
|
||||||
|
p4 info
|
||||||
|
|
||||||
|
# Open a file and add it to depot
|
||||||
|
p4 add <filename>
|
11
cheat/cheatsheets/udisksctl
Normal file
11
cheat/cheatsheets/udisksctl
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Get info about block device
|
||||||
|
udisksctl info -b <block_device>
|
||||||
|
|
||||||
|
# Mounting device
|
||||||
|
udisksctl mount --block-device <block_device>
|
||||||
|
|
||||||
|
# Unmounting device
|
||||||
|
udisksctl unmount --block-device <block_device>
|
||||||
|
|
||||||
|
# Get help
|
||||||
|
udisksctl help
|
18
cheat/cheatsheets/uniq
Normal file
18
cheat/cheatsheets/uniq
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# show all lines without duplication
|
||||||
|
# `sort -u` and `uniq` is the same effect.
|
||||||
|
sort file | uniq
|
||||||
|
|
||||||
|
# show not duplicated lines
|
||||||
|
sort file | uniq -u
|
||||||
|
|
||||||
|
# show duplicated lines only
|
||||||
|
sort file | uniq -d
|
||||||
|
|
||||||
|
# count all lines
|
||||||
|
sort file | uniq -c
|
||||||
|
|
||||||
|
# count not duplicated lines
|
||||||
|
sort file | uniq -uc
|
||||||
|
|
||||||
|
# count only duplicated lines
|
||||||
|
sort file | uniq -dc
|
21
cheat/cheatsheets/zoneadm
Normal file
21
cheat/cheatsheets/zoneadm
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Halt zone
|
||||||
|
zoneadm -z <zone_name> halt
|
||||||
|
|
||||||
|
# Delete Zone
|
||||||
|
zoneadm -z <zone_name> halt
|
||||||
|
zoneadm -z <zone_name> uninstall
|
||||||
|
|
||||||
|
# Verify Zone
|
||||||
|
zoneadm -z <zone_name> verify
|
||||||
|
|
||||||
|
# Installing Zone
|
||||||
|
zoneadm -z <zone_name> install
|
||||||
|
|
||||||
|
# Boot Zone
|
||||||
|
zoneadm -z <zone_name> boot
|
||||||
|
|
||||||
|
# Reboot Zone
|
||||||
|
zoneadm -z <zone_name> reboot
|
||||||
|
|
||||||
|
# List Zones
|
||||||
|
zoneadm list -cv
|
2
setup.py
2
setup.py
@ -3,7 +3,7 @@ import os
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'cheat',
|
name = 'cheat',
|
||||||
version = '2.1.3',
|
version = '2.1.4',
|
||||||
author = 'Chris Lane',
|
author = 'Chris Lane',
|
||||||
author_email = 'chris@chris-allen-lane.com',
|
author_email = 'chris@chris-allen-lane.com',
|
||||||
license = 'GPL3',
|
license = 'GPL3',
|
||||||
|
Reference in New Issue
Block a user