mirror of
https://github.com/cheat/cheat.git
synced 2025-12-14 11:12:06 +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
|
# require the dependencies
|
||||||
import sheet
|
from cheat import *
|
||||||
import sheets
|
from cheat.utils import *
|
||||||
from utils import *
|
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
|
|
||||||
|
|
||||||
def main():
|
if __name__ == '__main__':
|
||||||
# parse the command-line options
|
# parse the command-line options
|
||||||
options = docopt(__doc__, version='cheat 2.1.17')
|
options = docopt(__doc__, version='cheat 2.1.19')
|
||||||
|
|
||||||
# list directories
|
# list directories
|
||||||
if options['--directories']:
|
if options['--directories']:
|
||||||
@@ -60,6 +59,3 @@ def main():
|
|||||||
# print the cheatsheet
|
# print the cheatsheet
|
||||||
else:
|
else:
|
||||||
print(colorize(sheet.read(options['<cheatsheet>'])))
|
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/
|
# 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
|
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
|
# list currently running containers
|
||||||
docker ps
|
docker ps
|
||||||
|
|
||||||
@@ -26,4 +29,4 @@ docker ps
|
|||||||
docker ps -a
|
docker ps -a
|
||||||
|
|
||||||
# list all images
|
# 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 a host with a total count of 15 packets overall, one every .5 seconds (faster ping).
|
||||||
ping -c 15 -i .5 www.example.com
|
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
|
from distutils.core import setup
|
||||||
~~~~~~~~
|
import os
|
||||||
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
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'cheat',
|
name = 'cheat',
|
||||||
version = '2.1.17',
|
version = '2.1.19',
|
||||||
author = 'Chris Lane',
|
author = 'Chris Lane',
|
||||||
author_email = 'chris@chris-allen-lane.com',
|
author_email = 'chris@chris-allen-lane.com',
|
||||||
license = 'GPL3',
|
license = 'GPL3',
|
||||||
description = 'cheat allows you to create and view interactive cheatsheets on the command-line',
|
description = 'cheat allows you to create and view interactive cheatsheets '
|
||||||
long_description = __doc__,
|
'on the command-line. It was designed to help remind *nix system '
|
||||||
url = 'https://github.com/chrisallenlane/cheat',
|
'administrators of options for commands that they use frequently, but not '
|
||||||
packages = find_packages(),
|
'frequently enough to remember.',
|
||||||
package_data = {
|
url = 'https://github.com/chrisallenlane/cheat',
|
||||||
'cheat.cheatsheets': ['*'],
|
packages = [
|
||||||
},
|
'cheat',
|
||||||
entry_points = {
|
'cheat.cheatsheets',
|
||||||
'console_scripts': [
|
'cheat.test',
|
||||||
'cheat = cheat.app:main',
|
],
|
||||||
],
|
package_data = {
|
||||||
|
'cheat.cheatsheets': [f for f in os.listdir('cheat/cheatsheets') if '.' not in f]
|
||||||
},
|
},
|
||||||
|
scripts = ['bin/cheat'],
|
||||||
install_requires = [
|
install_requires = [
|
||||||
'docopt >= 0.6.1',
|
'docopt >= 0.6.1',
|
||||||
'pygments >= 1.6.0',
|
'pygments >= 1.6.0',
|
||||||
|
|||||||
Reference in New Issue
Block a user