mirror of
https://github.com/cheat/cheat.git
synced 2025-12-13 10:42:07 +01:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6137cac8b | ||
|
|
711fd02195 | ||
|
|
248f5a0526 | ||
|
|
8e7ce511bd | ||
|
|
ba7ebc8392 | ||
|
|
6670785a2a | ||
|
|
aabaab1185 | ||
|
|
22eb1f2df4 | ||
|
|
a519ea163e | ||
|
|
6a2eda80d4 | ||
|
|
20d52376f9 |
@@ -31,15 +31,14 @@ Options:
|
||||
"""
|
||||
|
||||
# require the dependencies
|
||||
import sheet
|
||||
import sheets
|
||||
from utils import *
|
||||
from cheat import *
|
||||
from cheat.utils import *
|
||||
from docopt import docopt
|
||||
|
||||
|
||||
def main():
|
||||
if __name__ == '__main__':
|
||||
# parse the command-line options
|
||||
options = docopt(__doc__, version='cheat 2.1.17')
|
||||
options = docopt(__doc__, version='cheat 2.1.19')
|
||||
|
||||
# list directories
|
||||
if options['--directories']:
|
||||
@@ -60,6 +59,3 @@ def main():
|
||||
# print the cheatsheet
|
||||
else:
|
||||
print(colorize(sheet.read(options['<cheatsheet>'])))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
23
cheat/cheatsheets/apt
Normal file
23
cheat/cheatsheets/apt
Normal file
@@ -0,0 +1,23 @@
|
||||
# To search a package:
|
||||
apt search package
|
||||
|
||||
# To show package informations:
|
||||
apt show package
|
||||
|
||||
# To fetch package list:
|
||||
apt update
|
||||
|
||||
# To download and install updates without installing new package:
|
||||
apt upgrade
|
||||
|
||||
# To download and install the updates AND install new necessary packages:
|
||||
apt dist-upgrade
|
||||
|
||||
# Full command:
|
||||
apt update && apt dist-upgrade
|
||||
|
||||
# To install a new package(s):
|
||||
apt install package(s)
|
||||
|
||||
# To uninstall package(s)
|
||||
apt remove package(s)
|
||||
@@ -19,6 +19,9 @@ docker inspect --format {{.State.Pid}} <container_name_or_ID>
|
||||
# http://nathanleclaire.com/blog/2014/07/12/10-docker-tips-and-tricks-that-will-make-you-sing-a-whale-song-of-joy/
|
||||
docker inspect --format='{{json .Volumes}}' <container_id> | python -mjson.tool
|
||||
|
||||
# Copy files/folders between a container and your host
|
||||
docker cp foo.txt mycontainer:/foo.txt
|
||||
|
||||
# list currently running containers
|
||||
docker ps
|
||||
|
||||
@@ -26,4 +29,4 @@ docker ps
|
||||
docker ps -a
|
||||
|
||||
# list all images
|
||||
docker images
|
||||
docker images
|
||||
|
||||
@@ -3,3 +3,6 @@ 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
|
||||
|
||||
# test if a packet size of 1500 bytes is supported (to check the MTU for example)
|
||||
ping -s 1500 -c 10 -M do www.example.com
|
||||
|
||||
46
setup.py
46
setup.py
@@ -1,32 +1,26 @@
|
||||
"""cheat
|
||||
~~~~~~~~
|
||||
cheat allows you to create and view interactive cheatsheets on the
|
||||
command-line. It was designed to help remind *nix system administrators of
|
||||
options for commands that they use frequently, but not frequently enough
|
||||
to remember.
|
||||
:license: GPL3
|
||||
"""
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
from distutils.core import setup
|
||||
import os
|
||||
|
||||
setup(
|
||||
name = 'cheat',
|
||||
version = '2.1.17',
|
||||
author = 'Chris Lane',
|
||||
author_email = 'chris@chris-allen-lane.com',
|
||||
license = 'GPL3',
|
||||
description = 'cheat allows you to create and view interactive cheatsheets on the command-line',
|
||||
long_description = __doc__,
|
||||
url = 'https://github.com/chrisallenlane/cheat',
|
||||
packages = find_packages(),
|
||||
package_data = {
|
||||
'cheat.cheatsheets': ['*'],
|
||||
},
|
||||
entry_points = {
|
||||
'console_scripts': [
|
||||
'cheat = cheat.app:main',
|
||||
],
|
||||
name = 'cheat',
|
||||
version = '2.1.19',
|
||||
author = 'Chris Lane',
|
||||
author_email = 'chris@chris-allen-lane.com',
|
||||
license = 'GPL3',
|
||||
description = 'cheat allows you to create and view interactive cheatsheets '
|
||||
'on the command-line. It was designed to help remind *nix system '
|
||||
'administrators of options for commands that they use frequently, but not '
|
||||
'frequently enough to remember.',
|
||||
url = 'https://github.com/chrisallenlane/cheat',
|
||||
packages = [
|
||||
'cheat',
|
||||
'cheat.cheatsheets',
|
||||
'cheat.test',
|
||||
],
|
||||
package_data = {
|
||||
'cheat.cheatsheets': [f for f in os.listdir('cheat/cheatsheets') if '.' not in f]
|
||||
},
|
||||
scripts = ['bin/cheat'],
|
||||
install_requires = [
|
||||
'docopt >= 0.6.1',
|
||||
'pygments >= 1.6.0',
|
||||
|
||||
Reference in New Issue
Block a user