Compare commits

...

832 Commits

Author SHA1 Message Date
Chris Allen Lane 7908a678df
Merge pull request #742 from cheat/dependabot/go_modules/github.com/cloudflare/circl-1.3.7
chore(deps): bump github.com/cloudflare/circl from 1.3.6 to 1.3.7
2024-01-08 15:34:48 -05:00
dependabot[bot] 7c0eacb53d
chore(deps): bump github.com/cloudflare/circl from 1.3.6 to 1.3.7
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.6 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.6...v1.3.7)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 16:53:49 +00:00
Chris Allen Lane 4bf804ac60
Merge pull request #741 from cheat/dependabot/go_modules/golang.org/x/crypto-0.17.0
chore(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
2023-12-19 14:51:50 -05:00
dependabot[bot] 33c5918087
chore(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 00:07:38 +00:00
Christopher Allen Lane d34177729d chore: bump version to 4.4.2 2023-12-15 12:48:39 -05:00
Chris Allen Lane 7fa50328d7
Merge pull request #740 from chrisallenlane/chroma
chore(deps): bump chroma to v2 #735
2023-12-13 12:59:52 -05:00
Christopher Allen Lane 1790aec85d chore(deps): bump chroma to v2 #735
Bump `alecthomas/chroma` to `v2`:
https://github.com/cheat/cheat/issues/735
2023-12-13 12:54:32 -05:00
Mikel Olasagasti Uranga 6bf51e758f Use yaml.v3 rather than .v2 and .v1 2023-12-13 09:57:58 -05:00
Christopher Allen Lane 242da8c89a chore(build): remove `plan9` support
Remove `plan9` support from the `Makefile` because the executable now
fails to build.
2023-12-13 09:45:21 -05:00
Chris Allen Lane 2294f40ee0
Merge pull request #739 from chrisallenlane/v4.4.1
V4.4.1
2023-12-13 09:17:16 -05:00
Christopher Allen Lane fe25019b14 chore: bump version to `4.4.1` 2023-12-13 09:12:14 -05:00
Christopher Allen Lane bfb071c0b2 chore(lint): various changes to appease revive
- Add `package` comments
- Rename `opts` to `_` where unused
2023-12-13 09:10:20 -05:00
Christopher Allen Lane 95a4e31b6c chore(deps): upgrade dependencies
Upgrade all dependencies to newest versions.
2023-12-13 08:29:02 -05:00
Chris Allen Lane 0d9c92c8c0
Merge pull request #707 from chrisallenlane/v4.4.0
V4.4.0
2022-11-05 13:11:22 -04:00
Christopher Allen Lane 16c50bb659 chore: bump version to `4.4.0` 2022-11-05 12:56:43 -04:00
Christopher Allen Lane 1a85c9e9c8 feat: platform compatibility
Add experimental support for the following platforms:

- aix
- dragonfly
- illumos
- ios
- netbsd
- openbsd
- plan9
- solaris
2022-11-05 12:00:43 -04:00
Christopher Allen Lane c9ccefa607 chore(deps): remove `yaml.v1`
Remove errant `yaml.v1` dependency, and use `yaml.v2` everywhere.
2022-11-05 11:39:48 -04:00
Christopher Allen Lane 3a6b6e58f0 chore(deps): update dependencies
`make vendor-update`
2022-11-05 10:15:15 -04:00
Christopher Allen Lane 2edc0ee299 chore: add a comment
Add a small comment regarding a tricky edge-case in `gitdir.go`.
2022-08-28 06:54:29 -04:00
Chris Allen Lane bd9fa1ba70
Merge pull request #700 from chrisallenlane/4.3.3
4.3.3
2022-08-27 22:07:19 -04:00
Christopher Allen Lane bb85e611f4 chore: bump version to `4.3.3` 2022-08-27 21:29:06 -04:00
Christopher Allen Lane a2f538f114 refactor(repo): create `repo` package
- Refactor `installer.clone` into new `repo.Clone` package and method.

- Refactor `sheets.isGitDir` into `repo.GitDir`.

Both of these changes read better, and will facilitate cleaner
architecture when `--update` is implemented.
2022-08-27 21:02:48 -04:00
Christopher Allen Lane 80c91cbdee feat(installer): use `go-git` to clone
Integrate `go-git` into the application, and use it to `git clone`
cheatsheets when the installer runs.

Previously, the installer required that `git` be installed on the system
`PATH`, so this change has to big advantages:

1. It removes that system dependency on `git`
2. It paves the way for implementing the `--update` command

Additionally, `cheat` now performs a `--depth=1` clone when installing
cheatsheets, which should at least somewhat improve installation times
(especially on slow network connections).
2022-08-27 21:00:46 -04:00
Christopher Allen Lane ede2d2dbaa fix(Sheets): `.gitignore` in cheatpath (#699)
Fix an issue whereby `cheat` would crash if a cheatpath contained a file
that began with `.git`, like `.gitignore`.
2022-08-27 20:57:07 -04:00
Chris Allen Lane db3d7e53a4
Merge pull request #698 from chrisallenlane/4.3.2
4.3.2
2022-08-26 14:07:14 -04:00
Christopher Allen Lane 06c4ff52fc chore: bump version to `4.3.2` 2022-08-26 13:56:35 -04:00
Christopher Allen Lane cbc2638d96 fix(docopt): whitespace typo in `--help` output
Fix a whitespace (alignment) typo in the `--help` output.
2022-08-26 13:56:35 -04:00
Christopher Allen Lane fd93da799d fix(sheets): cheatsheets in submodules (#694)
Resolve an issue whereby cheatsheets contained within `git` submodules
were ignored due to a regression introduced in `4.3.1`.
2022-08-26 13:55:09 -04:00
Christopher Allen Lane 5c5ed7344f chore(docs): improve configuration docs (#656)
Improve the configuration documentation in `configs/conf.yml` (#656).
2022-08-26 13:55:09 -04:00
Christopher Allen Lane d773383f70 fix(build): `Makefile` corrections
- Fix an issue whereby `make clean` filed to remove assets created by
  `make generate`.

- Fix a subsequent issue whereby `make generate` was being run too late
  in the `make build` target, which resulted in a build failure.
2022-08-26 13:55:09 -04:00
Christopher Allen Lane 2717044b62 chore(docs): update `INSTALLING.md` (#677)
Update `INSTALLING.md` with more package information. See: #677
2022-08-26 13:55:09 -04:00
Christopher Allen Lane 2d635293c5 refactor(Sheet): create `parse` method
Move `Frontmatter.Parse` to `Sheet.parse`, and delete the `frontmatter`
package. `Sheet.parse` more accurately describes the parser's behavior.
2022-08-26 13:55:09 -04:00
Christopher Allen Lane f0bfeda47a fix(frontmatter): do not trim whitespace (#663)
Do not strip leading or trailing newlines. Doing so had interferred with
users' intended cheatsheet layouts.
2022-08-26 13:55:09 -04:00
Christopher Allen Lane f1540290a7 chore(deps): update dependencies 2022-08-26 11:06:21 -04:00
Chris Allen Lane 0b80a608c3
Merge pull request #692 from chrisallenlane/4.3.1
4.3.1
2022-08-08 21:01:56 -04:00
Christopher Allen Lane 3c1e24a0e8 chore: bump version to `4.3.1` 2022-08-08 20:38:23 -04:00
Christopher Allen Lane 2a6586b41b fix(installer): always use `more` pager on Windows 2022-08-08 20:38:23 -04:00
Christopher Allen Lane 6421953183 feat(installer): set default `editor`
Attempt to set and locate a default editor when running the installer.
2022-08-08 20:14:27 -04:00
Christopher Allen Lane 0c47f44ff9 fix: no colorization on default install (#687)
Fix an issue whereby a default installation (as created by the
installer) would (seemingly) fail to output colorized text, even when
the `-c` flag was passed.

The root cause of the problem was that the installer did not set a
default `style` for `chroma`, which in turn defaulted to using the `bw`
(black-and-white) style.

Thus, colorization actually *was* being applied with `-c` - it was
simply black and white!
2022-08-08 19:45:32 -04:00
Christopher Allen Lane 77f9c3fdd0 fix(Sheets): cheatsheets in hidden directories (#690)
Fix an issue whereby cheatsheets that were contained within hidden
directories were prevented from being loaded.
2022-08-08 19:17:59 -04:00
Chris Allen Lane b53a14b1a7
Merge pull request #691 from chrisallenlane/4.3.0
4.3.0
2022-08-07 14:45:27 -04:00
Christopher Allen Lane f1e8602369 chore: bump version to `4.3.0` 2022-08-07 14:11:47 -04:00
Christopher Allen Lane ddbe710881 feat: add the `--conf` command
Add the `--conf` command, which dipslay's the current `cheat`
configuration file path.
2022-08-07 14:08:25 -04:00
Christopher Allen Lane d598d96fce fix(Config): colorization without pager (#687)
Fix an issue whereby colorization would output ANSI codes if a pager was
not configured.

The solution here is to stop guessing about the state of the user's
system at runtime, as well as the user's intention. The installer now
chooses an appropriate installer when generating configs, and no longer
bothers searching for pagers at runtime.
2022-08-07 10:19:56 -04:00
Christopher Allen Lane 4fdec50487 chore(deps): upgrade dependencies
- Upgrade to Go 1.19 in `go.mod`
- Upgrade dependencies
2022-08-07 10:19:56 -04:00
Chris Allen Lane 9de866dfb6
Merge pull request #689 from chrisallenlane/ci
chore(ci): YAML lints
2022-08-05 07:53:53 -04:00
Christopher Allen Lane eb99a070ce chore: CI template nits
- Fix YAML nits per `yamllint`
- Upgrade Go version to `1.19`
2022-08-05 07:49:20 -04:00
Chris Allen Lane 73f80bde48
Merge pull request #688 from chrisallenlane/4.2.7
4.2.7
2022-08-05 07:01:51 -04:00
Chris Allen Lane 8130b2f3bd chore: bump version to `4.2.7` 2022-08-05 06:41:16 -04:00
Christopher Allen Lane f4e6c76e58 fix: escape sequences in search output (#687)
Fix an issue whereby ANSI escape characters could appear in search
output when a pager was not configured.

The root cause of the problem was code that was overzealously applying
an underlying effect to search terms.

This commit simply rips out underlying entirely, both as means of
resolving this problem, and also simply for removing needless visual
noise from search output.
2022-08-05 06:41:16 -04:00
Chris Allen Lane 85f5ae8ec7 chore: various lint corrections
Make various lint corrections in order to appease `staticcheck`.
2022-08-04 20:43:50 -04:00
Chris Allen Lane 484b447391 perf(Sheets): do not walk hidden directories
Modify `Sheets.Load` to not walk hidden directories like `.git`. This
optimization can potentially prevent thousands of system calls from
being made, because `.git` directories can contain many files.
2022-08-04 20:43:42 -04:00
Chris Allen Lane cfd1702bc6
Merge pull request #685 from chrisallenlane/page-bug
Fix #681
2022-08-02 20:37:48 -04:00
Christopher Allen Lane 7406ebfb5e chore(deps): update dependencies 2022-08-02 20:30:31 -04:00
Christopher Allen Lane 0737af2fec fix: pagination error on Linux
Bury the `more` pager default on Linux in an effort to work around the
following problem:

https://github.com/cheat/cheat/issues/681#issuecomment-1201842334

We're satisficing for this kludge because it does not appear to be
possible to actually make `more` perform as expected in all
environments.
2022-08-02 20:27:56 -04:00
Christopher Allen Lane a23d372d1f docs(INSTALLING): `nix` link
Update the `nix` package information.
2022-07-06 08:11:42 -04:00
Chris Allen Lane fe66ff3768
Merge pull request #679 from chrisallenlane/hacking-md
docs: create `HACKING.md`
2022-07-05 15:11:09 -04:00
Christopher Allen Lane 7fed1f63a6 docs: create `HACKING.md`
Create a `HACKING.md` file for onboarding new developers to `cheat`.
2022-07-05 15:07:34 -04:00
Christopher Allen Lane a297d1619c chore(build): remove `make docker-run`
Remove the `docker-run` `make` target, which was added in haste. It was
entirely redundant with `docker-sh`.
2022-07-05 14:40:15 -04:00
Chris Allen Lane ef1da90a77
Merge pull request #678 from chrisallenlane/go-install
Build/CI corrections
2022-07-05 12:24:48 -04:00
Christopher Allen Lane d8f405c112 chore(ci): use Go 1.18 in CI
Use Go 1.18 in the CI pipeline.
2022-07-05 11:59:08 -04:00
Chris Allen Lane f8403ff241
Merge pull request #676 from chrisallenlane/install-md
docs: create `INSTALLING.md`
2022-07-05 11:24:02 -04:00
Christopher Allen Lane 65f6be3fd8 docs: create `INSTALLING.md`
- Create `INSTALLING.md`
- Update the `README.md`
2022-07-05 11:19:40 -04:00
Chris Allen Lane 1cb53697d2
Merge pull request #674 from cheat/4.2.5
4.2.5
2022-07-04 22:37:19 -04:00
Christopher Allen Lane 14f321b0e6 chore: bump version to `4.2.5` 2022-07-04 22:00:35 -04:00
Christopher Allen Lane d3250fda79 chore(deps): upgrade vendored dependencies 2022-07-04 22:00:35 -04:00
Zhizhen He c482488c41 fix: replace Parse with ParseArgs
Parse() is deprecated
2022-07-04 22:00:35 -04:00
Chris Allen Lane fe8f39013e
Merge pull request #673 from chrisallenlane/win-compat
fix: Windows compatibility
2022-07-04 17:03:11 -04:00
Christopher Allen Lane 1016b20ef2 chore: bump version to `4.2.4`
Bump version to `4.2.4`. This version contains numerous Windows fixes
and improvements.
2022-07-04 16:58:58 -04:00
Christopher Allen Lane def8985dcd fix: Windows support
Fix an issue whereby the installer installed cheatsheets into the wrong
directory on Windows. This occurred because previously `path.Join` was
used where `path/filepath.Join` should have been used.

This matters, because the former always uses `/` as the path separator,
whereas the latter will use `/` or `\` as is appropriate for the
runtime environment.

This should resolve bullet point 4 in #665.
2022-07-04 16:55:57 -04:00
Christopher Allen Lane e6f12147df fix: config fixes for Windows
- Update the default config file to use `more` instead of `less` as the
  default pager, in order to support Windows out-of-the-box. (#655, #665).

- Use `terminal` Chroma formatter (rather than `terminal16m`) in order
  to accommodate less capable terminal emulators like `cmd.exe` by
  default. Similarly, default to `colorize: false` in configs (changed
  from `true`) (#665).

- Comment out default `style` in order to avoid printing ANSI color
  codes into terminals without color support (#665)

- Attempt to intelligently choose a default editor, rather than rely on
  a hard-coded `vim` in the configs. This should make it easier to use
  `cheat` immediately without needing to specify configs. It should also
  improve `cheat`'s Windows compatibility. (#665)
2022-07-04 16:06:37 -04:00
Christopher Allen Lane a8c2c396ed feat(build): crate `docker-run` target
Create a `docker-run` `make` target for opening a shell in an Alpine
container for development.
2022-07-04 13:13:27 -04:00
Christopher Allen Lane 35262df4f2 fix(build): Windows executable packaging
Fix an issue whereby the Windows zip release contained an extraneous
(and annoying) `dist` parent directory.
2022-07-04 12:34:06 -04:00
Chris Allen Lane 12ffa4cb5c
Merge pull request #644 from cheat/develop
Windows fixes, Android support
2021-10-09 12:13:01 -04:00
Chris Allen Lane d9c602f9e1
Merge pull request #643 from chrisallenlane/android
fix(Paths): Android support
2021-10-09 11:30:18 -04:00
Christopher Allen Lane b67ff8b6a8 fix(Paths): Android support
Add `"android"` to the explicit whitelist of supported operating
systems.  This may resolve incompatibilities with certain Android
environments.
2021-10-09 11:27:38 -04:00
Christopher Allen Lane a500a621a1 chore: bump version
Bump version to 4.2.3.
2021-10-09 10:59:02 -04:00
Chris Allen Lane 23b6928874
Merge pull request #639 from mattn/fix-windows
Fix Windows
2021-10-09 10:10:39 -04:00
Chris Allen Lane 9de39fb12b
Merge pull request #634 from cheat/dependabot/go_modules/github.com/mattn/go-isatty-0.0.14
chore(deps): bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14
2021-10-09 09:51:49 -04:00
Chris Allen Lane ad501c4cbe
Merge pull request #641 from OmgImAlexis/patch-1
chore: fix typo in comment
2021-10-09 09:39:41 -04:00
Christopher Allen Lane f17de401e5 docs(CONTRIBUTING): pr against `develop`
Add a note to `CONTRIBUTING.md` requesting that contributors open
pull-requests against the `develop` branch.
2021-10-09 09:34:23 -04:00
Alexis Tyler 2c097adeda
chore: fix typo in comment 2021-09-30 07:30:20 +09:30
Yasuhiro Matsumoto b825e0f535
Fix Windows 2021-09-29 01:33:59 +09:00
dependabot[bot] 8385277b28
chore(deps): bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14
Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.13 to 0.0.14.
- [Release notes](https://github.com/mattn/go-isatty/releases)
- [Commits](https://github.com/mattn/go-isatty/compare/v0.0.13...v0.0.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-isatty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-07 22:10:46 +00:00
Chris Lane 768d55e5d4 chore: bump version
Bump version to `4.2.2`.
2021-06-08 21:02:03 -04:00
Chris Lane 6aedc5c116 chore: whitespace edit on `Makefile` 2021-06-08 20:59:57 -04:00
Chris Lane e881bb1f97 chore: update `go.sum` 2021-06-08 20:59:57 -04:00
Chris Lane 501f9c66ad deps: upgrade dependencies 2021-06-08 20:59:57 -04:00
Pablo Lecolinet a2aa82d9f3 Add ARM64/ARMv8 build 2021-06-08 20:59:57 -04:00
PabloLec 018bce7ad5 Fix ZSH autocompletion 2021-06-07 11:42:47 +02:00
Chris Allen Lane 17acefdd9b
Merge pull request #617 from bernermic/master
Adds some git helper scripts
2021-05-14 12:21:26 -04:00
Michael Berner 37918e09a4
Adds some git helper scripts 2021-05-07 20:53:54 +02:00
Chris Allen Lane 86967873a8 Merge pull request #623 from cheat/github-actions
chore: migrate into Github Actions
2021-05-03 17:02:27 -04:00
Chris Lane d237d98c15 chore: migrate into Github Actions
Replace Travis CI integration in favor of Github Actions.
2021-05-03 16:43:27 -04:00
Chris Allen Lane eb9b3e7798
Merge pull request #624 from cheat/dependabot/add-v2-config-file
chore: upgrade to GitHub-native Dependabot
2021-05-03 14:32:08 -04:00
dependabot-preview[bot] b0a351033d
Upgrade to GitHub-native Dependabot 2021-04-29 20:40:56 +00:00
Chris Allen Lane 1eb44e8809
Merge pull request #621 from chrisallenlane/v4.2.1
Squashed commit of the following:
2021-04-28 12:55:17 -04:00
Chris Lane 55b18b4897 Squashed commit of the following:
commit 95479c8ad744db48386a5c78e54ef8da80e9120b
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 12:26:32 2021 -0400

    chore(version): bump version to 4.2.1

commit 6956f51cae
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 12:24:21 2021 -0400

    fix(Makefile): `vendor-update`

    Update the `vendor-update` build target to run `go mod vendor` after
    updating dependencies.

commit 0aca411279
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 12:23:24 2021 -0400

    chore(deps): update dependencies

commit e847956b02
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Apr 28 08:26:51 2021 -0400

    chore(deps): build updates

    - Upgrade `go` to `1.16.3`

    - Attempt to fix build errors regarding dependencies
2021-04-28 12:35:32 -04:00
Chris Allen Lane 883a17092f
Merge pull request #606 from chrisallenlane/4.2.0
4.2.0
2020-11-28 11:27:09 -05:00
Chris Lane 4f2a57fce8 fix(view): whitespace corrections
- Fix bug whereby `--all` flag would conflict with pager

- Fix whitespace inconsistencies among view and search outputs
2020-11-28 11:18:16 -05:00
Chris Lane ecc96c64f9 refactor(installer): externalize installer
Move installation-related code out of `main.go` and into a new
`installer.Run` method.
2020-11-28 10:32:37 -05:00
Chris Lane a81dd96ff4 fix: rename display.go
Rename `display.go` to `write.go`. (I forgot to do this previously.)
2020-11-27 23:05:02 -05:00
Chris Lane fb538baba5 chore(version): bump to `4.2.0` 2020-11-27 22:57:25 -05:00
Chris Lane 1a7b5c6127 feat(display): make `Faint` respect `Colorize`
Make `display.Faint` respect the `Colorize` config value.
2020-11-27 22:50:55 -05:00
Chris Lane cdddfbb516 chore: rename `display.Display`
Rename `display.Display` to `display.Write` for clarity and to reduce
"stutter".
2020-11-27 22:35:24 -05:00
Chris Lane 4ef4c35d8c feat(search): search all cheatpaths
Update the search function. It now searches all cheatpaths all the time,
as if `--all` were implicitly passed.
2020-11-27 22:31:16 -05:00
Chris Lane a58294859e chore: spelling
`s/pathSheets/pathsheets/g` in `cmd_list` for consistency elsewhere.
2020-11-27 22:26:14 -05:00
Chris Lane 606092e288 feat(search): improve search output formatting
Improve the search output formatting.
2020-11-27 17:06:02 -05:00
Chris Lane 233a9de1aa feat: implement `--all` flag
Implement an `--all` flag that can be used to view cheatsheets on all
chaetpaths. (Resolves #548)
2020-11-27 16:39:34 -05:00
Chris Lane aa16f68620 feat(display): add methods to `display`
- Add `indent`, `faint`, and `underline` methods to `display`
- Add tests for the above
2020-11-27 16:14:33 -05:00
Chris Lane 367673d5d9 chore(dependencies): update dependencies
Run `make vendor-update`.
2020-11-27 09:51:39 -05:00
Chris Lane 08fb9e11a9 feat(Makefile): add `vendor-update`
Add `vendor-update` target to `Makefile`, which updates all dependencies
to their newest versions.
2020-11-27 09:50:11 -05:00
Chris Lane 3f4d4bddb2 feat(tests): add unit-tests
Add unit-tests for `sheets.Load`.
2020-11-11 19:33:31 -05:00
Chris Allen Lane 6c6753b35c
Merge pull request #599 from chrisallenlane/issue-597
fix: update installation instructions in README
2020-11-07 18:56:37 -05:00
Chris Lane 0718b606e1 fix(README): clarify installation verbiage
Update the installation verbiage in the `README` for clarity
(issue #597).
2020-11-07 18:48:24 -05:00
Chris Lane 857119b443 feat(Docker): create development Docker image
- Create Docker image to be used for experimentation during development
- Create targets in `Makefile` pertaining to the above
2020-11-07 18:47:24 -05:00
Chris Allen Lane f421483eea
Merge pull request #596 from chrisallenlane/v4.1.1
v4.1.1
2020-11-03 18:32:25 -05:00
Chris Lane 4adddbf504 chore: bump version to v4.1.1 2020-11-03 18:05:46 -05:00
Chris Lane b9c86b6975 chore(dependencies): update dependencies 2020-11-03 17:59:56 -05:00
Chris Lane 0b21ccf6f8 feat(tests): improve test coverage 2020-11-03 17:29:49 -05:00
Chris Allen Lane a3ad8c5101
Merge pull request #595 from chrisallenlane/codeql
feat: integrate CodeQL build action
2020-11-01 10:51:38 -05:00
Chris Lane bacb74929a feat: integrate CodeQL build action 2020-11-01 10:47:25 -05:00
Chris Allen Lane 82e1c27494
Merge pull request #588 from chrisallenlane/bare-tag
feat: implement `cheat -t` shorthand
2020-09-05 09:05:09 -04:00
Chris Lane 45beeb2edb chore: bump version to 4.1.0 2020-09-05 08:56:51 -04:00
Chris Lane c2c479b36c feat: support `-t` shorthand
Make `cheat -t <tag>` function as a shorthand for `cheat -l -t <tag>`.
2020-09-02 17:17:44 -04:00
Chris Allen Lane cb0243e7fc
Merge pull request #580 from ryaanwells/patch-1
Fixing "cheetsheet" typo in README.md
2020-08-23 15:25:55 -04:00
Ryan Wells e5d04d41ea
Fixing "cheetsheet" typo in tags_test.go 2020-08-21 15:45:49 +01:00
Ryan Wells 2474ea4fb1
Fixing "cheetsheet" typo in README.md 2020-08-18 14:53:15 +01:00
Chris Allen Lane 7467c9fbc0
Merge pull request #578 from chrisallenlane/v4.0.3
chore: update dependencies
2020-08-08 13:45:10 -04:00
Chris Lane dfba3da003 chore: update dependencies 2020-08-08 10:29:29 -04:00
Chris Allen Lane ad7ad64a75
Merge pull request #573 from chrisallenlane/linux-conf
fix(config): add /etc/cheat config path
2020-07-11 08:12:04 -04:00
Chris Lane c4dcfd5da0 fix(config): add /etc/cheat config path
Add `/etc/cheat/conf.yml` to default config paths. See #568 for context.
2020-07-09 18:28:10 -04:00
Chris Allen Lane 278a5d9154
Merge pull request #570 from cheat/v4.0.1
fix(search): fix pagination error
2020-06-30 07:26:30 -04:00
Chris Lane 9fa0c466fd fix(search): fix pagination error
Fix the paginator when used in combination with the `-s` (search)
subcommand. Previously, it would not behave as intended, because `cheat`
was writing to `stdout` at inappropriate times.
2020-06-30 07:21:21 -04:00
Chris Allen Lane 4e9b2928b3
Merge pull request #569 from chrisallenlane/dev
v4.0.0
2020-06-25 19:05:37 -04:00
Chris Lane fa5eb44be8 chore: bump version to 4.0.0 2020-06-25 18:53:27 -04:00
Chris Lane 49afd7c16b feat: modify return codes
Modify exit codes. `cheat` now returns an exit code value `2` on errors
pertaining to a cheatsheet not being found.

BREAKING CHANGE
2020-06-25 18:38:03 -04:00
Chris Lane 59d5c96c24 feat(pagination): implement paginated output
Implement a `pager` config option. If configured, `cheat` will
automatically pipe output through the configured pager (where
appropriate).
2020-06-25 18:21:51 -04:00
Chris Allen Lane 8e602b0e93
Merge pull request #563 from chrisallenlane/3.10.1
feat(makefile): support 32-bit systems
2020-05-14 20:11:14 -04:00
Chris Lane fb04cb1fcd feat(makefile): support 32-bit systems
- Update the `Makefile` to additionally output a 386 binary (#562)
- Update the dependencies (#561)
- Bump version
2020-05-14 20:02:35 -04:00
Chris Allen Lane d42726101e
Merge pull request #560 from cheat/3.10.0
3.10.0
2020-05-11 20:20:09 -04:00
Chris Lane 93b3a711f5 chore: bump version to 3.10.0 2020-05-11 20:15:26 -04:00
Chris Lane 9c3d41c8bd Merge branch 'syohex-syohex/improve-completion' into 3.10.0 2020-05-11 20:13:58 -04:00
Chris Lane 4eeec6c868 chore(deps): resolve dependency conflict 2020-05-11 20:12:28 -04:00
dependabot-preview[bot] 1b17ab1914
chore(deps): bump github.com/alecthomas/chroma from 0.7.1 to 0.7.3
Bumps [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) from 0.7.1 to 0.7.3.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v0.7.1...v0.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 07:20:59 +00:00
Shohei YOSHIDA 477650ee44 Improve zsh completion 2020-04-12 11:03:08 +09:00
Chris Allen Lane c4dd3b52fd
Merge pull request #554 from chrisallenlane/master
v3.9.0
2020-04-07 18:59:18 -04:00
Chris Lane e8a0ea0dc3 chore(version): bump version to 3.9.0 2020-04-07 18:50:00 -04:00
Chris Lane 992ee66a56 Merge branch 'add-homebrew-release-flow' of https://github.com/chenrui333/cheat into v3.9.0 2020-04-07 18:48:57 -04:00
Chris Lane c9840c2d6f docs(autocompletion): update autocompletion docs
Update the autocompletion documentation (in `README` and `man` page) to
include information about configuring `zsh` autocompletion script.
2020-04-07 18:47:35 -04:00
Chris Lane bd53768f67 chore(zsh): set execute perm on cheat.zsh
Set execute permission on the `zsh` autocompletion script.
2020-04-07 18:41:00 -04:00
raochsinai 8092687956 change taglist and pathlist to local variable. 2020-04-07 14:56:34 +08:00
raochsinai 16ade50672 add complete script for zsh. 2020-04-03 15:34:01 +08:00
Rui Chen 62c80d76eb
Automate homebrew release flow 2020-03-24 21:21:54 -04:00
Chris Allen Lane 3e67eaa3b7
Merge pull request #546 from chrisallenlane/issue-272
docs(man): implement manpage
2020-03-24 20:55:57 -04:00
Chris Lane 38b13655fe chore(version): bump version to 3.8.0 2020-03-24 20:54:40 -04:00
Chris Lane 749d5c1182 docs(man): implement manpage
- Implement `make man` to generate a manpage

- Change verb tense in `make` help text
2020-03-24 20:46:48 -04:00
Chris Allen Lane 521f83377c
Merge pull request #545 from chrisallenlane/issue-544
fix(frontmatter): resolve #544
2020-03-11 19:03:06 -04:00
Chris Lane b15ff10537 chore(version): bump version to 3.7.1 2020-03-11 18:55:59 -04:00
Chris Lane 5288bd0c1c fix(frontmatter): resolve issue #544
- Fix error in `frontmatter.Parse` which would cause a `panic` when
  encountering malformed frontmatter

- Add a unit-test to cover the above
2020-03-11 18:54:46 -04:00
Chris Lane bddbee4158 fix(logging): improve sheets load logging
Improve logging in `sheets.Load`:

- Make error verbage consistant with verbiage elsewhere

- Add more information to logging statements
2020-03-11 18:51:06 -04:00
Chris Lane ce27cf2cc0 chore(version): bump version to 3.7.0 2020-03-06 20:19:31 -05:00
Chris Lane 5733b1d6d4 chore(vendor): update vendor dependencies 2020-03-06 20:18:41 -05:00
Chris Lane 2d221050d8 Merge branch '1-14' into 3.7.0 2020-03-06 20:17:54 -05:00
Chris Lane ce37b670c7 feat(installer): implement "installer"
Squashed commit of the following:

commit 5c322e79b7
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Fri Mar 6 19:56:56 2020 -0500

    docs(README): update the `README`

    Update the `README` to document the improved config-generation
    mechanism.

commit 803e1f014c
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Fri Mar 6 19:19:49 2020 -0500

    feat(config-init): platform-specific pathing

    Update `--init` subcommand to rely upon the same platform-detection
    intelligence that was previously implemented by the "installer".

    The installer and `--init` should now produce identical config files.

commit 99c48097e2
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Fri Mar 6 18:26:33 2020 -0500

    feat(installer): platform-correct config templating

    Modify the "installer" to populate cheatpaths with sensible defaults
    based on the detection of the user's operating system and environment.

commit 8e1580ff5a
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Thu Mar 5 20:19:58 2020 -0500

    fix(tests): fix `config.Paths` tests

    Refactor `config.Paths` (by externalizing a call to `homedir.Dir`) to
    decouple it from filesystem paths, thus facilitating cleaner unit-tests.

commit a08dca70d9
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Thu Mar 5 18:14:27 2020 -0500

    feat(installer): default path selection

    Modify the installer to improve default config and cheatsheet path
    selection.

commit e15bc6c966
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Thu Mar 5 17:49:50 2020 -0500

    fix(typo): correct comment typo in `main.go`

commit efd09575df
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Thu Mar 5 17:46:49 2020 -0500

    feat(config): refactor config path detection

    Previously, failing other checks, on Unix and BSD systems,
    `config.Paths` would attempt to compute the user's home directory by
    reading the `HOME` environment variable.

    This change deprecates that approach with a call to `homedir.Dir`, which
    is used elsewhere throughout the application.

commit ec10244ebe
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Thu Mar 5 17:15:28 2020 -0500

    chore(installer): delete unused file

    Delete `installer/installer.go`, which (in hindsight) was unnecessary.

commit ebd9ec6287
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Mar 4 19:31:13 2020 -0500

    wip(installer): stub experimental "installer"

    Stubs out an experimental "installer" that will help new users to
    quickly configure `cheat`.

commit ecac5a0971
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Wed Mar 4 19:30:12 2020 -0500

    chore(dependencies): updates vendored dependencies
2020-03-06 20:17:26 -05:00
Rui Chen 47a9eeb4fd go mod vendor 2020-03-03 18:28:13 -05:00
Rui Chen be56c9cf0c Bump golang to v1.14 2020-03-03 18:27:31 -05:00
Chris Allen Lane 7be57cb01c
Merge pull request #540 from chrisallenlane/master
fix: README and Makefil
2020-02-26 19:29:04 -05:00
Chris Lane 8453af8601 fix(Makefile): build targets
Adds missing dependencies to the `build` and `install` targets.
2020-02-26 19:21:07 -05:00
Chris Lane 6e388c3693 fix(README): typo fix
Fixes a bad link to the completion scripts in the `README`.
2020-02-26 19:20:24 -05:00
Chris Allen Lane b13246978a
Merge pull request #538 from chrisallenlane/improved-search
feat(search): issue #260
2020-02-15 18:07:40 -05:00
Chris Lane a39d36cd34 chore: bumps version to 3.6.0 2020-02-15 16:13:33 -05:00
Chris Lane 87cba04ff2 chore: DRY out colorization code
Creates a `sheet.Colorize` method that DRYs out code that was duplicated
among `cmd_search` and `cmd_view`.
2020-02-15 16:11:15 -05:00
Chris Lane bc623da74b feat: issue #260
Dramatically improves the usefulness of `--search` by outputting
"chunked" results. This removes the need (usually) to search and then
manually open a cheatsheet.
2020-02-15 15:56:25 -05:00
Chris Lane a6c25d4b9c feat: --search improvements
- Deprecates the `Match` struct

- Applies syntax highlighting to search results output in a manner
  consistent with the 'View' output

- Refactors search to move colorization functionality outside of its
  concern
2020-02-15 14:42:06 -05:00
Chris Lane e24ac2b385 chore: deprecates line numbers in search
Removes line numbers from search result output as part of the
refactoring effort.
2020-02-15 10:11:25 -05:00
Chris Lane e0c35a74d4 chore: removes colorization from search
Deprecates `mgutz/ansi` and removes colorization from search as a first
step toward improving the functionality.
2020-02-15 10:01:44 -05:00
Chris Lane 3e4c1818a9 feat: single-sheet searching
`--search` will now honor the `<cheatsheet>` argument, making it
possible to constrain a search to a single cheatsheet.
2020-02-15 06:38:57 -05:00
Chris Lane 7b4a268ebd fix: resolves #301
Fixes an issue whereby `cheat` would crash when `$EDITOR` (or
equivalent) contained arguments.
2020-02-02 15:56:18 -05:00
Chris Allen Lane f7183aa17a
Merge pull request #536 from chrisallenlane/issue-301
fix: issue #301
2020-02-02 15:54:47 -05:00
Chris Lane 1ce6c29e6a fix: issue #301
Attempts to resolve issue #301, whereby `cheat` fails if `$EDITOR` (or
equivalent) contains flags.
2020-02-02 15:48:45 -05:00
Chris Allen Lane 219db679e1
Merge pull request #535 from chrisallenlane/master
chore: bumps version to 3.5.0
2020-02-02 14:54:46 -05:00
Chris Lane 53177cb09d chore: bumps version to 3.5.0
Squashed commit of the following:

commit 8b74d50f1f
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Sun Feb 2 14:40:23 2020 -0500

    chore: updates README

    Edits the `README` to provid updated information regarding the shell
    autocompletion scripts and `fzf` integration.

commit 9868ba2d68
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Sun Feb 2 14:39:04 2020 -0500

    chore: modifies envvar check

    Modifies the `CHEAT_USE_FZF` envvar check within the bash autocompletion
    script for clarity.

commit ac1012f743
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Sun Feb 2 14:25:34 2020 -0500

    chore: renames autocompletion scripts

    Renames autocompletion scripts to conform with the conventions
    established in `scop/bash-completion`.

commit c8747bd91d
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Sun Feb 2 14:23:03 2020 -0500

    feat: improved bash autocompletions

    - Dramatically improves quality of bash autocompletions

    - Provides optional integration with `fzf`

commit 825bd0139d
Author: Chris Lane <chris@chris-allen-lane.com>
Date:   Sun Feb 2 09:19:46 2020 -0500

    chore: deletes `fzf.bash`

    Deletes `fzf.bash`, which was always intended to be a temporary
    placeholder anticipating future improvements.
2020-02-02 14:50:16 -05:00
Chris Allen Lane ef7a41f9a9
Merge pull request #533 from chrisallenlane/master
chore: creates `make coverage` target
2020-01-31 14:07:20 -05:00
Chris Lane 008316d030 chore: creates `make coverage` target
Creates a `make coverage` target that generates a unit-testing coverage
report.
2020-01-31 14:01:57 -05:00
Chris Lane a59c019642 chore: removes `bin` directory
Removes the `bin` directory. It has been obsoleted by the `Makefile`,
and no downstream packages appeared to depend on it.
2020-01-31 13:30:21 -05:00
Chris Allen Lane 57225442be
Merge pull request #532 from chrisallenlane/auto-config-bugfix
fix(config generation): issue #501
2020-01-30 20:12:24 -05:00
Chris Lane 2c7ce48859 chore: multi-os builds on travis
Modifies `.travis.yml` to specify that builds be performed on both Linux
and MacOSX. Experimental.
2020-01-30 20:08:11 -05:00
Chris Lane a3fe4f40bb chore: bumps version to 3.4.1 2020-01-30 20:06:06 -05:00
Chris Lane 506fb8be15 fix: XDG_CONFIG_HOME mishandling
Attempts to resolve an issue regarding automatic config file generation,
as referenced in #501. This issue is believed occur when
`XDG_CONFIG_HOME` is unset.
2020-01-30 19:59:35 -05:00
Chris Lane 408e944eea chore: refactors `config.path` (small)
Performs a minor refactoring on `config.Paths` to consistently use
`path.Join` when computing config directory paths. Previously, both
`path.Join` and `fmt.Sprintf` were being used, strictly due to an
oversight.
2020-01-30 19:45:02 -05:00
Chris Lane 8a313b92ca chore: implements unit-tests for `config.Paths` 2020-01-30 19:25:53 -05:00
Chris Lane 6912771c39 chore: refactors `config.Paths`
Refactors the reading of multiple envvars out of `config.Paths` in order
to facilitate cleaner unit-testing.
2020-01-30 18:48:36 -05:00
Chris Allen Lane d4c6200702
Merge pull request #531 from chrisallenlane/auto-config
feat(configs): config auto-generation
2020-01-29 14:22:12 -05:00
Chris Lane 9251849d23 chore: bumps version to 3.4.0 2020-01-29 14:17:06 -05:00
Chris Lane 313b5ebd27 feat: config auto-generation
`cheat` now attempts to auto-generate a config file if one cannot be
found on the filesystem.
2020-01-29 14:08:03 -05:00
Chris Lane ca91b25b02 fix: logging on failed configs
Fixes an issue whereby the error message generated when a config file
could not be loaded (due to a symlink resolution failure) would fail to
print the config file path to `stderr`.
2020-01-29 14:05:27 -05:00
Chris Lane bbf6af50b1 chore: modifies example config
- Generally reduces the complexity demonstrated in the example configs.
  The prior complexity appears to have confused some new users.

- Removes the `dotfiles` references in the example configs. This idiom
  likewise appears to have confused some new users.

- Adds some instruction regarding how to download and configure the
  "community" cheatsheets (`cheat/cheatsheets`).
2020-01-29 14:01:19 -05:00
Chris Lane 9f05442bce fix: Makefile
Resolves an error whereby `make build` would fail to call `go generate`
prior to calling `go build`.
2020-01-29 13:59:31 -05:00
Chris Lane 3fc4c2f89e chore: Makefile
Makes some adjustments to the behaviors of `make tags` and `make
distclean`.
2020-01-29 09:36:59 -05:00
Chris Lane 9e88ff2642 chore: Makefile adjustment
Previously, `build-release` would produce `.gz` files which had the
execute permission set. This modifies the `Makefile` to `chmod -x` the
`.gz` files after compression.
2020-01-29 09:11:06 -05:00
Chris Allen Lane e3764b81e7
3.3.2 (#530)
* chore: trivial Makefile changes

Trivial `Makefile` changes regarding file pathing.

* chore: build flags

- Passes `-trimpath` flag to build tasks

- Creates `make ci` task and modifies `travis.yml` to use it

- Bumps version to `3.3.2`
2020-01-29 08:50:47 -05:00
Chris Allen Lane 3786ac96a5
3.3.1 (#529)
* makefile wip

* feat: adds Makefile

Adds a `Makefile` for managing build-related tasks.

* chore: updates dependencies

* chore: updates dependencies

* chore: updates bin scripts

- Removes `build_release.sh`
- Places deprecation notice in `build_devel.sh`, as its purpose has been
  superceded by the `Makefile`.

* chore: updates bin scripts

- Removes `build_release.sh`
- Places deprecation notice in `build_devel.sh`, as its purpose has been
  superceded by the `Makefile`.

* fix: Makefile

Makes several corrections and improvements to the `Makefile`:

- Previously, the `ifeq` rules were not behaving as intended, due to
  false assumptions regarding how `make` fundamentally behaves.
  Malfunctioning imperative-style programming has been replaced with
  declarative rules to repair this issue.

- Previously, all release executables were zipped after compilation. In
  order to spare non-Windows users from (possibly) needing to install a
  package to unzip the executables, all non-Windows binaries are now
  compressed with `gzip`. (Windows executables are still compressed with
  `zip`.)

- Removes a bit of needlessly verbosity in several rules and paths.

* chore: updates dependencies

* chore: bumps version to 3.3.1
2020-01-25 14:44:51 -05:00
aperum 4cb7a3b42c add FreeBSD to the supported systems in config.Path (#528) 2020-01-25 14:33:15 -05:00
dependabot-preview[bot] ff6a866abe chore(deps): bump gopkg.in/yaml.v2 from 2.2.7 to 2.2.8 (#527)
Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.2.7 to 2.2.8.
- [Release notes](https://github.com/go-yaml/yaml/releases)
- [Commits](https://github.com/go-yaml/yaml/compare/v2.2.7...v2.2.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-25 14:20:06 -05:00
dependabot-preview[bot] 2e7ccb2a68 chore(deps): bump github.com/mattn/go-isatty from 0.0.11 to 0.0.12 (#526)
Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.11 to 0.0.12.
- [Release notes](https://github.com/mattn/go-isatty/releases)
- [Commits](https://github.com/mattn/go-isatty/compare/v0.0.11...v0.0.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-25 14:19:57 -05:00
Chris Lane 126231db1f feat: makefile release compression
The `Makefile` `build-release` target now zips all executables after
compilation.
2020-01-20 13:54:53 -05:00
Chris Allen Lane 91f0d02de2
v3.3.0 (#525)
* feat: directory-scoped cheatpaths

`cheat` now searches for a `.cheat` directory in the current working
directory. If found, that directory is (temporarily) appended to the slice
of cheatpaths.

* makefile wip

* fix: appeases linter

Appeases linter (`go vet`) by adding quotation marks to YAML struct
tags.

* chore: modifies .gitignore

Adds `tag` to `.gitignore`

* feat: adds Makefile

Adds a `Makefile` for managing build-related tasks.

* chore: documents directory-local paths

Adds documentation regarding the new directory-local cheatpath
functionality.

* chore: updates dependencies

* chore: bumps version to 3.3.0

* chore: updates bin scripts

- Removes `build_release.sh`
- Places deprecation notice in `build_devel.sh`, as its purpose has been
  superceded by the `Makefile`.
2020-01-20 12:34:48 -05:00
Chris Allen Lane 815e714fb4
Merge pull request #523 from cheat/dependabot/go_modules/github.com/alecthomas/chroma-0.7.1
chore(deps): bump github.com/alecthomas/chroma from 0.7.0 to 0.7.1
2020-01-19 17:05:16 -05:00
dependabot-preview[bot] bd3986a051
chore(deps): bump github.com/alecthomas/chroma from 0.7.0 to 0.7.1
Bumps [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v0.7.0...v0.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-09 07:03:22 +00:00
Chris Allen Lane f47b75edc0
Merge pull request #521 from chrisallenlane/master
chore: dependencies and build script
2019-12-28 10:08:32 -05:00
Chris Lane 180ee20f77 chore: bumps version to 3.2.2 2019-12-28 09:58:48 -05:00
Chris Lane 9b86c583f8 chore: updates `chroma` dependency 2019-12-28 09:56:19 -05:00
Chris Lane e1f7828869 Merge branch 'master' of github.com:cheat/cheat into issue-520 2019-12-28 09:54:39 -05:00
Chris Lane 7f3ae2ab30 feat: ARM support
Modifies `bin/build_release.sh` to compile releases for ARM versions 5,
6, and 7.
2019-12-28 09:53:55 -05:00
Chris Allen Lane bbd03a1bb8
Merge pull request #515 from cheat/dependabot/go_modules/github.com/alecthomas/chroma-0.7.0
chore(deps): bump github.com/alecthomas/chroma from 0.6.9 to 0.7.0
2019-12-28 09:53:22 -05:00
Chris Lane 326c54147b chore: updates dependencies 2019-12-28 09:07:37 -05:00
dependabot-preview[bot] efcedaedec
chore(deps): bump github.com/alecthomas/chroma from 0.6.9 to 0.7.0
Bumps [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) from 0.6.9 to 0.7.0.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v0.6.9...v0.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-28 14:06:13 +00:00
Chris Allen Lane 301cbefb0c
Merge pull request #519 from cheat/dependabot/go_modules/github.com/mattn/go-isatty-0.0.11
chore(deps): bump github.com/mattn/go-isatty from 0.0.10 to 0.0.11
2019-12-28 09:04:43 -05:00
dependabot-preview[bot] 9a481f7e75
chore(deps): bump github.com/mattn/go-isatty from 0.0.10 to 0.0.11
Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.10 to 0.0.11.
- [Release notes](https://github.com/mattn/go-isatty/releases)
- [Commits](https://github.com/mattn/go-isatty/compare/v0.0.10...v0.0.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 07:07:50 +00:00
Chris Allen Lane e2920bd922
Merge pull request #514 from chrisallenlane/master
fix: colorization errors
2019-11-24 12:17:19 -05:00
Chris Lane 973a1f59ea chore: version bump
Bumps version to `3.2.1`.
2019-11-24 12:03:26 -05:00
Chris Lane 3afea0972c fix: colorization errors
- Corrects an error with `--search`. Previously, `--search` was not
  aware of whether it was outputted to a TTY, and would apply colorization
  at all times. This resulted in unwanted behavior when, for example,
  piping search results into a paginator.

- Corrects an error with `--color`. Previously, `--color` would be
  ignored if output was being written to a non-TTY. This made it
  impossible, for example, to `cheat tar --color | less -R`, as
  colorization would always be stripped. The behavior of `--color` has
  been modified such that it now behaves similarly to `--color=always` in
  other applications.
2019-11-23 13:47:08 -05:00
Chris Allen Lane f86633ca1c
Merge pull request #511 from chrisallenlane/master
Resolves #504
2019-11-20 19:02:50 -05:00
Chris Lane a01a3491a4 chore: version bump
Bumps version to 3.2.0.
2019-11-20 18:56:50 -05:00
Chris Lane daa43d3867 feat: implements filter on `-l`
Implements filtering by pattern with `-l`. Resolves #504.
2019-11-20 18:55:43 -05:00
Chris Lane e94a1e22df chore: updates vendored dependencies 2019-11-20 18:55:24 -05:00
Chris Allen Lane 5046975a0f
Merge pull request #510 from cheat/dependabot/go_modules/gopkg.in/yaml.v2-2.2.7
chore(deps): bump gopkg.in/yaml.v2 from 2.2.5 to 2.2.7
2019-11-20 18:53:54 -05:00
dependabot-preview[bot] 198156a299
chore(deps): bump gopkg.in/yaml.v2 from 2.2.5 to 2.2.7
Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.2.5 to 2.2.7.
- [Release notes](https://github.com/go-yaml/yaml/releases)
- [Commits](https://github.com/go-yaml/yaml/compare/v2.2.5...v2.2.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 07:07:43 +00:00
Chris Lane a7067279df v3.1.1
Bumps version to `3.1.1`.
2019-11-19 19:59:45 -05:00
Stefan Cosma a8e6fdb18a Properly trim path separators on Windows 2019-11-20 01:10:19 +01:00
Chris Allen Lane bbfa4efdb7
Merge pull request #508 from exploide/fish-autocompletion
fish autocompletion: updated to cheat 3.1.0
2019-11-17 18:12:41 -05:00
exploide 741ad91389 fish autocompletion: updated to cheat 3.1.0 2019-11-17 19:33:33 +01:00
Chris Allen Lane 573d43a7e6
Merge pull request #506 from chrisallenlane/3.1.0
3.1.0
2019-11-16 09:27:18 -05:00
Chris Lane 879e8f2be4 chore: trivial copy change in docopt.txt 2019-11-16 09:23:45 -05:00
Chris Lane eab3c14f1f fix: broken logline in --search
Resolves a malformed logging statement in `cmd_search` which would never
actually write to stderr.
2019-11-16 09:18:45 -05:00
Chris Lane 9a6130b6b7 feat: --rm and --tags
- Implements the `--rm` command (#483)
- Implements the `--tags` command (#484)
- Bumps version to `3.1.0`
2019-11-16 09:18:32 -05:00
Chris Lane aeaf01e1de feat: implements --tags
Implements `--tags`, which lists all tags in use.
2019-11-14 21:56:11 -05:00
Chris Lane 09c29a322f chore: bumps version to 3.0.7 2019-11-12 19:16:21 -05:00
Chris Lane 0525b2331b chore: updates vendored dependencies
Updates `alecthomas/chroma` and `gopkg.in/yaml.v2` to newer versions.
2019-11-12 19:03:59 -05:00
Chris Lane 27a4991a3a feat: updates build scripts
Build scripts now invoke `go mod vendor` and `go mod tidy` early in the
build process, to ensure that the `vendor` directory stays consistent
with the `go.mod` et. al.
2019-11-12 19:02:42 -05:00
Chris Lane 4dda412dcb Merge branch 'dependabot/go_modules/github.com/alecthomas/chroma-0.6.9' 2019-11-12 18:55:16 -05:00
Chris Lane bfb60764ad Merge branch 'master' into dependabot/go_modules/github.com/alecthomas/chroma-0.6.9 2019-11-12 18:54:02 -05:00
Chris Lane 3a97c680bb Merge branch 'dependabot/go_modules/gopkg.in/yaml.v2-2.2.5' 2019-11-12 18:53:40 -05:00
dependabot-preview[bot] edc0fe41ef
Bump github.com/alecthomas/chroma from 0.6.8 to 0.6.9
Bumps [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) from 0.6.8 to 0.6.9.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v0.6.8...v0.6.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-12 23:42:53 +00:00
dependabot-preview[bot] 9e49bf8e9c
Bump gopkg.in/yaml.v2 from 2.2.4 to 2.2.5
Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.2.4 to 2.2.5.
- [Release notes](https://github.com/go-yaml/yaml/releases)
- [Commits](https://github.com/go-yaml/yaml/compare/v2.2.4...v2.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-12 23:42:30 +00:00
Chris Lane 50dc3c8b29 fix: resolves #498
Resolves an issue whereby background colors were written to the terminal
output when colorization was applied.
2019-11-07 20:24:08 -05:00
Chris Lane e08a4f3cec chore: bumps version to 3.0.5 2019-11-07 20:00:57 -05:00
Chris Lane d6ebe0799d fix: repairs broken config unit-tests
Repairs the `config` unit-tests which were broken with `3.0.4`. It does
so by providing a simple switch that allows us to disable the resolution
of filesystem symlinks when running tests.
2019-11-07 19:59:18 -05:00
Chris Lane 51aaaf3423 chore: removes the `tj/front` dependency
Removes the `tj/front` dependency due to licensing concerns. See #490.
2019-11-07 06:46:34 -05:00
Chris Lane 197ff58796 fix: comments out more broken tests
Comments out another test broken by `3.0.4`.
2019-11-05 20:02:16 -05:00
Chris Lane b8f512aae8 fix: comments out broken test
Comments out a test that was broken with changes introduced in `3.0.4`.
2019-11-05 19:58:08 -05:00
Chris Lane e7a1a296e3 chore: version bump
Version bump to `3.0.4`.
2019-11-05 19:19:17 -05:00
Chris Lane f7c093bec0 fix: resolves #474
Resolves #474, whereby `cheat` failed to resolve symlinks. The root
cause was that `path/filepath#Walk` simply does not resolve symlinks:

  https://golang.org/pkg/path/filepath/#Walk
2019-11-05 19:08:40 -05:00
Chris Lane c47b7f81aa fix: file permissions
Set executable permission on `scripts/cheat-autocompletion.fish`.
2019-11-05 18:49:05 -05:00
Chris Lane 52081b97ac Merge branch 'fish-completions' of github.com:exploide/cheat into exploide-fish-completions 2019-11-05 18:46:58 -05:00
Chris Lane 1dda796e7c fix: resolves #492
Fixes an issue whereby hidden files (like `.DS_Store`) may be wrongly
loaded as cheatsheets.
2019-11-05 18:44:47 -05:00
exploide 67469b0afa added cheat 3.x autocompletion file for fish shell, see #476 2019-11-05 17:29:32 +01:00
exploide 4f8431a600 fixed some cli option typos 2019-11-05 15:53:21 +01:00
Chris Lane 5301442f7c chore: issue template labels 2019-11-04 18:43:52 -05:00
Chris Allen Lane cd45efcdec Update issue templates 2019-11-04 18:42:21 -05:00
Chris Lane c31786fc5b chore: updated the bug report template 2019-11-04 18:40:46 -05:00
Chris Allen Lane 934c36ad77 Update issue templates 2019-11-04 18:37:26 -05:00
Chris Allen Lane 2c0099c28a
Merge pull request #479 from zhujian0805/master
adding the cheat autocomplete script back :)
2019-11-04 18:12:12 -05:00
Chris Lane 33ac3d34d1 fix: removed colorization on non-tty
Fixes a bug whereby `cheat` would apply ANSI colorization even when
outputting into a non-TTY.
2019-10-29 19:47:56 -04:00
Chris Lane 10af84dc10 chore: bump version
Bumps the version to `3.0.2`.
2019-10-28 19:44:08 -04:00
Chris Lane 8d532bcdee Merge branch 'add-travis-ci' of github.com:chenrui333/cheat into chenrui333-add-travis-ci 2019-10-28 19:41:23 -04:00
Chris Lane a13ad99241 chore: modified build scripts
Modified build scripts to always use local vendoring, now that the
project contains a `vendor` directory.
2019-10-28 19:39:22 -04:00
Rui Chen 1a8345f326 Add travis build badge 2019-10-27 18:44:44 -04:00
Rui Chen 472e1f84f5 Add travis-ci 2019-10-27 18:31:16 -04:00
Rui Chen 659e0a8eff Add vendor files for go build 2019-10-27 12:04:31 -04:00
Chris Lane d19f0e1c5d chore: deprecates `bin/deps.sh`
- Deprecates `bin/deps.sh`. It was rendered obsolete with 217566, and
  the introduction of a `go.mod` file.
- Fixes two minor typos in the buld scripts.
- Bumps the version to `3.0.1`.
2019-10-27 10:26:24 -04:00
Chris Lane 0f9861f825 Merge branch 'gomod' of github.com:dawidd6/cheat into dawidd6-gomod 2019-10-27 09:35:13 -04:00
Chris Lane 36960fc164 chore: adds license and contributing file 2019-10-26 16:13:46 -04:00
James Zhu 749173f1f6 remove the title as cheat -l lists the title as well. 2019-10-22 11:58:51 +08:00
Dawid Dziurla 217566efc5
Use Go modules 2019-10-21 12:51:56 +02:00
James Zhu 33e33dc7b7 adding the autocompletion back 2019-10-21 18:07:26 +08:00
James Zhu 201cd1d629 integrate with bash complete for autocompletion 2019-10-21 15:18:47 +08:00
Chris Lane e5114a3e76 Re-wrote from scratch in Golang
- Re-implemented the project in Golang, and deprecated Python entirely
- Implemented several new, long-requested features
- Refactored cheatsheets into a separate repository
2019-10-20 10:02:28 -04:00
Chris Allen Lane 307c4e6ad6
Merge pull request #472 from asamarin/master
Add: sqlite3 - describe table schema
2019-10-16 06:13:40 -04:00
Chris Allen Lane 1333703a49
Merge pull request #471 from thezeroalpha/master
ssh-keygen: add commands to print the fingerprint
2019-10-16 06:09:44 -04:00
Chris Allen Lane 184c200936
Merge pull request #473 from extend1994/Fix-netstat
Add missing spaces for netstat command comment
2019-10-16 06:06:13 -04:00
Ann f1837b4c59
Add missing spaces for netstat command comment 2019-10-15 13:58:57 +08:00
Alex Samarin 77d0f6d9a0 Add: sqlite3 - describe table schema 2019-10-14 09:54:38 +01:00
Alex Balgavy 5b2518b3fe ssh-keygen: add commands to print the fingerprint 2019-09-08 23:32:13 -04:00
Chris Lane 60bf61c82f Merge branch 'TomasKorbar-installation-issues' 2019-09-03 12:48:51 -04:00
Chris Allen Lane b1dabec129
Merge pull request #468 from FlorianKempenich/master
Add cheatsheet for `z`
2019-08-28 08:39:47 -04:00
Florian Kempenich d10290541d Add cheatsheet for `z` 2019-08-03 13:29:18 +01:00
Tomas Korbar 12e8059025 Edit appdirs site_config_dir function
This change causes site_config_dir function to return
/etc/cheat on linux systems. This is right because most
linux distributions follow FHS where /etc is a directory
which contains system-wide configuration files.
2019-07-24 14:23:46 +02:00
Chris Allen Lane ea07b6ad0e
Merge pull request #455 from rengoo/patch-1
Update zip
2019-07-01 18:54:53 -04:00
Chris Allen Lane c50b236b80
Merge pull request #366 from Asta1986/master
improved command to export query result to csv file
2019-07-01 18:53:44 -04:00
Chris Allen Lane 42a39449b3
Merge pull request #459 from rafaelbernard/vim-multiple-windows
Add: vim - multiple windows
2019-07-01 18:51:56 -04:00
Chris Allen Lane 087a076f74
Merge pull request #462 from santosomar/patch-1
Addition additional nmap options
2019-07-01 18:50:31 -04:00
Chris Allen Lane a15ea7fc3e
Merge pull request #433 from shanahanjrs/issue-334-emacs-fix
Emacs sheet now uses the proper prefix
2019-07-01 18:47:24 -04:00
Chris Allen Lane f33e6cd602
Merge pull request #444 from dogsleg/patch-1
Fix typo, action (-I -> -l)
2019-07-01 18:38:57 -04:00
Chris Allen Lane 95f648cc2d
Merge pull request #456 from jellymann/patch-1
fix: typo in vagrant sheet
2019-07-01 18:33:16 -04:00
Chris Allen Lane 0db660347b
Merge pull request #463 from sullivant/patch-1
Updated tmux cheat to include swapping windows
2019-07-01 18:32:47 -04:00
Thomas 432461a075
Updated tmux cheat to include swapping windows
Because I always forget.
2019-06-13 07:36:11 -05:00
Omar Santos 93df3b3f20
Update nmap
Added Nmap Scripting Engine Categories
2019-06-02 18:56:31 -04:00
Omar Santos c548ded02d
Addition additional nmap options
Added "Port Status Information" and Additional Scan Types
2019-06-02 18:53:03 -04:00
Rafael Araujo 4c12d66546 Add: vim - multiple windows 2019-05-04 20:43:26 -03:00
Daniel Smith 6ce53370e7
fix: typo in vagrant sheet 2019-04-16 13:50:58 +02:00
rengoo bde74c701f
Update zip
added command for creating a zip archive from a folder/directory
2019-04-13 20:59:08 +02:00
Tomas Korbar fdc414ede3 Fix import of appdirs in Configuration class
Import of appdirs without reference to cheat module caused
ModuleNotFoundError
2019-03-21 16:47:51 +01:00
Lev Lamberov 5c23f374e4
Fix action (-I -> -l)
dpkg -I (capital i) is for showing information about a package.
dpkg -l (lowercase l) is for listing packages matching given pattern.

So, here is a fix for the typo.
2019-03-09 10:17:46 +05:00
Chris Lane c1fceb5f0d Merge branch 'installation-issues' of github.com:cheat/cheat into installation-issues 2019-02-13 12:55:30 -05:00
Chris Lane d0faf1a3e3 Included appdirs in project
The prior attempt to resolve #420 and #431 relied on `appdirs` to
determine the appropriate directories into which to install files.
Previously, `setup.py` dynamically attempted to install `appdirs` via
`pip` during installation if necessary.

This attempt to failed on multiple platforms, however, due to
backwards-incompatible `pip` interfaces.

As a workaround, I have now directly included `appdirs` (a small module)
within `cheat` itself. This approach is explicitly supported per the
`appdirs` documentation:

https://pypi.org/project/appdirs/
2019-02-13 12:53:19 -05:00
Chris Lane fdddedb8bd Installation issues
Resolves the following:

- #351 (use of `sudo` when installing)
- #420 (failure to install on Windows)
- #431 (failure to install on MacOS)

Application now relies on `appdirs` module to identify the appropriate
locations for storing configuration and data, both during installation
and runtime.
2019-02-13 12:51:18 -05:00
Chris Lane 5487314676 Version bump: 2.5.1 2019-02-13 12:42:58 -05:00
Chris Allen Lane ec360ccddd
Merge pull request #435 from roachsinai/master
Expand ~ for 'CHEAT_USER_DIR', 'CHEAT_DEFAULT_DIR' and 'DEFAULT_CHEAT…
2019-02-13 12:40:25 -05:00
Chris Allen Lane bb7dfd1028
Merge pull request #436 from avsej/patch-1
Fix typo in gcc sheet
2019-02-13 12:31:31 -05:00
Sergey Avseyev b348724082
Update gcc 2019-02-13 13:52:33 +00:00
raochsinai 5053f07fd8 Expand ~ for 'CHEAT_USER_DIR', 'CHEAT_DEFAULT_DIR' and 'DEFAULT_CHEAT_DIR'. 2019-02-12 15:16:59 +08:00
Chris Lane f692c8e1d8 Addressing cross-platform installation issues
Attempted to address various cross-platform installation issues:

- Removed all hard-coded references to file-paths, and replaced them
  with paths provided by `appdirs`.

- Removed (erroneously inserted) default file paths which would never be
  checked due to application logic.

- Modified `setup.py` to no longer install a configuration file. The
  mechanics are still in place to **read** a configuration file, but
  after examination, I've concluded that the installation of that file
  is best left to package maintainers rather than `cheat` itself.
2019-02-09 13:27:58 -05:00
Chris Lane 89bb9aaf13 Included appdirs in project
The prior attempt to resolve #420 and #431 relied on `appdirs` to
determine the appropriate directories into which to install files.
Previously, `setup.py` dynamically attempted to install `appdirs` via
`pip` during installation if necessary.

This attempt to failed on multiple platforms, however, due to
backwards-incompatible `pip` interfaces.

As a workaround, I have now directly included `appdirs` (a small module)
within `cheat` itself. This approach is explicitly supported per the
`appdirs` documentation:

https://pypi.org/project/appdirs/
2019-02-08 11:21:09 -05:00
John Shanahan 574deeabc0 Emacs sheet now uses the proper prefix 2019-02-07 14:16:08 -05:00
Chris Lane 482161f8e9 Installation issues
Resolves the following:

- #351 (use of `sudo` when installing)
- #420 (failure to install on Windows)
- #431 (failure to install on MacOS)

Application now relies on `appdirs` module to identify the appropriate
locations for storing configuration and data, both during installation
and runtime.
2019-02-07 13:34:20 -05:00
Chris Allen Lane 4dd55105d2
Merge pull request #361 from aroonav/master
Enable starting the cheat python script on windows.
2019-02-06 10:25:29 -05:00
Chris Allen Lane 6148d64599
Merge pull request #430 from movd/rename
Update rename
2019-02-05 08:59:06 -05:00
Moritz cde8bcaa1d
Update rename
Add cheat for mass rename with search and replace
2019-02-05 10:57:43 +01:00
Aroonav Mishra fcb82778e4 * Corrected the logic to execute the cheat script.
* Check VISUAL, CHEAT_EDITOR, EDITOR environment variables before falling
back to wordpad as the default editor.
2019-02-05 12:18:26 +05:30
Aroonav Mishra da92421948 Merge remote-tracking branch 'upstream/master' 2019-02-05 10:14:39 +05:30
Chris Allen Lane d6c7863573
Merge pull request #428 from dufferzafar/patch-2
ssh: Improve SOCKS command
2019-02-04 14:54:52 -05:00
Shadab Zafar 5812bca6b7
ssh: Improve SOCKS command
This doesn't give an SSH shell, but just forwards the ports - which is what one usually requires when setting up a SOCKS proxy.

The -q is to suppress messages etc.
2019-02-04 23:45:16 +05:30
Chris Lane 074dba6e99 v2.5.0
`minor` version bump to `2.5.0`.
2019-02-04 12:04:52 -05:00
Chris Allen Lane 9d1dd15387
Merge pull request #427 from cheat/issue-349
Issue #349
2019-02-04 11:57:35 -05:00
Chris Lane caf355f142 Issue #349
Implements support for terminals with light backgrounds via a new
`CHEAT_COLORSCHEME` envvar.
2019-02-04 11:56:00 -05:00
Chris Allen Lane 2728ce4757
Merge pull request #426 from cheat/vagrant
Updated Vagrantfile
2019-02-04 11:54:06 -05:00
Chris Lane 6ae76799f7 Updated Vagrantfile
Modified `Vagrantfile` to build an Ubuntu environment rather than
Alpine, after the latter exhibited weird behavior.
2019-02-04 11:50:25 -05:00
Chris Allen Lane 0b523a769f
Merge pull request #425 from cheat/vagrant
Added Vagrantfile
2019-02-04 10:41:26 -05:00
Chris Lane f29cf03b68 Added Vagrantfile
Added a `Vagrantfile` which builds an alpine-based environment that can
be used for development and testing.
2019-02-04 10:40:10 -05:00
Chris Allen Lane 4347114e19
Merge pull request #424 from JensKorte/patch-1
link changed, added details
2019-02-04 10:05:36 -05:00
Chris Lane edc67e7819 Updated links to README
Re-pathed links from `chrisallenlane/cheat` to `cheat/cheat` as
appropriate, following the move.
2019-02-04 10:03:19 -05:00
Chris Allen Lane aa33a36491
Merge pull request #422 from cheat/refactor
Refactor
2019-02-04 09:58:24 -05:00
JensKorte 8aac10dd8b
link changed, added details
The table isn't available any more in the recent wiki page. The new link uses the old version of wikipedia. In my browser I have to "unhide" the box.
2019-02-03 20:56:57 +01:00
Chris Lane 9931b78c5f Lint
- Added instruction to lint `setup.py` to `ci/lint.sh`
- Updated `setup.py` per linter suggestions
2019-02-01 15:24:04 -05:00
Chris Lane a37577ee85 Trivial: docstrings
Updated some docstring comments.
2019-02-01 15:18:23 -05:00
Chris Lane 3ad923eff0 Refactored (11)
Renamed `CHEAT_DEFAULT_DIR` to `CHEAT_USER_DIR` because the latter more
accurately describes the purpose of the variable.
2019-02-01 15:10:03 -05:00
Chris Lane ba47dc2cbc Refactored (10)
- Added `ci/lint.sh`, which uses `flake8` to lint the relevant files
- Made changes to appease the linter.
- Bugfix in `cheat/configuration` (missing dependency)
2019-02-01 14:44:48 -05:00
Chris Lane df21731c02 Trivial Python style corrections 2019-02-01 11:43:38 -05:00
Chris Lane a657699a24 Refactored (9)
Moved some functionality into the `Util` class.
2019-02-01 11:43:11 -05:00
Chris Lane 5793c1845a Refactored (8)
Refactored `Sheet` class:

- Removed unnecessary indirection and extraneous methods
- Renamed some methods to conform to Pythonic conventions
- Renamed the `create_or_edit` method to `edit` to be consistent with
  subcommand name (`--edit`)
2019-02-01 11:23:38 -05:00
Chris Lane e2b5728283 Refactored (7)
Refactored for general code-clarity, with particular focus on removing
needless abstraction within `Sheet` and `Sheets` classes.
2019-01-31 20:03:56 -05:00
Chris Lane d61e4e7c34 Refactored (6)
Standardized (mostly) how the various classes are initialized.
2019-01-31 18:08:19 -05:00
Chris Lane 145a81dcd6 Var renames
Replaced more references to deprecated envvar names to their newer
counterparts.
2019-01-31 17:55:26 -05:00
Chris Lane 7c4fc54681 Refactored (5)
- Extracted `Colorize` class out of `Util` class. (The latter now only
  contains static methods.)
- Renamed methods in `Colorize` class for improved clarity.
- Refactored as necessary to accommodate the changes above.
2019-01-31 17:43:21 -05:00
Chris Lane 878d7e7e1b Refactored (4)
Improved handling of edge-cases in `configuration.py`.
2019-01-31 17:40:53 -05:00
Chris Lane 928637c9db Refactored (3)
Removed unnecessary `import` calls.
2019-01-31 17:14:21 -05:00
Chris Lane ab87bb11c4 Refactored (2)
Created an `Editor` class out methods in the `Util` class to enhance
code clarity.
2019-01-31 17:03:21 -05:00
Chris Lane 8f757d7735 Refactored (1)
Performed a general refactoring, focusing on the following:

- Removing layers of abstraction in config handling
- Stubbing out proper config validator
- Updating envvar names located throughout the project
2019-01-31 16:45:28 -05:00
Chris Lane c922ef4c8d Version bump: 2.4.2
Contains `termcolor` dependency fix.
2019-01-29 11:45:43 -05:00
Chris Allen Lane 574a7ec3c9
Merge pull request #421 from chrisallenlane/termcolor
Added termcolor dependency to setup.py
2019-01-29 11:44:22 -05:00
Chris Lane 5ae49228b7 Added termcolor dependency to setup.py
Added a missing `termcolor` dependency to `install_requires` in
`setup.py`. `termcolors` was introduced as an optional dependency when
the `CHEAT_HIGHLIGHT` envvar was implemented.
2019-01-29 11:42:14 -05:00
Chris Lane 09acdf1a69 README edits
Updated the names of the (preferred) cheat-related environment
variables, which have been changed in recent versions.
2019-01-29 11:31:03 -05:00
Chris Lane 9ea60d12ff Version-bump to 2.4.1
- Includes various bugfixes regarding UTF-8 encoding
- Adds new cheatsheets
2019-01-29 10:58:57 -05:00
Chris Allen Lane f7d747e101
Merge pull request #417 from butzel-net/master
suggestion for socat
2019-01-29 10:22:44 -05:00
Chris Lane 3b207b4d51 Merge branch 'dev' 2019-01-29 10:19:48 -05:00
Chris Allen Lane 5e1d3abce8
Merge pull request #416 from chrisallenlane/issue-414-build-opts
Issue #414 - snap package compatibility
2019-01-29 10:18:55 -05:00
Chris Allen Lane ad25e16dc6
Merge pull request #415 from chrisallenlane/issue-372
Addressing issue #372
2019-01-29 10:15:55 -05:00
Chris Allen Lane 92c07c0137
Merge pull request #419 from chrisallenlane/issue-414-build-opts
Issue #414 - snap package compatibility
2019-01-27 14:50:37 -05:00
Chris Allen Lane 7e35263e90
Merge pull request #418 from chrisallenlane/issue-372
Addressing issue #372
2019-01-27 14:45:41 -05:00
Chris Lane 1b6b5b79b7 Version bump: 2.4.0
Preparing a new `minor` release.
2019-01-27 14:36:57 -05:00
butzel b377984b59
suggestion for socat
butzel's suggestions for a socat cheatsheet
2019-01-25 12:46:01 +01:00
Chris Lane e319332138 Issue #414 - snap package compatibility
PR #391 changed the locaton into which system-wide cheatsheets are
installed to `/usr/share/cheat`, in order to comply with FHS. However,
this is causing conflicts with the `snap` packaging process.

This commit removes hard-coded references to `/usr/share/cheat` (outside
of `config/cheat`), and instead reads the cheat path via the
`CHEAT_PATH` config value (which may be set either in `cheat/config`, or
exported as an environment variable).

Lastly, this commit makes `setup.py` "aware of" the `CHEAT_PATH` env
var, allowing us to specify to where sytem-wide cheatsheets should be
installed during the `snap` build.
2019-01-21 12:58:03 -05:00
Chris Lane 13c0ea7525 Addressing issue #372
Previous pull-requests #406 and #413 attempted to resolve #372. They
were, however, never merged in.

Given that #391 was just merged (which rewrites a significant amount of
prior code), I here took what we learned from #406 and #413 and
re-implemented it. This approach will be less error-prone than
attempting to rebase either of the former on the changes introduced in
 #391.
2019-01-18 14:50:00 -05:00
Chris Lane 87448c49fa Merge branch 'TomasKorbar-changes' 2019-01-18 14:28:06 -05:00
Tomas Korbar 80b8cfc06b Add new env variables but hold compatibility with old ones
Legacy environmental variables like CHEATCOLORS are now higher in
configuration hiearchy than new environmental variables in
configuration files
2019-01-18 18:03:15 +01:00
Tomas Korbar 8a8f30679d Fix problems with CHEATCOLORS behaviour 2019-01-17 17:10:01 +01:00
Tomas Korbar 4d19505b79 Conform code to pep8 2019-01-15 19:38:24 +01:00
Tomas Korbar a2e028fd19 Move validation of CHEAT_HIGHLIGHT value to Configuration class
Method _check_configuration should be used for validating all bad
values from now on
2019-01-15 19:21:33 +01:00
Tomas Korbar 5eec6bf040 Improve handling of settings
Constructors of classes which need direct access to configuration
now take Config class instance as parameter which will give them
better maintainability in the future

CHEAT_HIGHLIGHT has been added to Configuration class
2019-01-15 19:13:30 +01:00
Tomas Korbar 3a4c2a887d Add ConfigurationTestCase
- tests prove descending hiearchy of config system
- env vars, local config file, global config file
2019-01-15 17:09:39 +01:00
Tomas Korbar 879a58b721 Read env vars for global and local config path
- allows to change these paths for testing purposes and also
gives user option to change his config paths
2019-01-15 17:09:39 +01:00
Tomas Korbar 7814de96d2 Add classes for better readability 2019-01-15 17:09:39 +01:00
Tomas Korbar a651426075 Add reading settings from configuration file 2019-01-15 17:09:35 +01:00
Tomas Korbar c4c935a6a5 Change default location of cheatsheets 2019-01-15 16:48:07 +01:00
Chris Allen Lane df86142b8e
Merge pull request #411 from chrisallenlane/snap-cheatsheet
Created a `snap` cheatsheet
2019-01-11 17:19:08 -05:00
Chris Lane 60b05c8781 Created a `snap` cheatsheet 2019-01-11 17:18:02 -05:00
Chris Lane 22b64d2d08 Merge branch 'master' of https://github.com/liuyang1/cheat into liuyang1-master
Resolving merge-conflicts.
2019-01-11 17:00:39 -05:00
Chris Lane 1224908445 README edits
Updated the README to mention the new `CHEAT_HIGHLIGHT` environment
variable.
2019-01-11 16:36:17 -05:00
Chris Lane 28a2902e20 Implemented validation on CHEAT_HIGHLIGHT
Implemnted an assertion that `CHEAT_HIGHLIGHT` (if set) contains a value
that is acceptible to `termcolors`. This happens only once, upon the
invokation of `__main__`. If the assertion fails, `cheat` terminates
with an exit code of `1`.
2019-01-11 16:26:57 -05:00
Chris Lane 730c488854 Introduced CHEAT_HIGHLIGHT
Introduced CHEAT_HIGHLIGHT environment variable to de-couple search-term
highlighting from syntax highlighting.
2019-01-11 16:13:38 -05:00
Chris Lane ba9051e3cd `highlight` bug-fix
Fixed a bug in `cheat/utils.py` that would cause `highlight` to return
the wrong value when `CHEATCOLORS` was not set.
2019-01-11 15:58:21 -05:00
Chris Lane 7c7278ac8b Util logic simplification
- Simplified the logic regarding checking the state of `CHEATCOLORS` in
  `cheat/utils.py`

- Improved the commenting within the same
2019-01-11 15:54:20 -05:00
Chris Lane e1fdca231e Merged #353 with changes
PR #353 implemented highlighting on search terms within search results.
This PR:

- Merges the above
- Makes a few modifications upon the implementation

Specifically, the new implementation no longer relies on hard-coded
escape-sequences. Instead, a new `highlight` function has been created,
which in turn attempts to defer to the `termcolors` library to colorize
the necessary text.
2019-01-11 15:46:54 -05:00
Chris Lane 6b796adaf7 README edit
Edited the addition regarding Pygments.
2019-01-11 15:13:41 -05:00
Joaquin Garmendia Cabrera 95843e4674 Updating dependencies to highlighting 2019-01-11 15:10:39 -05:00
Chris Allen Lane 2b58300d84
Merge pull request #404 from gorshkov/master
Fix url in curl cheatsheet
2019-01-11 14:20:18 -05:00
Chris Allen Lane bf1be86fb9
Merge pull request #402 from FlorianKempenich/master
Add cheatsheet for `scd`
2019-01-11 14:19:22 -05:00
Chris Allen Lane 35c4a8d639
Merge pull request #403 from sundar-raman/master
Disable colorized output when CHEATCOLORS is not "true", or not set
2019-01-11 14:13:21 -05:00
Chris Lane 6910adae90 Merge branch 'master' of github.com:chrisallenlane/cheat 2019-01-11 14:05:55 -05:00
Chris Lane b47b4bc1d1 Modified .gitignore
Added `.env` to the list of ignored files.
2019-01-11 14:05:38 -05:00
Chris Allen Lane ea7e71b002
Merge pull request #407 from idarlund/patch-2
Update ssh
2019-01-11 14:04:11 -05:00
Chris Allen Lane d576eef13b
Merge pull request #408 from idarlund/patch-3
Update scp
2019-01-11 14:03:31 -05:00
Chris Allen Lane bec516b30a
Merge pull request #409 from hutchison/master
Fixed a typo.
2019-01-11 14:02:39 -05:00
Martin Darmüntzel f0b3f8037b
Fixed a typo. 2019-01-09 15:47:49 +01:00
Idar Lund 3938032595
Update scp
scp over socks
2019-01-08 08:24:16 +01:00
Idar Lund f35cfa084e
Update ssh
added ssh over socks tunnel
2019-01-08 08:19:09 +01:00
Evgeny cdb22f310d
Fix url in curl cheatsheet 2018-12-19 21:11:54 +07:00
Sundar Raman 6d1eff16a1 Disable colorized output when CHEATCOLORS is not "true", or not set 2018-11-11 13:04:51 +08:00
Florian Kempenich 9241de04d6
Update formatting to adhere to the guideline. 2018-10-25 11:37:39 +01:00
Florian Kempenich 8ac1851a69
Add cheatsheet for `scd`
`scd` is a fantastic `oh-my-zsh` plugin to quickly jump between directories.
See here: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/scd
2018-10-25 11:34:25 +01:00
Chris Lane cccf37c284 Bumped the `patch` version number 2018-10-16 10:45:09 -04:00
Chris Allen Lane 15f70c2cc3
Merge pull request #401 from tculp/case-insensitive-search
Added a .lower() call to line when searching
2018-10-16 10:43:30 -04:00
tculp cebe3de389
Update sheets.py
Added a missing .lower() to the line
2018-10-15 12:21:52 -04:00
Chris Lane 8ec51d3194 v2.3.0
Version-bump to `v2.3.0`.
2018-10-15 10:51:11 -04:00
Chris Allen Lane 500dbbbd4a
Merge pull request #399 from tculp/case-insensitive-search
Changed search behavior to lower the search term and the lines being …
2018-10-15 10:44:57 -04:00
Chris Allen Lane 66ebae4ed5
Merge pull request #398 from ticky/patch-1
Add `tee /dev/tty` mid-pipeline example to tee
2018-10-09 11:22:43 -04:00
Chris Allen Lane 5a83a22888
Merge pull request #400 from dufferzafar/patch-1
Update pacman: command to view top recently installed packages
2018-10-09 11:19:47 -04:00
Shadab Zafar 62a2bf3c2d
Update pacman 2018-10-01 12:34:46 +05:30
Tyler Culp 4b6dc22c0a Changed search behavior to lower the search term and the lines being searched, thus providing case-insensitive search 2018-09-20 13:53:22 -04:00
Jessica Stokes cd46559250
Add `tee /dev/tty` mid-pipeline example to tee 2018-09-19 17:53:19 -07:00
Chris Allen Lane 03fb44159a
Merge pull request #394 from davidrea/patch-1
Add strikethrough to formatting
2018-09-17 09:33:35 -04:00
Chris Allen Lane f0bd3ba4e6
Merge pull request #393 from mirekfranc/for-loop-extended
for: add few more for examples, the last two are probably bash specific
2018-09-17 09:32:48 -04:00
Chris Allen Lane 72f8c88394
Merge pull request #395 from eterps/patch-1
Added insert/add line examples
2018-09-17 09:31:43 -04:00
Erik Terpstra 2fcc808e63
Added insert/add line examples
Added insert/add line examples.
2018-09-11 09:22:21 +02:00
Dave Rea 4aef22f457
Add strikethrough to formatting
(this is the one I always forget!)
2018-09-04 10:13:55 -04:00
Miroslav Franc 146b671412 add few more for examples, the last two are probably bash specific 2018-09-03 15:54:56 +02:00
Chris Allen Lane feab7a9706
Merge pull request #387 from idarlund/patch-1
Update rsync
2018-08-20 12:40:36 -04:00
Chris Allen Lane a5b0132b08
Merge pull request #385 from dsalaj/master
Add cheatsheet slurm
2018-08-20 12:21:10 -04:00
Chris Allen Lane ce1f4a099c
Merge pull request #386 from navarroaxel/lsblk
Add cheatsheet for lsblk
2018-08-20 12:16:34 -04:00
Chris Allen Lane 0e84cae79e
Merge pull request #374 from bu6hunt3r/devel
Added sheet for r2 disassembler/debugger/hex editor
2018-08-20 12:14:16 -04:00
Chris Allen Lane 93180c3852
Merge pull request #375 from shigemk2/zip
Added one more zip cheat
2018-08-20 11:50:27 -04:00
Chris Lane 795bcaffcb Merge branch 'master' of https://github.com/gigovich/cheat into gigovich-master 2018-08-20 11:40:34 -04:00
Chris Allen Lane d6f12c4397
Merge pull request #373 from kevinawoo/patch-1
new cheat for mv: moving many files into a dir
2018-08-20 11:37:14 -04:00
Chris Allen Lane 8ccc8bd546
Merge pull request #388 from pondrejk/patch-1
minor typo in nmcli command name
2018-08-20 10:48:43 -04:00
Chris Allen Lane c29a3dfdc1
Merge pull request #368 from cedric-dufour/master
New Sheet Added: ZFS (on Linux)
2018-08-20 10:45:46 -04:00
bu6hunt3r 7e94f1e0ba Changed mutt cheatsheet 2018-08-16 09:50:47 +02:00
Peter Ondrejka ff1227bca8
minor typo in command name 2018-07-24 10:05:25 +02:00
Axel Navarro b0aa272b49 Add cheatsheet for lsblk 2018-07-12 07:03:34 -03:00
idarlund 130cf1d830
Update rsync
added rsync over ssh cheat
2018-07-11 14:56:55 +02:00
Darjan Salaj f93ca8f7ce Add cheatsheet slurm 2018-07-04 23:04:18 +02:00
liuyang1 c0fe871b33 fix except case
- when redirect stdout to pipe but not tty, it throw exception.
- when have no content, it throw exception.
- remove reductant newline at end of file
2018-06-13 18:58:37 +08:00
bu6hunt3r b210fbca5f Changed r2 cheatsheet 2018-06-05 16:25:39 +02:00
bu6hunt3r 45c0dad364 Changed r2 cheatsheet 2018-05-22 09:37:17 +02:00
Givi Khojanashvili 544d11aebc Add nmcli import example. Fix typos in `nmcli add` command. 2018-03-12 13:17:22 +03:00
bu6hunt3r 51f7a42ece Started mutt mail client ch-sh 2018-03-09 18:26:10 +01:00
Michihito Shigemura cd6826d5d4 Added one more zip cheat 2018-03-08 20:39:41 +09:00
bu6hunt3r c09f0b0c6c Added sheet for r2 disassembler/debugger/hex editor 2018-03-04 20:30:27 +01:00
Kevin Woo 3fe72a03cc
new cheat for mv: moving many files into a dir 2018-02-04 18:57:25 -08:00
Cédric DUFOUR 0c0d924df6 New Sheet Added: ZFS (on Linux) 2017-12-24 16:33:37 +01:00
Chris Lane aa1e12625e Version bump to 2.2.3. 2017-12-19 12:42:07 -05:00
Chris Allen Lane d09353bfca
Merge pull request #363 from shigemk2/shigemk2-patch-1
Add cheatsheet perl
2017-12-19 12:38:25 -05:00
Chris Allen Lane 81e80c87a1
Merge pull request #358 from byxor/emacs
Add cheat for running emacs in terminal
2017-12-19 12:37:04 -05:00
Chris Allen Lane 3d498d5ce7
Merge pull request #354 from rognan/add-cheat-for-youtube-dl-extract-audio
Add cheat for downloading audio with youtube-dl
2017-12-19 12:35:11 -05:00
Chris Allen Lane d90d509702
Merge pull request #365 from shigemk2/check_function_mysql
Add cheatsheet for mysql
2017-12-19 12:34:05 -05:00
Chris Allen Lane b46f5b2c34
Merge pull request #359 from Dgc2002/master
Adds cheatsheet for rcs
2017-12-19 12:33:01 -05:00
Chris Lane e2d63e7603 Minor edits to #357 2017-12-19 12:29:52 -05:00
Chris Lane 67f52f8317 Merge branch 'patch-1' of https://github.com/zrongh90/cheat into zrongh90-patch-1 2017-12-19 12:29:26 -05:00
Chris Allen Lane 67134b9240
Merge pull request #360 from nitsnatsnok/patch-1
sizes and typo corrected
2017-12-19 12:27:29 -05:00
Chris Lane c67adb1422 Minor edits to #367. 2017-12-19 12:25:40 -05:00
Chris Lane c2aa5e0148 Merge branch 'master' of https://github.com/Sim4n6/cheat into Sim4n6-master 2017-12-19 12:24:19 -05:00
Chris Allen Lane 332f0bd4ee
Merge pull request #364 from navjotjsingh/master
Cheatsheet for cd
2017-12-19 12:21:37 -05:00
iamatacos b303bc0028 added support for Got-Your-Back for backup from Gmail 2017-12-14 15:38:08 +00:00
ALJI Mohamed 02f79ddd13
Merge pull request #1 from chrisallenlane/master
learning amigo
2017-12-14 16:09:24 +01:00
Astaroth 9c53e2ba10 improved command to export query result to csv file 2017-12-05 15:44:49 -03:00
Michihito Shigemura 71680c6586
Add cheatsheet for mysql
check stored procedure or stored function in mysql
2017-11-28 22:12:20 +09:00
Navjot Singh a240413eb9
Merge pull request #1 from navjotjsingh/navjotjsingh-patch-cd
Cheatsheet for cd
2017-11-27 11:53:39 +05:30
Navjot Singh cde64e3ea4
Cheatsheet for cd 2017-11-27 11:52:05 +05:30
Michihito Shigemura 0b0bc441c6
Add cheatsheet perl 2017-11-20 21:20:22 +09:00
Chris Allen Lane 2aa37432cb
Merge pull request #356 from shigemk2/xargs-no-run-if-empty
Add cheatsheet for xargs --no-run-if-empty
2017-11-19 08:13:07 -05:00
Chris Allen Lane 89de3705b0
Merge pull request #355 from shigemk2/curl-only-status-code
Add cheatsheet for cp backup file with date
2017-11-19 08:11:35 -05:00
Chris Lane d12718b8c4 `cp` edit
Appended missing newline to end of `cp` cheatsheet.
2017-11-19 08:09:37 -05:00
Chris Lane 900e083b99 Merge branch 'cp-backup' of git://github.com/shigemk2/cheat into shigemk2-cp-backup 2017-11-19 08:07:10 -05:00
Aroonav Mishra d048ea5a10 Enable starting the cheat python script on windows.
For this add a small batch script in the same directory as the
cheat script.
2017-11-12 18:48:04 +05:30
nitsnatsnok 837e0b5b71
sizes and typo corrected
`-size +20000k` actually matches files bigger than 20,000*1,024=20,480,000 Bytes, not 20,000,000 Bytes as in “2 Megabytes”.
2017-11-12 00:50:30 +01:00
Dave Clarke 30d2a77a6c Adds cheatsheet for rcs 2017-11-02 11:53:08 -05:00
byxor 1a8cdf84f4 Add instructions for running emacs in terminal 2017-11-01 16:16:49 +00:00
zrongh90 181403e7ac
create iconv
add new iconv for code convert
2017-10-31 16:00:16 +08:00
Michihito Shigemura 2c10955690 Add cheatsheet for xargs --no-run-if-empty 2017-10-27 00:12:36 +09:00
Michihito Shigemura 4319b8e699 Add curl cheatsheet: Get only the HTTP status code
curl -o /dev/null -w '%{http_code}\n' -s -I URL
2017-10-24 22:23:36 +09:00
Thor Andreas Rognan 57dff86a44 Add cheat for downloading audio with youtube-dl 2017-10-13 14:37:07 +02:00
sunyakun 761bf2eb2f hightlight the search keywords 2017-10-12 09:25:20 +08:00
Michihito Shigemura aa4f6daf77 Add cheatsheet for cp backup file with date 2017-10-04 23:47:33 +09:00
Chris Lane d7272c50c4 v2.2.2
Added new cheatsheets.
2017-09-16 23:15:15 -04:00
Chris Allen Lane cdf573a725 Merge pull request #318 from shanahanjrs/new-misc-cheatsheets
Created cheatsheets for alias, cat, cp, export, kill, mv, pwd, and wc
2017-09-16 23:01:08 -04:00
Chris Allen Lane eb6dfaad39 Merge pull request #350 from iamatacos/patch-1
Update dd
2017-09-16 22:58:17 -04:00
ALJI Mohamed f8d2ce516e Update dd
There is a small error in this sample :

**bs=BYTES** --> read and write up to BYTES bytes at a time

**count=N** --> copy only N input blocks

just inverse please
2017-09-16 22:04:10 +01:00
shanahanjrs e5bf9146fe Fixed cheat sheets to conform to the standard style more closely 2017-09-12 23:11:38 -04:00
Chris Lane d6dc39c687 v2.2.1
Version bump to 2.2.1. (Release contains new default cheatsheets.)
2017-09-05 14:23:10 -04:00
Chris Lane fb5ec798fa CONTRIBUTING.md
Made minor additions to the `CONTRIBUTING.md` file.
2017-09-05 13:48:06 -04:00
Chris Lane 866eb68d64 emacs cheatsheet
Minor whitespace edits on the emacs cheatsheet.
2017-09-05 13:26:23 -04:00
Chris Lane e17f60e4d5 Deleted accidental file
Deleted a file that seems to have been created accidentally. (It
contained nothing useful.)
2017-09-05 13:20:36 -04:00
Chris Lane ed2ef113f0 Merge branch 'emacs' of git://github.com/ndebuhr/cheat into ndebuhr-emacs 2017-09-05 13:19:19 -04:00
Chris Allen Lane 432379d1e6 Merge pull request #336 from yafp/master
Adding a first version of a pkill cheatsheet
2017-09-04 20:06:23 -04:00
Chris Allen Lane 7089bef7cc Merge pull request #337 from VHarisop/pip_latest
Updated pip sheet with upgrade for newer versions
2017-09-04 20:04:25 -04:00
Chris Lane aa57371819 Trivial whitespace changes to `pgrep` cheatsheet. 2017-09-04 20:01:25 -04:00
Chris Lane 921db35400 Merge branch 'pgrep' of git://github.com/shigemk2/cheat into shigemk2-pgrep 2017-09-04 20:00:38 -04:00
Chris Lane 852db958a4 Merge branch 'develop' 2017-09-04 19:57:28 -04:00
Chris Allen Lane d58bbba1f8 Merge pull request #333 from npit/master
Update emacs cheatsheet
2017-09-04 19:55:33 -04:00
Chris Allen Lane e5ffcf65e4 Merge pull request #328 from fpob/master
Add zsh cheatsheet
2017-09-04 19:54:49 -04:00
Chris Allen Lane d59ac66f1c Merge pull request #340 from Asta1986/postgres
added psql commands
2017-09-04 19:52:54 -04:00
Chris Allen Lane f4f8592933 Merge pull request #344 from Daoctor/master
fix crontab command
2017-09-04 19:50:45 -04:00
Chris Allen Lane c540a600b2 Merge pull request #343 from Mic92/patch-13
openssl: add fingerprint method
2017-09-04 19:47:49 -04:00
Chris Allen Lane 9224216581 Merge pull request #330 from shigemk2/curl-ip
Get your global IP with curl
2017-09-04 19:45:15 -04:00
Chris Allen Lane 2da5c2b710 Merge pull request #327 from Mic92/patch-12
add cryptsetup cheatsheat
2017-09-04 19:41:03 -04:00
Chris Allen Lane e468f8d0a0 Merge pull request #323 from henrikq/patch-1
Add install to Cheatsheet/deb
2017-09-04 19:39:58 -04:00
Chris Allen Lane cdee0e44cd Merge pull request #324 from dypublic/tar-add-destination-1
Update tar
2017-09-04 19:38:41 -04:00
Daoctor efcd687070 fix crontab command 2017-08-30 00:15:53 +08:00
Jörg Thalheim ae309c7dc4 openssl: add fingerprint method 2017-07-30 09:26:56 +01:00
Astaroth 86ba22e7b8 +html output 2017-06-30 21:34:32 -03:00
Astaroth 2a6ec9cef5 added psql commands 2017-06-29 20:23:47 -03:00
shigemk2 2d59026b0d Add f option 2017-06-10 01:43:11 +09:00
VHarisop bcb0d71dd3 Updated pip sheet with an upgrade option for newer versions 2017-06-02 13:09:48 +03:00
yafp d1526ede16 Adding a first version of a pkill cheatsheet 2017-06-01 21:31:27 +02:00
npit 374d381c00 Update emacs 2017-05-28 23:46:22 +03:00
shigemk2 1f3f9828c3 Add pgrep cheatsheat 2017-05-15 23:14:30 +09:00
shigemk2 5d3f89924c Get your global IP with curl 2017-05-15 23:08:21 +09:00
Filip Pobořil 74808845a5 Add zsh cheatsheet 2017-04-07 14:41:10 +02:00
Jörg Thalheim 517bf9599b add cryptsetup cheatsheat 2017-04-04 09:05:49 +02:00
Neal DeBuhr 7716827dfc Minor fixes and additions to emacs 2017-03-12 10:19:47 -04:00
daiyue c65fde1b3a Update tar
Add extract a .tar in specified Directory
2017-03-09 18:50:36 +08:00
Henrik Qvigstad bb3c4105cb Add install to Cheatsheet/deb 2017-03-07 09:50:37 +01:00
Chris Lane edd7b5e806 Minor revisions on #244
- When using GFM code fences, strip the last line in addition to the
  first
- Updated `README.md` to mention the new feature
- `minor` version-bump to `2.2.0`.
2017-02-28 18:59:27 -05:00
Chris Lane 7abb663bf4 Merge branch 'more_lexers' of git://github.com/cnicolov/cheat into cnicolov-more_lexers 2017-02-28 18:22:58 -05:00
Chris Lane f6f1233b12 Deleted `CHANGELOG`
Deleted `CHANGELOG`. It was never used.
2017-02-28 17:46:23 -05:00
Chris Lane b9241efab1 CONTRIBUTING.md
Put some useful information in `CONTRIBUTING.md`.
2017-02-28 17:45:53 -05:00
Chris Lane 8019325f1e README edit
The sheilds.io badge displaying downloads per month has been broken for
some time now (seemingly across all python projects), so I removed it.
2017-02-28 09:32:00 -05:00
Chris Lane 7209f2c929 docopt
Made revisions to the content of the docopt template.
2017-02-27 23:09:51 -05:00
Chris Lane 068d117bef patch version bump. 2017-02-27 23:02:23 -05:00
Chris Lane 9ead66461d Resolving merge conflict. 2017-02-27 23:01:30 -05:00
Chris Allen Lane d00bd87dd1 Merge pull request #312 from shanahanjrs/feature-cheat-cheat
Added a cheatsheet for cheat itself
2017-02-27 19:36:45 -05:00
Chris Allen Lane dd8b20a17a Merge pull request #317 from shanahanjrs/fix-7z-typo
Fixed typo in 7z cheatsheet
2017-02-27 19:29:58 -05:00
Chris Allen Lane 84e42e7f2f Merge pull request #314 from shanahanjrs/pushd-popd
Added cheatsheets for pushd and popd commands
2017-02-27 19:29:12 -05:00
Chris Allen Lane a59e91ead7 Merge pull request #320 from tupaschoal/master
Add cheatsheet for hg, shutdown, su
2017-02-27 19:26:58 -05:00
Tulio Leao f495a4dfd9 Add cheatsheet for su
Useful for running commands as another user.
2017-02-16 01:25:24 -02:00
Tulio Leao 10dd0e9a8b Add cheatsheet for shutdown
Adding help for shutdown, useful for rebooting the system,
2017-02-16 01:22:45 -02:00
Tulio Leao d06e5bab6f Add cheatsheet for hg
Mercurial is extensively used as a version control system, as an option to Git, so I'm adding its cheatsheet.
2017-02-16 00:04:18 -02:00
shanahanjrs aa9403d432 Created cheatsheets for alias, cat, cp, export, kill, mv, pwd, and wc 2017-02-12 22:11:45 -05:00
shanahanjrs 75b2555710 Fixed typo in 7z cheatsheet 2017-01-25 18:52:25 -05:00
shanahanjrs 632da2024a Added cheatsheets for pushd and popd commands 2017-01-08 17:11:51 -05:00
shanahanjrs 1baa6d39c0 Added a cheatsheet for cheat itself 2017-01-01 22:44:48 -05:00
Chris Lane 8cad76943a v2.1.27
`patch` version bump.
2016-11-27 11:10:05 -05:00
Romanos Skiadas a6ec02c296 Support multi-word EDITOR values
When the value of EDITOR was more than one words (e.g. emacsclient -c),
it wasn't properly split in an array for subprocess.call and cheat would
fail to launch it.
This commit fixes that.

Closes #301
2016-11-27 10:53:10 -05:00
Chris Lane 7392787e31 Merge branch 'patch-1' of https://github.com/brutus/cheat into brutus-patch-1 2016-11-27 10:42:46 -05:00
Chris Lane 208dd24a0c Minor cheatsheet edits. 2016-11-27 10:31:49 -05:00
Chris Lane df34774a7a Merge branch 'master' of https://github.com/notklaatu/cheat into notklaatu-master 2016-11-27 08:57:54 -05:00
Chris Lane 8d65424ffb README edit
Modified the README with regards to the environment variable changes
made in #294.
2016-11-27 08:54:33 -05:00
Chris Lane 597acec6ac `cheat` now honors `CHEAT_EDITOR` and `VISUAL` environment variables in
addition to `EDITOR`.
2016-11-27 08:54:33 -05:00
Chris Allen Lane 7d4150b937 Merge pull request #291 from proinsias/patch-1
Create MANIFEST.in
2016-11-27 08:53:45 -05:00
Chris Allen Lane 5df5b1ab49 Merge pull request #299 from jonlabelle/patch-1
Fix uninstall typo.
2016-11-27 08:46:55 -05:00
Chris Allen Lane f1c8017342 Merge pull request #304 from dufferzafar/sheets
Add aria2c sheet
2016-11-27 08:45:50 -05:00
Shadab Zafar 8f2912e5da Fix grammar of lsof 2016-11-27 08:43:37 -05:00
Shadab Zafar 3139796524 Update lsof sheet 2016-11-27 08:43:37 -05:00
Morgan Courbet bcd4563bf3 Add npm cheatsheet 2016-11-27 08:43:37 -05:00
rahul 5cd5387a47 Add cheery-pick to git cheat 2016-11-27 08:43:37 -05:00
rahul c8f0e6295b Add revert in git cheat 2016-11-27 08:43:37 -05:00
rahul 31e442d7f9 Add git stash cheat 2016-11-27 08:43:37 -05:00
Brutus 05400a92ed Added support for `~` and environment variables in `DEFAULT_CHEAT_DIR`
If the `DEFAULT_CHEAT_DIR` environment variable contains the `~` — as shortcut for the users home directory — or environment variables like `$HOME`, the program bails. This change allows the usage of both.
2016-11-24 16:14:37 +01:00
Shadab Zafar 034c1a2415 Add aria2c sheet 2016-10-15 00:02:45 +05:30
Jon LaBelle dab8645394 Fix uninstall type. 2016-10-02 16:23:42 -05:00
Chris Lane 352a760561 README edit
Modified the README with regards to the environment variable changes
made in #294.
2016-10-01 14:08:58 -04:00
Chris Lane 6be87e2d42 `cheat` now honors `CHEAT_EDITOR` and `VISUAL` environment variables in
addition to `EDITOR`.
2016-10-01 13:55:50 -04:00
Chris Lane 403d715127 Merge pull request #292 from rahulkavale/master
Add stash, cherry-pick, revert in git cheat
2016-09-30 20:40:20 -04:00
Chris Lane 0edd1450dc Merge pull request #293 from nagromc/npm-cheat
Add npm cheatsheet
2016-09-30 20:38:15 -04:00
Chris Lane d87a26ce4f Merge pull request #297 from dufferzafar/sheets
Update lsof sheet
2016-09-30 20:37:20 -04:00
Shadab Zafar cdf240b70e Fix grammar of lsof 2016-09-27 22:43:54 +05:30
Shadab Zafar 809c6d77bc Update lsof sheet 2016-09-27 21:23:39 +05:30
Klaatu be543450c7 Merge branch 'master' of github.com:notklaatu/cheat 2016-09-21 22:25:27 +12:00
Klaatu 9889d77adb xmlto cheatsheet 2016-09-21 22:24:47 +12:00
Klaatu 354376340f Missing man page #272 2016-09-10 14:17:01 +12:00
Morgan Courbet d82eee726c Add npm cheatsheet 2016-09-09 10:05:22 +02:00
Klaatu 9a23458a2d ffmpeg combine, add sqlite3 2016-09-09 12:05:08 +12:00
Klaatu 32802c2907 patch cheat 2016-09-04 09:48:01 +12:00
Klaatu 2a6d34de35 diff addition 2016-09-02 09:44:19 +12:00
Klaatu f1253031f2 bzip2 2016-09-01 22:28:28 +12:00
Klaatu 76fa9cfc23 urpm* mageia open mandriva 2016-09-01 22:01:01 +12:00
Klaatu 0a54b2a2ff updated emacs, ffmpeg. branched org-mode. added slack. 2016-09-01 12:10:21 +12:00
rahul 6a1742984c Add cheery-pick to git cheat 2016-08-28 08:26:55 +05:30
rahul 80d2a09456 Add revert in git cheat 2016-08-28 08:19:20 +05:30
rahul 5121fece91 Add git stash cheat 2016-08-28 08:13:08 +05:30
Francis T. O'Donovan e8d32102cb Create MANIFEST.in
I'm working on submitting this package to conda-forge. As part of this, I would like to include the license files in the MANIFEST.in for this project.
2016-08-25 20:31:13 -04:00
Chris Lane eff042d50b patch version bump 2016-08-05 15:18:52 -04:00
Chris Lane f000756f2c Resolved merge-conflict. 2016-08-05 15:15:22 -04:00
Chris Lane ef1dfb2168 Merge pull request #286 from poohzrn/master
Fix #281: Consistent description styles
2016-08-05 15:03:49 -04:00
Chris Lane 3c1b5c5860 Merge pull request #274 from ImmortalPC/master
[CHANGE] Add cheats for DD and SSH
2016-08-05 15:01:14 -04:00
Chris Lane 3494827403 Merge pull request #288 from rski/remove_prompt_function
Remove prompt_yes_or_no
2016-08-05 14:58:27 -04:00
Chris Lane f0879831c5 Merge pull request #284 from dufferzafar/ansi
Add ANSI Color Chart
2016-08-05 14:57:18 -04:00
Chris Lane 8c056d09e9 Merge pull request #285 from dufferzafar/less
Update less cheatsheet
2016-08-05 14:56:14 -04:00
Chris Lane dd8d0ae58b Merge pull request #282 from dufferzafar/master
Update git cheatsheet
2016-08-05 14:54:24 -04:00
Chris Lane 6cc99a2b6a Merge pull request #283 from dufferzafar/cpdf
Add cpdf cheatsheet
2016-08-05 14:52:47 -04:00
Shadab Zafar 70ad22c12e git: Undo parts of last commit
Added from: http://stackoverflow.com/a/4248269/2043048
2016-07-20 14:34:29 +05:30
Romanos Skiadas b28e6a84ac Remove prompt_yes_or_no
This function is not used anywhere in the code.
2016-07-19 15:16:12 +03:00
Romanos Skiadas bf4f1c80ca Style fixes
Don't use * imports, fix indentations, other small fixes
2016-07-19 14:50:51 +03:00
Lasse Nielsen 9cf1a5761d Fix #281: Consistent description styles 2016-07-18 17:25:06 +02:00
Shadab Zafar 13fdcec332 Add cheat on how to dump content of less to file 2016-07-16 18:47:19 +05:30
Shadab Zafar b2feeab4e8 Add ANSI Color Chart 2016-07-16 18:41:17 +05:30
Shadab Zafar c4b7fd507f Add cpdf cheatsheet
cpdf is a tool to slice and dice PDFs

I created this sheet on a boring day by copying text from
[here](http://www.coherentpdf.com/usage-examples.html) and then
cleaning things up a bit.
2016-07-16 18:37:12 +05:30
Shadab Zafar b77aa0974b Update git cheatsheet 2016-07-16 18:21:07 +05:30
Chris Lane 3be95142ed v2.1.25 2016-05-29 21:47:22 -04:00
Chris Lane bb324e94a4 Issue #278
Fixed a technical innacuracy in the `crontab` cheatsheet.
2016-05-29 21:03:58 -04:00
Chris Lane 7084ce2f45 Merge pull request #277 from caorong/master
origin Convert Unix timestamp to Date only works on Linux, add cheat which works on Mac
2016-05-29 21:00:57 -04:00
Chris Lane 905006f09c Merge pull request #280 from ybudimirov/ncdu
Ncdu cheatsheet
2016-05-29 20:59:16 -04:00
Chris Lane 06a368fb1f Merge pull request #276 from oliworx/patch-1
add cheatsheet for subversion (svn)
2016-05-29 20:58:16 -04:00
Yuriy Budimirov 6a9422502a Ncdu cheatsheet 2016-05-26 13:21:20 +03:00
caorong 41332f1d8a update timestamp convert cheat 2016-04-27 10:57:44 +08:00
ImmortalPC b6d54b135c [CHANGE & ADD] Removing typo from SSH. Adding tip for emacs and ssh. Adding cheat for xxd 2016-04-19 13:45:47 +02:00
Oliver Kurmis a3c682729e add cheatsheet for subversion (svn) 2016-04-13 17:27:37 +02:00
ImmortalPC f38da23741 [CHANGE] Add cheats for DD and SSH 2016-04-05 17:09:49 +02:00
Chris Lane 20d985d993 Working around failed upload
pypi responded with an HTTP 500 when uploading the last version of
`cheat`, and this seems to have caused some problems. No changes were
made in this commit other than incrementing the version number in an
attempt to resolve this.
2016-03-24 12:41:40 -04:00
Chris Lane 09f821835c v2.1.23 2016-03-24 12:39:20 -04:00
Chris Lane 7e5e4315e5 Merge pull request #268 from pierrepo/master
Add options for pip and a new cheatsheet for virtualenv
2016-03-24 12:37:17 -04:00
Chris Lane 869e7095f3 Merge pull request #269 from VirenMohindra/update-readme
trivial readme.md correction
2016-03-24 12:34:51 -04:00
Viren Mohindra 6dd8faf26a trivial readme.md correction
availble -> available
2016-03-18 03:23:30 -05:00
Pierre Poulain c0585ee55c Append virtualenvwrapper commands 2016-03-15 17:34:28 +01:00
Pierre Poulain c0d755e102 Add virtualenv 2016-03-15 17:28:07 +01:00
Pierre Poulain 49e1fc46f4 Add --user and --upgrade options 2016-03-15 17:15:06 +01:00
Chris Lane 3d90b26b04 Merge pull request #266 from MinimaxHeadroom/add-tree-mod-dd-vim-find
Add cheatsheet for command `tree`. Edits or command additions to existing cheatsheets `dd`, `find`, `vim`.
2016-03-14 14:21:55 -04:00
Chris Lane 3b73b9b06b Merge pull request #264 from JindrichPilar/master
Added xrandr cheat
2016-03-14 14:17:14 -04:00
Chris Lane 74d1bc1ec7 Merge pull request #263 from omsobliga/master
Add examples for tmux
2016-03-14 14:14:55 -04:00
Chris Lane 78c76dc75a Merge pull request #267 from VHarisop/nmcli
Added nmcli cheatsheet
2016-03-14 14:14:21 -04:00
VHarisop f204ed66e1 Added WiFi-specific commands 2016-03-11 03:41:26 +02:00
VHarisop 29c53b754d Added nmcli cheatsheet 2016-03-08 04:06:44 +02:00
mheadroom 5a7fdfcca7 Add `tree` cheatsheet. Small edits to improve clarity of, plus addition of some new commands to, `dd`, `find`, `vim`. 2016-03-04 04:35:41 -05:00
Jindrich Pilar c3f082eccf Added xrandr cheat 2016-02-22 20:59:05 +01:00
lih 808a2585ef Add example for tmux 2016-02-20 11:09:02 +08:00
Chris Lane c0aad062ec Trivial README edit. 2016-02-18 15:40:18 -05:00
Chris Lane 8ffeaa4211 README edits
- Replaced the broken PyPi badges with new ones
- Moved some content out of the README and into new wiki pages
- Applied syntax highlighting to shell examples
- Trivial content edits
2016-02-18 15:35:17 -05:00
Chris Lane c1d4c768de CONTRIBUTING.md
- Added a paragraph on licensing
- Trivial edits
2016-02-17 14:12:58 -05:00
Chris Lane a063c7bb64 Licensing
Dual-licensed `cheat` under both the GPL3 and MIT licenses.
2016-02-15 17:13:20 -05:00
Chris Lane d058ee087e Patch version bump. 2016-02-15 13:22:01 -05:00
Chris Lane 35c38be120 Merge pull request #253 from groig/master
Updated dd cheatsheet with the built-in progress functionality
2016-02-15 13:18:49 -05:00
Chris Lane cc86f23dba Merge pull request #256 from Mic92/patch-11
mount: mount iso
2016-02-15 13:17:47 -05:00
Chris Lane 54086bf8d6 Minor formatting changes to the nkf cheatsheet. 2016-02-15 13:15:53 -05:00
Chris Lane 429ed25aba Merge branch 'add-nkf-plugin' of https://github.com/shigemk2/cheat into shigemk2-add-nkf-plugin
* 'add-nkf-plugin' of https://github.com/shigemk2/cheat:
  Add nkf plugin
2016-02-15 13:14:58 -05:00
Chris Lane 128f28ac99 Merge pull request #254 from dufferzafar/sheets
Add httpie cheatsheet
2016-02-15 13:13:09 -05:00
Chris Lane 420a320839 Merge pull request #257 from cedric-dufour/master
New Sheet Added: MDADM (Linux RAID)
2016-02-15 13:11:56 -05:00
Cédric Dufour e3f435a78a New Sheet Added: MDADM (Linux RAID) 2016-01-26 08:55:36 +01:00
Jörg Thalheim dcc01bb980 mount: mount iso 2016-01-21 19:01:48 +01:00
Shadab Zafar 6f27a3e614 Add httpie cheatsheet
Converted from it's Readme: https://github.com/jkbrzt/httpie
2016-01-13 18:18:43 +05:30
Roig 36b078c9f6 Updated dd cheatsheet with the built-in progress functionality 2016-01-12 09:27:37 -05:00
shigemk2 73c1842866 Add nkf plugin 2016-01-11 13:28:25 +09:00
Chris Lane ceb3707d28 Trivial whitespace change 2016-01-04 21:54:38 -05:00
Chris Lane f9e8e041ef patch version bump. 2016-01-04 21:50:40 -05:00
Chris Lane b59e83e706 Merge pull request #245 from shigemk2/add-mysql-statements
Add Basic MySQL Statements
2016-01-04 20:17:22 -05:00
Chris Lane bfa813a0b8 Merge pull request #246 from rognan/master
Add cheat for lowercasing files and folders in current directory
2016-01-04 20:15:58 -05:00
Chris Lane c179ef64c6 Merge pull request #250 from shigemk2/add-for-plugin
Add "for" plugin
2016-01-04 20:13:21 -05:00
Chris Lane 14a4ee867e Merge pull request #219 from dufferzafar/golang
Add a golang version to the Related Projects list
2016-01-04 20:10:10 -05:00
shigemk2 70ef6239fe Add for plugin 2016-01-01 00:15:51 +09:00
Thor Andreas Rognan 1b55a238df Add cheat for lowercasing files and folders in current directory 2015-12-15 14:57:37 +01:00
shigemk2 eeb2c92576 Add Basic MySQL Statements 2015-12-06 15:11:42 +09:00
Kristiyan Nikolov c1fbeffde5 Adds support for more lexers
If you use cheat to save some programming snippets this might be useful.

For example if you have a long list of SQL Query cheats, you can do the
following:

Enter ```sql in the beginning of the file containing the cheats content.

Example file: sql
```sql

SELECT 17 & 16 = 16;
SELECT 2+4+8+16 & 1 = 0;
2015-12-02 14:47:13 +02:00
Chris Lane b6137cac8b patch version bump 2015-11-22 11:28:32 -05:00
Chris Lane 711fd02195 Trivial edit to cheatsheet 2015-11-22 11:26:15 -05:00
Chris Lane 248f5a0526 Merge branch 'master' of https://github.com/yafp/cheat into yafp-master
* 'master' of https://github.com/yafp/cheat:
  20151102 - Added 3 more cheats into the new apt cheatsheet
  20151102 - Adding a cheatsheet for at (apt vs apt-get)
2015-11-22 11:25:47 -05:00
Chris Lane 8e7ce511bd Merge pull request #242 from vyorkin/patch-1
Update docker cheat
2015-11-22 11:23:59 -05:00
Chris Lane ba7ebc8392 Merge pull request #241 from Mic92/patch-10
ping: MTU check
2015-11-22 11:23:15 -05:00
Vasiliy Yorkin 6670785a2a Update docker 2015-11-17 15:35:03 +03:00
Jörg Thalheim aabaab1185 ping: MTU check 2015-11-11 21:21:24 +01:00
Florian Pöck 22eb1f2df4 20151102 - Added 3 more cheats into the new apt cheatsheet 2015-11-02 14:51:37 +01:00
Florian Pöck a519ea163e 20151102 - Adding a cheatsheet for at (apt vs apt-get) 2015-11-02 14:28:30 +01:00
Chris Lane 6a2eda80d4 patch version bump. 2015-10-15 18:57:33 -04:00
Chris Lane 20d52376f9 Undid packaging refactoring. 2015-10-15 18:56:34 -04:00
Chris Lane 3b2848668a patch version bump. 2015-10-15 18:40:18 -04:00
Chris Lane a8f91d4224 Minor tweaks. 2015-10-15 18:37:02 -04:00
Chris Lane e0adbbc5b9 Merge branch 'setup-improvements' of https://github.com/youtux/cheat into youtux-setup-improvements
* 'setup-improvements' of https://github.com/youtux/cheat:
  Use entry_points instead of scripts in setup.py
  Improve setup.py description
  Exploit setuptools package_data to include cheats
  Use find_packages from setuptools to identify packages
  Use setuptools insted of distutils.
2015-10-15 18:33:02 -04:00
Chris Lane 905f12a279 Patch version bump. 2015-10-15 18:30:25 -04:00
Chris Lane 0c24bbbaaf Merge pull request #236 from bmaca/master
Added one more MySql cheat
2015-10-15 18:27:20 -04:00
Chris Lane baa782b8ce Merge pull request #238 from summer-wu/master
create tr cheatsheet
2015-10-15 18:26:04 -04:00
Chris Lane 740358e4c0 Merge pull request #239 from rognan/master
Add cheat for ls-command
2015-10-15 18:23:53 -04:00
thor andreas 2ebc8c9fac Add two cheats for ls-command
Display directories only
2015-10-07 20:21:01 +02:00
summer-wu f3ecf76239 Update tr 2015-10-07 21:20:06 +08:00
summer-wu 84df17a0f6 fix some typo 2015-10-07 21:14:45 +08:00
summer-wu 91c28712e6 Update tr 2015-10-07 11:39:27 +08:00
summer-wu 8eda2266bc Create tr 2015-10-07 11:34:01 +08:00
bmaca 47fd7c90f4 Added one more MySql cheat 2015-09-22 01:42:40 -05:00
Chris Lane cafa2fb2fd Version 2.1.15
Added new cheatsheets.
2015-09-09 18:06:23 -04:00
Chris Lane 9c31ba5102 Merge pull request #233 from cedric-dufour/master
A few additional cheats
2015-09-09 17:58:58 -04:00
Chris Lane da65ea32d8 Merge pull request #234 from t-stark/master
New cheatsheets
2015-09-09 17:56:52 -04:00
t-stark e1aec49ed6 modified cheatsheets 2015-09-07 20:57:17 -05:00
Blake Huber ab86ac970d new cheatsheets 2015-09-07 20:56:09 -05:00
Cedric Dufour 90f66ccaf3 (fixed typo) 2015-09-04 11:16:18 +02:00
Cedric Dufour f63406bc3e Lock file 2015-09-04 11:09:39 +02:00
Cedric Dufour b3a93bc128 Retrieve N-th piped command exit status 2015-09-04 10:16:54 +02:00
Cedric Dufour 8f0d2e9fc3 Specify output separator character 2015-09-04 10:12:46 +02:00
Cedric Dufour 4c2d0d2d8e Generate Diffie-Hellman parameters 2015-09-04 10:10:32 +02:00
Cedric Dufour ac445388d9 Keep old configuration during update 2015-09-04 10:08:42 +02:00
Cedric Dufour 705601f0b1 Added parallel (multi-threaded) processing 2015-09-04 10:06:37 +02:00
Chris Lane 2d7fdb5425 Patch version bump 2015-08-25 19:10:28 -04:00
Aravinth Panchadcharam 4512a61086 New Sheet Added: Vagrant - A portable development environment 2015-08-24 21:07:55 +02:00
Chris Lane 8096ca7f90 Version bump
2.1.13
2015-08-06 21:15:26 -04:00
Josef Glatz 511c57f582 [DOCUMENTATION] Cmd 'ssh' copy files with gzipped on the fly 2015-08-06 14:46:21 +02:00
Josef Glatz 6ca4b6c8e7 [DOCUMENTATION] Cmd 'du' cumulative size cheat 2015-08-06 14:39:22 +02:00
Chris Lane 9c696cc430 v2.1.12 2015-08-04 20:56:23 -04:00
Chris Lane 001fdb0eda Merge branch 'sheets' of https://github.com/dufferzafar/chris-cheat into dufferzafar-sheets
* 'sheets' of https://github.com/dufferzafar/chris-cheat:
  New Sheet: ffmpeg - fast audio video encoder
  Git cheats: Shallow clones & Submodule update
  Git cheats: Change date of existing commit
2015-08-04 20:55:33 -04:00
Shadab Zafar af354ba6a3 New Sheet: ffmpeg - fast audio video encoder 2015-08-03 17:51:52 +05:30
Shadab Zafar 196875a828 Git cheats: Shallow clones & Submodule update 2015-08-03 17:50:23 +05:30
Shadab Zafar 6cf69bc190 Git cheats: Change date of existing commit 2015-08-03 17:50:12 +05:30
Chris Lane 6b736083c3 v2.1.11
- Merged PR #227

- Patch version bump
2015-07-31 15:19:22 -04:00
Shadab Zafar b477df20b2 New Sheet: man - an interface to reference manuals 2015-07-24 18:54:41 +05:30
Shadab Zafar 6304a65399 New Sheet: numfmt - convert numbers from/to human-readable strings 2015-07-24 18:53:50 +05:30
Shadab Zafar bc40ced2c1 New Sheet: csplit - used to split a file into parts 2015-07-24 18:51:55 +05:30
Chris Lane 74dfd51601 Version bump 2015-07-09 18:42:00 -04:00
Chris Lane 51b0b12663 Minor addition to git cheatsheet 2015-07-09 18:41:00 -04:00
Shadab Zafar ae45265317 Two new cheats in date and ln sheets 2015-06-19 23:18:59 +05:30
Shadab Zafar 97dd037538 Fixup grammar in grep cheatsheet 2015-06-19 23:18:27 +05:30
Shadab Zafar 402d15e8d8 More git cheats 2015-06-19 23:11:48 +05:30
Chris Lane 8a07a1e96c Version bump 2015-06-18 18:30:06 -04:00
Chris Lane aa9b3e8bb4 Merge pull request #225 from Mic92/master
add zip/unzip
2015-06-18 18:19:53 -04:00
Chris Lane 9db66dbaeb Merge pull request #217 from agxcul/master
add command [more] and some more example for command [awk]
2015-06-18 18:18:56 -04:00
Chris Lane c906a394cc Merge pull request #221 from laomaiweng/cheatsheet-rpm-enhancements
`rpm` cheatsheet: small enhancements
2015-06-18 18:15:51 -04:00
Chris Lane 6ca560c1b7 Merge pull request #220 from dufferzafar/sheets
Added jq, jrnl sheets. Updated Git and Markdown.
2015-06-18 18:14:59 -04:00
Chris Lane e75e9bb211 Whitespace edit 2015-06-18 18:06:25 -04:00
Chris Lane dd93473464 Merge pull request #216 from salvorapi/master
First version of nova cheat
2015-06-18 18:05:39 -04:00
Chris Lane 0d6de64fc0 Merge pull request #224 from Mic92/patch-9
Add weechat
2015-06-18 18:02:43 -04:00
Chris Lane 26991977fd Merge pull request #222 from myfavouritekk/pip
Add the cheat sheet for pip.
2015-06-18 18:02:00 -04:00
Chris Lane 878e266f5b Merge pull request #223 from Raizo62/master
remove useless blank
2015-06-18 18:00:47 -04:00
Chris Lane 55e7181d87 Merge pull request #218 from idf-archive/master
fix typo
2015-06-18 17:59:13 -04:00
Jörg Thalheim 59accc64f7 add zip/unzip 2015-06-13 09:40:59 +02:00
Jörg Thalheim c18e475fd1 Add weechat 2015-06-08 21:03:33 +02:00
raizo62 2166a57ccd remove useless blank 2015-06-04 17:53:48 +00:00
Kai KANG b2e1400bb6 Update pip: dealing with requirement files
add `pip freeze > requirements.txt` and `pip install -r requirements.txt`.
2015-06-02 07:30:34 +08:00
Kai KANG 30a49d3596 Add the cheat sheet for pip. 2015-05-28 13:46:28 +08:00
quentin 86ba1ad9e6 cheat/cheatsheets/rpm: small enhancements 2015-05-21 23:17:34 +02:00
Shadab Zafar 820de5dba8 Add Image syntax to markdown 2015-05-20 01:46:03 +05:30
Shadab Zafar 33f0dc346b jrnl is an application to store your life journal
...in plain text files

https://github.com/maebert/jrnl
2015-05-20 01:46:03 +05:30
Shadab Zafar 889c8ef8fe Added two funky git cheats! 2015-05-20 01:46:03 +05:30
Shadab Zafar 434802341e jq is a command line json processor
Here is the awesome manual: http://stedolan.github.io/jq/manual/
2015-05-20 01:45:52 +05:30
Shadab Zafar d897a8a8ea Add a golang version to the Related Projects list 2015-05-19 22:40:24 +05:30
Daniel D. Zhang aba6fe5043 fix typo
reference: 
-O file
--output-document=file
    The documents will not be written to the appropriate files, but all will be concatenated together and
    written to file.  If - is used as file, documents will be printed to standard output, disabling link
    conversion.  (Use ./- to print to a file literally named -.)

    Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather,
    it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O -
    http://foo > file; file will be truncated immediately, and all downloaded content will be written
    there.

    For this reason, -N (for timestamp-checking) is not supported in combination with -O: since file is
    always newly created, it will always have a very new timestamp. A warning will be issued if this
    combination is used.

    Similarly, using -r or -p with -O may not work as you expect: Wget won't just download the first file
    to file and then download the rest to their normal names: all downloaded content will be placed in
    file. This was disabled in version 1.11, but has been reinstated (with a warning) in 1.11.2, as there
    are some cases where this behavior can actually have some use.

    Note that a combination with -k is only permitted when downloading a single document, as in that case
    it will just convert all relative URIs to external ones; -k makes no sense for multiple URIs when
    they're all being downloaded to a single file; -k can be used only when the output is a regular file.
2015-05-10 13:54:49 +08:00
agxcul 86d1ce58a9 add command [more] and some more example for command [awk] 2015-05-06 15:14:49 +08:00
Salvo Rapisarda fd7f31bf16 First version of nova cheat 2015-05-04 15:14:07 +02:00
Chris Lane 417f47f037 Version bump 2015-04-15 16:43:47 -04:00
Chris Lane f39fad1324 Merge pull request #212 from myfavouritekk/paste
Add a cheatsheet for paste.
2015-04-15 16:40:43 -04:00
Chris Lane 4cf03c5363 Merge pull request #211 from Aayush-Kasurde/master
Added yum list command cheat
2015-04-15 16:38:52 -04:00
Kai KANG afcd74c8bf Add cheatsheet for paste. 2015-03-31 17:52:08 +08:00
Aayush Kasurde e27ce3f1f9 Added yum list command cheat 2015-03-10 08:04:47 +05:30
Chris Lane e9b8f04c24 Bug fix
A bug was introduced in 2.1.6 that would prevent user-defined
cheatsheets from being edited more than once.
2015-02-11 21:45:32 -05:00
Chris Lane d14c759a48 Merge pull request #210 from chrisallenlane/issue-180
Issue #180
2015-02-11 21:05:12 -05:00
Chris Lane c70dc002fa Issue #180
Now, whenever a cheatsheet is to be edited, if that cheatsheet does not
exist on the `DEFAULT_SHEET_PATH`, it is first copied there before being
opened for editing. This prevents system-wide cheatsheets from being
edited when using `cheat` as `root`.
2015-02-11 21:02:45 -05:00
Chris Lane ff8ba4e717 Merge pull request #209 from chrisallenlane/edit-after-copy
Resolves #207
2015-02-10 19:37:05 -05:00
Chris Lane 718ec4f685 Resolves #207
- Solves issue whereby global cheatsheets fail to save after editing

- `cheat` no longer asks a user if a global cheatsheet should be copied
  locally before editing, and instead just silently does so.
2015-02-10 19:35:14 -05:00
Chris Lane 3d8343a878 Version bump 2015-02-09 18:10:08 -05:00
Chris Lane a5352ad9e5 Trivial edits to uniq cheatsheet 2015-02-09 18:07:17 -05:00
Chris Lane f5ee3d5e29 Merge branch 'master' of https://github.com/shigemk2/cheat into shigemk2-master
* 'master' of https://github.com/shigemk2/cheat:
  Refer sort -u
  Fix dc option
  uniq: add examples
2015-02-09 18:06:20 -05:00
Chris Lane e64babc972 Trivial edits to cheatsheets. 2015-02-09 18:05:13 -05:00
Chris Lane cd465ef84f Merge branch 'master' of https://github.com/Aayush-Kasurde/cheat into Aayush-Kasurde-master
* 'master' of https://github.com/Aayush-Kasurde/cheat:
  Added perforce commands
  Added udisksctl
  Added Journalctl commands
  Added zoneadm commands
2015-02-09 18:03:28 -05:00
Chris Lane 96e26a38d4 Added newline to end of dnf file. 2015-02-09 18:01:40 -05:00
Chris Lane 998ed00424 Merge branch 'dnf' of https://github.com/amitsaha/cheat into amitsaha-dnf
* 'dnf' of https://github.com/amitsaha/cheat:
  Add cheatsheet for dnf
2015-02-09 18:00:38 -05:00
Chris Lane 1fd03d3305 Merge pull request #205 from thylong/dpkg
Add cheat for dpkg
2015-02-09 17:58:24 -05:00
Chris Lane 77cba58599 Merge pull request #203 from amitsaha/docker_update
docker: add 'docker exec'
2015-02-09 17:57:39 -05:00
Chris Lane c5a738a8b1 Merge pull request #199 from Mic92/patch-8
ip: better route example
2015-02-09 17:56:57 -05:00
Aayush Kasurde 250a265b25 Added perforce commands 2015-01-27 22:07:43 +05:30
Amit Saha c232721119 Add cheatsheet for dnf 2015-01-22 16:30:49 +10:00
Aayush Kasurde 55492c50ac Added udisksctl 2015-01-20 21:34:11 +05:30
Théotime Lévêque d9df28e3f2 Update dpkg 2015-01-20 12:22:47 +01:00
Theotime LEVEQUE 710c7bcf70 Add cheat for dpkg 2015-01-20 01:42:26 +01:00
Aayush Kasurde efba736aee Added Journalctl commands 2015-01-18 20:03:42 +05:30
Aayush Kasurde 95774db7c5 Added zoneadm commands 2015-01-14 21:12:23 +05:30
Amit Saha da63c5d27f docker: add 'docker exec' 2015-01-13 13:51:35 +10:00
shigemk2 2e1cda114a Refer sort -u 2015-01-12 21:29:35 +09:00
shigemk2 353fe48d60 Fix dc option 2015-01-12 21:17:55 +09:00
shigemk2 a96bd229a6 uniq: add examples 2015-01-10 00:28:18 +09:00
Alessio Bogon 4d57f529c9 Use entry_points instead of scripts in setup.py
This allows a fine-grained control of the dependencies, because it generates a wrapper script
that calls the specifiend function (i.e., main inside cheat/app.py)
2015-01-09 00:36:49 +01:00
Alessio Bogon 5caa8fed38 Improve setup.py description 2015-01-09 00:22:57 +01:00
Alessio Bogon 69f91e0cf4 Exploit setuptools package_data to include cheats 2015-01-09 00:08:38 +01:00
Alessio Bogon fdbc8909cc Use find_packages from setuptools to identify packages 2015-01-08 23:58:35 +01:00
Alessio Bogon 76a91ce358 Use setuptools insted of distutils.
Distutils is old and basic, setuptools is the current preferred way.
See https://python-packaging-user-guide.readthedocs.org/en/latest/current.html
2015-01-08 23:54:12 +01:00
Chris Lane be2cb6e632 Version 2.1.3
- Added new cheatsheets
- Appended to `.gitignore`
2015-01-05 20:44:25 -05:00
Chris Lane 426b0aaa0d Merge pull request #197 from thylong/gzip
Add cheat for gzip
2015-01-05 20:39:35 -05:00
Chris Lane 9041c57d21 Merge pull request #200 from poliveira89/new_cheatsheets
New cheatsheets
2015-01-05 20:38:19 -05:00
thylong 1dd9d85509 Merge branch 'gzip' of github.com:thylong/cheat into gzip
Conflicts:
	cheat/cheatsheets/gzip
2015-01-04 13:24:52 +01:00
thylong 9506167af8 Add cheat for gzip 2015-01-04 13:23:47 +01:00
Jörg Thalheim 27482cbabd ip: better route example
Assigning a subnet is already covered in the example below. Setting a default route via a router is the most common use case of ip route IMHO.
2014-12-30 10:07:13 +01:00
Chris Lane 03bb651bf0 Version bump 2014-12-29 21:45:46 -05:00
Chris Lane c4a5ca3900 Merge pull request #198 from thylong/ssh_forward
Update cheat ssh
2014-12-29 21:37:39 -05:00
Chris Lane 03b587f538 Merge pull request #196 from Mic92/patch-7
ss
2014-12-29 21:36:59 -05:00
Chris Lane e4d7722476 Merge pull request #195 from Mic92/master
ping6
2014-12-29 21:36:18 -05:00
Chris Lane 3807aa5433 Merge pull request #194 from Mic92/patch-6
smbclient
2014-12-29 21:35:40 -05:00
thylong 956ce7fadd Update cheat ssh 2014-12-26 15:57:01 -05:00
thylong 57876ed0e7 Add cheat for gzip 2014-12-26 15:46:48 -05:00
Jörg Thalheim 58abb16ca1 ss 2014-12-24 21:42:16 +01:00
Jörg Thalheim 54e30022f0 ping6: fix typo 2014-12-24 18:08:56 +01:00
Jörg Thalheim c412cd0534 ping6 2014-12-24 12:15:03 +01:00
Jörg Thalheim 2d67038188 smbclient 2014-12-24 12:13:29 +01:00
Chris Lane 603bc360c0 Version bump 2014-12-09 20:58:15 -05:00
Chris Lane f772ef167e Merge pull request #190 from ImmortalPC/master
[NMAP] Change comment "300" => X
2014-12-09 20:39:29 -05:00
Chris Lane 2c2ab6a57f Merge pull request #191 from amitsaha/master
Add cheat for docker
2014-12-09 20:39:15 -05:00
poliveira89 61458933eb SSH cheatsheet updated: support for SSH tunnels between local host and remote host 2014-11-22 17:15:51 +00:00
poliveira89 6f579f9234 New cheatsheet added: support for Bower (frontend package manager) 2014-11-22 17:09:58 +00:00
Amit Saha 77429d9ccc Add cheat for docker 2014-10-23 14:48:25 +10:00
ImmortalPC 4ea583503b [NMAP] Change comment "300" => X 2014-10-20 19:31:31 +02:00
Chris Lane 7eb405dcf8 Merge pull request #189 from chrisallenlane/dev
Cherry-picking changes from #185
2014-10-19 11:46:27 -04:00
Chris Lane 6b8ecd6b5c Cherry-picking changes from #185
@zhujian0805 contributed some excellent cheatsheets in #185, but some
binary files seem to have gotten mixed into the commit as well. This
commit cherry-picks the cheatsheet file changes from that PR while
leaving behind the cruft.

Also performed minor editing on some of the cheatsheets.
2014-10-19 11:43:43 -04:00
Chris Lane 6efae113cf Merge branch 'master' of github.com:erikcox/cheat into erikcox-master
* 'master' of github.com:erikcox/cheat:
  Added a condition in prompt_yes_or_no() to use input or raw_input
  First attempt at making utils.py compatible with Python 2 and 3.
2014-10-19 11:02:32 -04:00
Chris Lane ed91f9fa37 Merge branch 'master' of github.com:ImmortalPC/cheat into ImmortalPC-master
* 'master' of github.com:ImmortalPC/cheat:
  [GREP,NMAP,RM,WGET] Add new cheats
2014-10-18 18:41:32 -04:00
Chris Lane 0720d0fdc2 Merge pull request #188 from Mic92/patch-5
mount: add bind mount
2014-10-18 18:38:56 -04:00
Chris Lane cb706de241 Merge pull request #183 from ihashacks/master
add debugging examples for bash, add new command route
2014-10-18 18:37:50 -04:00
Jörg Thalheim 873968903a mount: add bind mount 2014-10-12 13:16:53 +02:00
Erik Cox dde3acf109 Added a condition in prompt_yes_or_no() to use input or raw_input 2014-09-13 15:46:57 -07:00
Erik Cox d1d5d84e4c First attempt at making utils.py compatible with Python 2 and 3. 2014-09-13 15:09:40 -07:00
Brandon Pierce 41d2a810e6 add debugging examples for bash
add new command route
2014-08-13 10:49:56 -07:00
Chris Lane 28478ff257 Merge pull request #181 from laomaiweng/cheatsheets
Additional cheatsheets: rpm, hub
2014-08-11 21:34:12 -04:00
Chris Lane 111c2098c0 Merge pull request #182 from barhamd/patch-1
Never parse ls.
2014-08-11 21:30:44 -04:00
barhamd ce611eaceb Never parse ls.
http://mywiki.wooledge.org/ParsingLs

It's about the only thing I really know about bash.
2014-08-08 11:52:43 -06:00
quentin ab2d96edb4 Add new `readline` cheatsheet 2014-08-07 12:32:34 +02:00
quentin b193112a13 Add new ['hub'](https://hub.github.com/) cheatsheet 2014-08-07 12:00:48 +02:00
quentin db92b4c5d8 Add new 'rpm' cheatsheet 2014-08-07 11:59:59 +02:00
Chris Lane 8dd00d8c9b Merge pull request #179 from chrisallenlane/dev
Issue #175
2014-08-06 22:06:11 -04:00
Chris Lane f9f1c5b3e4 Issue #175
Noted `tldr` as a closely-related project in the `README`.
2014-08-06 22:04:19 -04:00
Chris Lane 6a8e3f7fc6 Version bump. 2014-08-06 22:01:06 -04:00
Chris Lane 64d331265e Merge pull request #178 from chrisallenlane/root
Issue #172
2014-08-06 21:57:36 -04:00
Chris Lane e391cf2f01 Issue #172
Previously, `cheat` would exit if run by `root`. The rationale was:

If `cheat` was run by an unprivileged user (`chris`, for example), the
`$DEFAULT_CHEAT_DIR` would default to `/home/chris/.cheat`. If cheat was
run via `sudo`, however, the `$DEFAULT_CHEAT_DIR` would suddenly be
`/root/.cheat`.

Presuming that those individual user cheat dirs actually contained cheat
sheets, this could cause confusion, because cheat sheets accessible to
one user (`chris`) would not be accessible to the other (`root`). Thus,
cheatsheets would appear and disappear, depending on which user was
running `cheat`. (This would only be an issue, of course, for cheat
sheets that existed within the respective users' cheat dirs. System-wide
cheat sheets would be unaffected.)

`cheat` was thus programmed to gracefully fail when run as `root` to
prevent that possible confusion.

However, I'm backing away from that reasoning, because:

1. It's causing a headache for real users who'd like to run `cheat` as
root

2. Other venerable programs (`vim`, etc.) suffer from the same problem,
but nobody seems to mind enough to do anything about it. Thus, I suppose
the laissez-faire approach is essentially the sanctioned "solution" to
this problem.

3. Users sufficently troubled by this confusion may rememdy the problem
manually by setting environment variables (`$DEFAULT_CHEAT_DIR`, etc.)

Thus, `cheat` no longer complains if run by `root`.

Version-bumped to 2.1.0.
2014-08-06 21:56:19 -04:00
Chris Lane 3e287e62b8 Merge pull request #174 from juliushaertl/master
Add cheat for iproute2
2014-08-06 21:23:18 -04:00
Chris Lane 13429f6148 Merge pull request #177 from ahbahlut/patch-1
Update apt-get
2014-08-06 21:22:29 -04:00
Baptiste D. f125db6f45 Update apt-get
Mistake on #7
2014-08-06 09:25:08 +02:00
ImmortalPC 22a33dc5d3 [GREP,NMAP,RM,WGET] Add new cheats 2014-07-29 18:01:04 +02:00
Julius Haertl 7bd603cf23 Add cheat for iproute2 2014-07-29 12:13:32 +02:00
Chris Lane d0324ecef3 Merge pull request #169 from chrisallenlane/tee
Added a `tee` cheatsheet
2014-06-22 17:24:39 -04:00
Chris Lane d1fb8414f8 Added a `tee` cheatsheet 2014-06-22 17:24:09 -04:00
Chris Lane 191a5e6e84 Trivial changes on jedahan/patch-1 2014-06-22 17:17:27 -04:00
Jonathan Dahan 95636f5433 Add homebrew install instructions to readme
Could close https://github.com/chrisallenlane/cheat/issues/167 , thanks @xu-cheng for making the formula
2014-06-09 00:49:19 -04:00
Chris Lane e4417b2d65 Version bump
Realized a 2.0.8 had already been pushed to PyPi, so I just
version-bumped this to 2.0.9.
2014-06-03 22:38:24 -04:00
Chris Lane eda53cccd6 Minor tweaks on PR #163
- Backed out Windows-related work in `setup.py`, because it is still
  in-progress

- Minor changes to the `README`
2014-06-03 22:34:50 -04:00
Charley Peng ccfe2a9cbd missing file in version bump 2014-05-30 12:24:39 +10:00
Charley Peng 301203f268 version bump as requested 2014-05-30 12:20:09 +10:00
Charley Peng 9cd4bdd6d7 Merge branch 'master' of github.com:chid/cheat 2014-05-30 12:18:43 +10:00
Charley Peng 7b895adee5 Merge branch 'master' of https://github.com/chrisallenlane/cheat
Conflicts:
	setup.py
2014-05-30 12:14:33 +10:00
Charley Peng b77b9e8541 Update README.md 2014-05-29 12:01:25 +10:00
Charley Peng d68fb456ba Added PyPi Badge
Added Badge
2014-05-29 11:59:40 +10:00
Chris Lane d7d033c908 Version bump 2014-05-28 21:02:27 -04:00
Chris Lane fa4b482832 Merge branch 'py3-fix' of github.com:chid/cheat into chid-py3-fix
* 'py3-fix' of github.com:chid/cheat:
  simple py3 import change
2014-05-28 21:00:52 -04:00
Chris Lane cf8893ec5f Merge pull request #165 from chrisallenlane/no-autocomplete
Resolves #160
2014-05-28 20:51:11 -04:00
Chris Lane 0a3fd3559c Resolves #160
The `setup.py` script no longer attempts to install files to privileged
system directories. (Previously, it attempted to do this in order to
enable command-line autocompletion.) In lieu of doing this within the
installer directly, I have simply included brief instructions explaining
how to configure this manually.

Version bumped accordingly.
2014-05-28 20:49:56 -04:00
Charley Peng 6a4414f538 simple py3 import change 2014-05-29 09:56:54 +10:00
Charley Peng 538aeee2b2 adding creation of batch file 2014-05-29 09:40:58 +10:00
Chris Lane 371c0af156 Trivial
Deleted an unneeded space character.
2014-05-25 23:05:26 -04:00
Chris Lane 8677e0c35a Added a CONTRIBUTING.md file
- Added a CONTRIBUTING.md file
- Corrected a small indentation error
- version bump
2014-05-25 22:19:43 -04:00
Chris Lane afcaaafbe5 Improved filesystem efficiency
Previously, `sheets.print()` would query the filesystem every time it
was invoked. This was inelegant, because it is called multiple times
every time `cheat` is executed. Thus, unnecessary calls were being made
out to the filesystem.

Now the result of that function is being buffered into a module variable
when it is executed the first time, and served from there thereafter. I
broke the "functional" paradigm to a degree by doing this, but it wasn't
worth the complexity of implementing proper memoization (decorators,
etc) for such a trivial case.

Bumped the version number accordingly.
2014-05-25 21:55:25 -04:00
Chris Lane f128167311 Version bump 2014-05-25 19:47:08 -04:00
Chris Lane 74a91aa1d4 Merge branch 'windows_setup' of github.com:chid/cheat into chid-windows_setup
* 'windows_setup' of github.com:chid/cheat:
  fix setup for Windows
2014-05-25 19:45:24 -04:00
Charley Peng 377da479e6 fix setup for Windows 2014-05-24 16:29:40 +10:00
1694 changed files with 426284 additions and 3082 deletions

23
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,23 @@
---
name: Bug report
about: Submit a bug report
title: ''
labels: 'bug'
assignees: ''
---
Thanks for submitting a bug report. Please provide the following information:
**A description of the problem**
Describe the problem here.
**cheat version info**
Please paste the output of `cheat -v` here.
**cheat configuration info**
If your bug pertains to how cheatsheets are loaded and/or displayed, please
paste here the following information:
1. The output of `cheat -d`
2. The contents of your `conf.yml` file

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

11
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: github.com/alecthomas/chroma
versions:
- 0.9.1

46
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,46 @@
---
name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
# TODO: is it possible to DRY out these jobs? Aside from `runs-on`, they are
# identical.
# See: https://github.com/actions/runner/issues/1182
build-linux:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Set up Revive (linter)
run: go get -u github.com/boyter/scc github.com/mgechev/revive
env:
GO111MODULE: "off"
- name: Build
run: make build
- name: Test
run: make test
build-osx:
runs-on: [macos-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Set up Revive (linter)
run: go get -u github.com/boyter/scc github.com/mgechev/revive
env:
GO111MODULE: "off"
- name: Build
run: make build
- name: Test
run: make test

30
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@ -0,0 +1,30 @@
---
name: CodeQL
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '45 23 * * 0'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [go]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

19
.github/workflows/homebrew.yml vendored Normal file
View File

@ -0,0 +1,19 @@
---
name: homebrew
on:
push:
tags: '*'
jobs:
homebrew:
name: Bump Homebrew formula
runs-on: ubuntu-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v1
with:
# A PR will be sent to github.com/Homebrew/homebrew-core to update
# this formula:
formula-name: cheat
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
*.pyc
build
dist
tags

View File

@ -1,3 +0,0 @@
Changelog
=========

48
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,48 @@
CONTRIBUTING
============
Do you want to contribute to `cheat`? There are a few ways to help:
#### Submit a cheatsheet ####
Do you have a witty bash one-liner to share? [Open a pull-request][pr] against
the [cheatsheets][] repository. (The `cheat` executable source code lives in
[cheat/cheat][cheat]. Cheatsheet content lives in
[cheat/cheatsheets][cheatsheets].)
#### Report a bug ####
Did you find a bug? Report it in the [issue tracker][issues]. (But before you
do, please look through the open issues to make sure that it hasn't already
been reported.)
#### Add a feature ####
Do you have a feature that you'd like to contribute? Propose it in the [issue
tracker][issues] to discuss with the maintainer whether it would be considered
for merging.
`cheat` is mostly mature and feature-complete, but may still have some room for
new features. See [HACKING.md][hacking] for a quick-start guide to `cheat`
development.
#### Add documentation ####
Did you encounter features, bugs, edge-cases, use-cases, or environment
considerations that were undocumented or under-documented? Add them to the
[wiki][]. (You may also open a pull-request against the `README`, if
appropriate.)
Do you enjoy technical writing or proofreading? Help keep the documentation
error-free and well-organized.
#### Spread the word ####
Are you unable to do the above, but still want to contribute? You can help
`cheat` simply by telling others about it. Share it with friends and coworkers
that might benefit from using it.
#### Pull Requests ####
Please open all pull-requests against the `develop` branch.
[cheat]: https://github.com/cheat/cheat
[cheatsheets]: https://github.com/cheat/cheatsheets
[hacking]: HACKING.md
[issues]: https://github.com/cheat/cheat/issues
[pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork
[wiki]: https://github.com/cheat/cheat/wiki

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
# NB: this image isn't used anywhere in the build pipeline. It exists to
# conveniently facilitate ad-hoc experimentation in a sandboxed environment
# during development.
FROM golang:1.15-alpine
RUN apk add git less make
WORKDIR /app

57
HACKING.md Normal file
View File

@ -0,0 +1,57 @@
Hacking
=======
The following is a quickstart guide for developing `cheat`.
## 1. Install system dependencies
Before you begin, you must install a handful of system dependencies. The
following are required, and must be available on your `PATH`:
- `git`
- `go` (>= 1.17 is recommended)
- `make`
The following dependencies are optional:
- `docker`
- `pandoc` (necessary to generate a `man` page)
## 2. Install utility applications
Run `make setup` to install `scc` and `revive`, which are used by various
`make` targets.
## 3. Development workflow
After your environment has been configured, your development workflow will
resemble the following:
1. Make changes to the `cheat` source code.
2. Run `make test` to run unit-tests.
3. Fix compiler errors and failing tests as necessary.
4. Run `make`. A `cheat` executable will be written to the `dist` directory.
5. Use the new executable by running `dist/cheat <command>`.
6. Run `make install` to install `cheat` to your `PATH`.
7. Run `make build-release` to build cross-platform binaries in `dist`.
8. Run `make clean` to clean the `dist` directory when desired.
You may run `make help` to see a list of available `make` commands.
### Developing with docker
It may be useful to test your changes within a pristine environment. An
Alpine-based docker container has been provided for that purpose.
If you would like to build the docker container, run:
```sh
make docker-setup
```
To shell into the container, run:
```sh
make docker-sh
```
The `cheat` source code will be mounted at `/app` within the container.
If you would like to destroy this container, you may run:
```sh
make distclean
```
[go]: https://go.dev/

79
INSTALLING.md Normal file
View File

@ -0,0 +1,79 @@
Installing
==========
`cheat` has no runtime dependencies. As such, installing it is generally
straightforward. There are a few methods available:
### Install manually
#### Unix-like
On Unix-like systems, you may simply paste the following snippet into your terminal:
```sh
cd /tmp \
&& wget https://github.com/cheat/cheat/releases/download/4.4.2/cheat-linux-amd64.gz \
&& gunzip cheat-linux-amd64.gz \
&& chmod +x cheat-linux-amd64 \
&& sudo mv cheat-linux-amd64 /usr/local/bin/cheat
```
You may need to need to change the version number (`4.4.2`) and the archive
(`cheat-linux-amd64.gz`) depending on your platform.
See the [releases page][releases] for a list of supported platforms.
#### Windows
TODO: community support is requested here. Please open a PR if you'd like to
contribute installation instructions for Windows.
### Install via `go install`
If you have `go` version `>=1.17` available on your `PATH`, you can install
`cheat` via `go install`:
```sh
go install github.com/cheat/cheat/cmd/cheat@latest
```
### Install via package manager
Several community-maintained packages are also available:
Package manager | Package(s)
---------------- | -----------
aur | [cheat][pkg-aur-cheat], [cheat-bin][pkg-aur-cheat-bin]
brew | [cheat][pkg-brew]
docker | [docker-cheat][pkg-docker]
nix | [nixos.cheat][pkg-nix]
snap | [cheat][pkg-snap]
<!--[pacman][] |-->
## Configuring
Three things must be done before you can use `cheat`:
1. A config file must be generated
2. [`cheatpaths`][cheatpaths] must be configured
3. [Community cheatsheets][community] must be downloaded
On first run, `cheat` will run an installer that will do all of the above
automatically. After the installer is complete, it is strongly advised that you
view the configuration file that was generated, as you may want to change some
of its default values (to enable colorization, change the paginator, etc).
### conf.yml ###
`cheat` is configured by a YAML file that will be auto-generated on first run.
By default, the config file is assumed to exist on an XDG-compliant
configuration path like `~/.config/cheat/conf.yml`. If you would like to store
it elsewhere, you may export a `CHEAT_CONFIG_PATH` environment variable that
specifies its path:
```sh
export CHEAT_CONFIG_PATH="~/.dotfiles/cheat/conf.yml"
```
[cheatpaths]: README.md#cheatpaths
[community]: https://github.com/cheat/cheatsheets/
[pkg-aur-cheat-bin]: https://aur.archlinux.org/packages/cheat-bin
[pkg-aur-cheat]: https://aur.archlinux.org/packages/cheat
[pkg-brew]: https://formulae.brew.sh/formula/cheat
[pkg-docker]: https://github.com/bannmann/docker-cheat
[pkg-nix]: https://search.nixos.org/packages?channel=unstable&show=cheat&from=0&size=50&sort=relevance&type=packages&query=cheat
[pkg-snap]: https://snapcraft.io/cheat
[releases]: https://github.com/cheat/cheat/releases

678
LICENSE
View File

@ -1,678 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/]
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see [http://www.gnu.org/licenses/].
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
[http://www.gnu.org/licenses/].
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
[http://www.gnu.org/philosophy/why-not-lgpl.html].

19
LICENSE.txt Normal file
View File

@ -0,0 +1,19 @@
Copyright 2013 Christopher Allen Lane
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

218
Makefile Normal file
View File

@ -0,0 +1,218 @@
# paths
makefile := $(realpath $(lastword $(MAKEFILE_LIST)))
cmd_dir := ./cmd/cheat
dist_dir := ./dist
# executables
CAT := cat
COLUMN := column
CTAGS := ctags
DOCKER := docker
GO := go
GREP := grep
GZIP := gzip --best
LINT := revive
MAN := man
MKDIR := mkdir -p
PANDOC := pandoc
RM := rm
SCC := scc
SED := sed
SORT := sort
ZIP := zip -m
docker_image := cheat-devel:latest
# build flags
BUILD_FLAGS := -ldflags="-s -w" -mod vendor -trimpath
GOBIN :=
TMPDIR := /tmp
# release binaries
releases := \
$(dist_dir)/cheat-darwin-amd64 \
$(dist_dir)/cheat-linux-386 \
$(dist_dir)/cheat-linux-amd64 \
$(dist_dir)/cheat-linux-arm5 \
$(dist_dir)/cheat-linux-arm6 \
$(dist_dir)/cheat-linux-arm64 \
$(dist_dir)/cheat-linux-arm7 \
$(dist_dir)/cheat-netbsd-amd64 \
$(dist_dir)/cheat-openbsd-amd64 \
$(dist_dir)/cheat-solaris-amd64 \
$(dist_dir)/cheat-windows-amd64.exe
## build: build an executable for your architecture
.PHONY: build
build: | clean $(dist_dir) generate fmt lint vet vendor man
$(GO) build $(BUILD_FLAGS) -o $(dist_dir)/cheat $(cmd_dir)
## build-release: build release executables
.PHONY: build-release
build-release: $(releases)
# cheat-darwin-amd64
$(dist_dir)/cheat-darwin-amd64: prepare
GOARCH=amd64 GOOS=darwin \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-linux-386
$(dist_dir)/cheat-linux-386: prepare
GOARCH=386 GOOS=linux \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-linux-amd64
$(dist_dir)/cheat-linux-amd64: prepare
GOARCH=amd64 GOOS=linux \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-linux-arm5
$(dist_dir)/cheat-linux-arm5: prepare
GOARCH=arm GOOS=linux GOARM=5 \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-linux-arm6
$(dist_dir)/cheat-linux-arm6: prepare
GOARCH=arm GOOS=linux GOARM=6 \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-linux-arm7
$(dist_dir)/cheat-linux-arm7: prepare
GOARCH=arm GOOS=linux GOARM=7 \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-linux-arm64
$(dist_dir)/cheat-linux-arm64: prepare
GOARCH=arm64 GOOS=linux \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-netbsd-amd64
$(dist_dir)/cheat-netbsd-amd64: prepare
GOARCH=amd64 GOOS=netbsd \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-openbsd-amd64
$(dist_dir)/cheat-openbsd-amd64: prepare
GOARCH=amd64 GOOS=openbsd \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-plan9-amd64
$(dist_dir)/cheat-plan9-amd64: prepare
GOARCH=amd64 GOOS=plan9 \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-solaris-amd64
$(dist_dir)/cheat-solaris-amd64: prepare
GOARCH=amd64 GOOS=solaris \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(GZIP) $@ && chmod -x $@.gz
# cheat-windows-amd64
$(dist_dir)/cheat-windows-amd64.exe: prepare
GOARCH=amd64 GOOS=windows \
$(GO) build $(BUILD_FLAGS) -o $@ $(cmd_dir) && $(ZIP) $@.zip $@ -j
# ./dist
$(dist_dir):
$(MKDIR) $(dist_dir)
.PHONY: generate
generate:
$(GO) generate $(cmd_dir)
## install: build and install cheat on your PATH
.PHONY: install
install: build
$(GO) install $(BUILD_FLAGS) $(GOBIN) $(cmd_dir)
## clean: remove compiled executables
.PHONY: clean
clean:
$(RM) -f $(dist_dir)/* $(cmd_dir)/str_config.go $(cmd_dir)/str_usage.go
## distclean: remove the tags file
.PHONY: distclean
distclean:
$(RM) -f tags
@$(DOCKER) image rm -f $(docker_image)
## setup: install revive (linter) and scc (sloc tool)
.PHONY: setup
setup:
GO111MODULE=off $(GO) get -u github.com/boyter/scc github.com/mgechev/revive
## sloc: count "semantic lines of code"
.PHONY: sloc
sloc:
$(SCC) --exclude-dir=vendor
## tags: build a tags file
.PHONY: tags
tags:
$(CTAGS) -R --exclude=vendor --languages=go
## man: build a man page
# NB: pandoc may not be installed, so we're ignoring this error on failure
.PHONY: man
man:
-$(PANDOC) -s -t man doc/cheat.1.md -o doc/cheat.1
## vendor: download, tidy, and verify dependencies
.PHONY: vendor
vendor:
$(GO) mod vendor && $(GO) mod tidy && $(GO) mod verify
## vendor-update: update vendored dependencies
vendor-update:
$(GO) get -t -u ./... && $(GO) mod vendor && $(GO) mod tidy && $(GO) mod verify
## fmt: run go fmt
.PHONY: fmt
fmt:
$(GO) fmt ./...
## lint: lint go source files
.PHONY: lint
lint: vendor
$(LINT) -exclude vendor/... ./...
## vet: vet go source files
.PHONY: vet
vet:
$(GO) vet ./...
## test: run unit-tests
.PHONY: test
test:
$(GO) test ./...
## coverage: generate a test coverage report
.PHONY: coverage
coverage:
$(GO) test ./... -coverprofile=$(TMPDIR)/cheat-coverage.out && \
$(GO) tool cover -html=$(TMPDIR)/cheat-coverage.out
## check: format, lint, vet, vendor, and run unit-tests
.PHONY: check
check: | vendor fmt lint vet test
.PHONY: prepare
prepare: | clean $(dist_dir) generate vendor fmt lint vet test
## docker-setup: create a docker image for use during development
.PHONY: docker-setup
docker-setup:
$(DOCKER) build -t $(docker_image) -f Dockerfile .
## docker-sh: shell into the docker development container
.PHONY: docker-sh
docker-sh:
$(DOCKER) run -v $(shell pwd):/app -ti $(docker_image) /bin/ash
## help: display this help text
.PHONY: help
help:
@$(CAT) $(makefile) | \
$(SORT) | \
$(GREP) "^##" | \
$(SED) 's/## //g' | \
$(COLUMN) -t -s ':'

223
README.md
View File

@ -1,5 +1,9 @@
![Workflow status](https://github.com/cheat/cheat/actions/workflows/build.yml/badge.svg)
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
@ -7,7 +11,7 @@ remember.
![The obligatory xkcd](http://imgs.xkcd.com/comics/tar.png 'The obligatory xkcd')
`cheat` depends only on `python` and `pip`.
Use `cheat` with [cheatsheets][].
Example
@ -15,114 +19,175 @@ Example
The next time you're forced to disarm a nuclear weapon without consulting
Google, you may run:
cheat tar
You will be presented with a cheatsheet resembling:
```sh
cheat tar
```
# To extract an uncompressed archive:
tar -xvf /path/to/foo.tar
You will be presented with a cheatsheet resembling the following:
```sh
# To extract an uncompressed archive:
tar -xvf '/path/to/foo.tar'
# To extract a .gz archive:
tar -xzvf /path/to/foo.tgz
tar -xzvf '/path/to/foo.tgz'
# To create a .gz archive:
tar -czvf /path/to/foo.tgz /path/to/foo/
tar -czvf '/path/to/foo.tgz' '/path/to/foo/'
# To extract a .bz2 archive:
tar -xjvf /path/to/foo.tgz
tar -xjvf '/path/to/foo.tgz'
# To create a .bz2 archive:
tar -cjvf /path/to/foo.tgz /path/to/foo/
tar -cjvf '/path/to/foo.tgz' '/path/to/foo/'
```
To see what cheatsheets are availble, run `cheat -l`.
Usage
-----
To view a cheatsheet:
```sh
cheat tar # a "top-level" cheatsheet
cheat foo/bar # a "nested" cheatsheet
```
To edit a cheatsheet:
```sh
cheat -e tar # opens the "tar" cheatsheet for editing, or creates it if it does not exist
cheat -e foo/bar # nested cheatsheets are accessed like this
```
To view the configured cheatpaths:
```sh
cheat -d
```
To list all available cheatsheets:
```sh
cheat -l
```
To list all cheatsheets that are tagged with "networking":
```sh
cheat -l -t networking
```
To list all cheatsheets on the "personal" path:
```sh
cheat -l -p personal
```
To search for the phrase "ssh" among cheatsheets:
```sh
cheat -s ssh
```
To search (by regex) for cheatsheets that contain an IP address:
```sh
cheat -r -s '(?:[0-9]{1,3}\.){3}[0-9]{1,3}'
```
Flags may be combined in intuitive ways. Example: to search sheets on the
"personal" cheatpath that are tagged with "networking" and match a regex:
```sh
cheat -p personal -t networking --regex -s '(?:[0-9]{1,3}\.){3}[0-9]{1,3}'
```
Note that, while `cheat` was designed primarily for *nix system administrators,
it is agnostic as to what content it stores. If you would like to use `cheat`
to store notes on your favorite cookie recipes, feel free.
Installing
----------
First install the required python dependencies with:
For installation and configuration instructions, see [INSTALLING.md][].
sudo pip install docopt pygments
Then, clone this repository, `cd` into it, and run:
sudo python setup.py install
Modifying Cheatsheets
---------------------
The value of `cheat` is that it allows you to create your own cheatsheets - the
defaults are meant to serve only as a starting point, and can and should be
modified.
Cheatsheets are stored in the `~/.cheat/` directory, and are named on a
per-keyphrase basis. In other words, the content for the `tar` cheatsheet lives
in the `~/.cheat/tar` file.
Provided that you have an `EDITOR` environment variable set, you may edit
cheatsheets with:
cheat -e foo
If the 'foo' cheatsheet already exists, it will be opened for editing.
Otherwise, it will be created automatically.
After you've customized your cheatsheets, I urge you to track `~/.cheat/` along
with your [dotfiles][].
Configuring
Cheatsheets
-----------
Cheatsheets are plain-text files with no file extension, and are named
according to the command used to view them:
### Setting a DEFAULT_CHEAT_DIR ###
Personal cheatsheets are saved in the `~/.cheat` directory by default, but you
can specify a different default by exporting a `DEFAULT_CHEAT_DIR` environment
variable:
```sh
cheat tar # file is named "tar"
cheat foo/bar # file is named "bar", in a "foo" subdirectory
```
export DEFAULT_CHEAT_DIR=/path/to/my/cheats
Cheatsheet text may optionally be preceeded by a YAML frontmatter header that
assigns tags and specifies syntax:
### Setting a CHEATPATH ###
You can additionally instruct `cheat` to look for cheatsheets in other
directories by exporting a `CHEATPATH` environment variable:
```
---
syntax: javascript
tags: [ array, map ]
---
// To map over an array:
const squares = [1, 2, 3, 4].map(x => x * x);
```
export CHEATPATH=/path/to/my/cheats
The `cheat` executable includes no cheatsheets, but [community-sourced
cheatsheets are available][cheatsheets]. You will be asked if you would like to
install the community-sourced cheatsheets the first time you run `cheat`.
You may, of course, append multiple directories to your `CHEATPATH`:
Cheatpaths
----------
Cheatsheets are stored on "cheatpaths", which are directories that contain
cheatsheets. Cheatpaths are specified in the `conf.yml` file.
export CHEATPATH=$CHEATPATH:/path/to/more/cheats
It can be useful to configure `cheat` against multiple cheatpaths. A common
pattern is to store cheatsheets from multiple repositories on individual
cheatpaths:
You may view which directories are on your `CHEATPATH` with `cheat -d`.
```yaml
# conf.yml:
# ...
cheatpaths:
- name: community # a name for the cheatpath
path: ~/documents/cheat/community # the path's location on the filesystem
tags: [ community ] # these tags will be applied to all sheets on the path
readonly: true # if true, `cheat` will not create new cheatsheets here
### Enabling Syntax Highlighting ###
`cheat` can apply syntax highlighting to your cheatsheets if so desired. To
enable this feature, set a `CHEATCOLORS` environment variable:
- name: personal
path: ~/documents/cheat/personal # this is a separate directory and repository than above
tags: [ personal ]
readonly: false # new sheets may be written here
# ...
```
export CHEATCOLORS=true
The `readonly` option instructs `cheat` not to edit (or create) any cheatsheets
on the path. This is useful to prevent merge-conflicts from arising on upstream
cheatsheet repositories.
If a user attempts to edit a cheatsheet on a read-only cheatpath, `cheat` will
transparently copy that sheet to a writeable directory before opening it for
editing.
Related Projects
----------------
### Directory-scoped Cheatpaths ###
At times, it can be useful to closely associate cheatsheets with a directory on
your filesystem. `cheat` facilitates this by searching for a `.cheat` folder in
the current working directory. If found, the `.cheat` directory will
(temporarily) be added to the cheatpaths.
- [lucaswerkmeister/cheats][1]: An implementation of this concept in pure bash
that also allows not only for numerical indexing of subcomands but also
supports running commands interactively.
Autocompletion
--------------
Shell autocompletion is currently available for `bash`, `fish`, and `zsh`. Copy
the relevant [completion script][completions] into the appropriate directory on
your filesystem to enable autocompletion. (This directory will vary depending
on operating system and shell specifics.)
- [jahendrie/cheat][2]: A bash-only implementation that additionally allows for
cheatsheets to be created and `grep` searched from the command-line.
([jahendrie][] contributed key ideas to this project as well.)
Additionally, `cheat` supports enhanced autocompletion via integration with
[fzf][]. To enable `fzf` integration:
- [`cheat` RubyGem][3]: A clever gem from 2006 that clearly had similar
motivations. It is unclear whether or not it is currently maintained.
1. Ensure that `fzf` is available on your `$PATH`
2. Set an envvar: `export CHEAT_USE_FZF=true`
[dotfiles]: http://dotfiles.github.io/
[jahendrie]: https://github.com/jahendrie
[1]: https://github.com/lucaswerkmeister/cheats
[2]: https://github.com/jahendrie/cheat
[3]: http://errtheblog.com/posts/21-cheat
[4]: https://github.com/chrisallenlane/cheat/pull/77
[INSTALLING.md]: INSTALLING.md
[Releases]: https://github.com/cheat/cheat/releases
[cheatsheets]: https://github.com/cheat/cheatsheets
[completions]: https://github.com/cheat/cheat/tree/master/scripts
[fzf]: https://github.com/junegunn/fzf
[go]: https://golang.org

View File

@ -1,61 +0,0 @@
#!/usr/bin/env python
"""cheat
Usage:
cheat <cheatsheet>
cheat -e <cheatsheet>
cheat -s <keyword>
cheat -l
cheat -d
cheat -v
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.
Examples:
To look up 'tar':
cheat tar
To create or edit the cheatsheet for 'foo':
cheat -e foo
Options:
-d --directories List directories on CHEATPATH
-e --edit Edit cheatsheet
-l --list List cheatsheets
-s --search Search cheatsheets for <keyword>
-v --version Print the version number
"""
# require the dependencies
from cheat import *
from cheat.utils import *
from docopt import docopt
if __name__ == '__main__':
# parse the command-line options
options = docopt(__doc__, version='cheat 2.0.2')
# list directories
if options['--directories']:
print("\n".join(sheets.paths()))
# list cheatsheets
elif options['--list']:
print(sheets.list())
# create/edit cheatsheet
elif options['--edit']:
sheet.create_or_edit(options['<cheatsheet>'])
# search among the cheatsheets
elif options['--search']:
print(colorize(sheets.search(options['<keyword>'])))
# print the cheatsheet
else:
print(colorize(sheet.read(options['<cheatsheet>'])))

92
build/embed.go Normal file
View File

@ -0,0 +1,92 @@
//go:build ignore
// +build ignore
// This script embeds `docopt.txt and `conf.yml` into the binary during at
// build time.
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
)
func main() {
// get the cwd
cwd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
// get the project root
root, err := filepath.Abs(cwd + "../../../")
if err != nil {
log.Fatal(err)
}
// specify template file information
type file struct {
In string
Out string
Method string
}
// enumerate the template files to process
files := []file{
file{
In: "cmd/cheat/docopt.txt",
Out: "cmd/cheat/str_usage.go",
Method: "usage"},
file{
In: "configs/conf.yml",
Out: "cmd/cheat/str_config.go",
Method: "configs"},
}
// iterate over each static file
for _, file := range files {
// delete the outfile
os.Remove(filepath.Join(root, file.Out))
// read the static template
bytes, err := ioutil.ReadFile(filepath.Join(root, file.In))
if err != nil {
log.Fatal(err)
}
// render the template
data := template(file.Method, string(bytes))
// write the file to the specified outpath
spath := filepath.Join(root, file.Out)
err = ioutil.WriteFile(spath, []byte(data), 0644)
if err != nil {
log.Fatal(err)
}
}
}
// template packages the
func template(method string, body string) string {
// specify the template string
t := `package main
// Code generated .* DO NOT EDIT.
import (
"strings"
)
func %s() string {
return strings.TrimSpace(%s)
}
`
return fmt.Sprintf(t, method, "`"+body+"`")
}

View File

@ -1,3 +0,0 @@
import sheet
import sheets
import utils

View File

@ -1,5 +0,0 @@
#compdef cheat
declare -a cheats
cheats=$(cheat -l | cut -d' ' -f1)
_arguments "1:cheats:(${cheats})" && return 0

View File

@ -1,9 +0,0 @@
function _cheat_autocomplete {
sheets=$(cheat -l | cut -d' ' -f1)
COMPREPLY=()
if [ $COMP_CWORD = 1 ]; then
COMPREPLY=(`compgen -W "$sheets" -- $2`)
fi
}
complete -F _cheat_autocomplete cheat

View File

@ -1,12 +0,0 @@
#completion for cheat
complete -c cheat -s h -l help -f -x --description "Display help and exit"
complete -c cheat -l edit -f -x --description "Edit <cheatsheet>"
complete -c cheat -s e -f -x --description "Edit <cheatsheet>"
complete -c cheat -s l -l list -f -x --description "List all available cheatsheets"
complete -c cheat -s d -l cheat-directories -f -x --description "List all current cheat dirs"
complete -c cheat --authoritative -f
for cheatsheet in (cheat -l | cut -d' ' -f1)
complete -c cheat -a "$cheatsheet"
complete -c cheat -o e -a "$cheatsheet"
complete -c cheat -o '-edit' -a "$cheatsheet"
end

View File

@ -1,29 +0,0 @@
7z
A file archiver with highest compression ratio
Args:
a add
d delete
e extract
l list
t test
u update
x extract with full paths
Example:
7z a -t7z -m0-lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1
-t7z 7z archive
-m0=lzma lzma method
-mx=9 level of compression = 9 (ultra)
-mfb=64 number of fast bytes for lzma = 64
-md=32m dictionary size = 32 Mb
-ms=on solid archive = on
7z exit codes:
0 normal (no errors or warnings)
1 warning (non-fatal errors)
2 fatal error
7 bad cli arguments
8 not enough memory for operation
255 process was interrupted

View File

@ -1,4 +0,0 @@
import os
def sheets_dir():
return os.path.split(__file__)

View File

@ -1,5 +0,0 @@
# send 100 requests with a concurency of 50 requests to an URL
ab -n 100 -c 50 http://www.example.com/
# send requests during 30 seconds with a concurency of 50 requests to an URL
ab -t 30 -c 50 URL http://www.example.com/

View File

@ -1,14 +0,0 @@
# Install a package
apk add $package
# Remove a package
apk del $package
# Update repos
apk update
# Upgrade all packages
apk upgrade
# Find a package
apk search $package

View File

@ -1,18 +0,0 @@
# Desc: Apparmor will protect the system by confining programs to a limited set of resources.
# To activate a profile:
sudo aa-enforce usr.bin.firefox
# OR
export _PROFILE_='usr.bin.firefox' sudo $(rm /etc/apparmor.d/disable/$_PROFILE_ ; cat /etc/apparmor.d/$_PROFILE_ | apparmor_parser -a )
# TO disable a profile:
sudo aa-disable usr.bin.firefox
# OR
export _PROFILE_='usr.bin.firefox' sudo $(ln -s /etc/apparmor.d/$_PROFILE_ /etc/apparmor.d/disable/ && apparmor_parser -R /etc/apparmor.d/$_PROFILE_)
# To list profiles loaded:
sudo aa-status
# OR
sudo apparmor_status
# List of profiles aviables: /etc/apparmor.d/

View File

@ -1,12 +0,0 @@
# To search for apt packages:
apt-cache search "whatever"
# To display package records for the named package(s):
apt-cache show pkg(s)
# To display reverse dependencies of a package
apt-cache rdepends package_name
# To display package versions, reverse dependencies and forward dependencies
# of a package
apt-cache showpkg package_name

View File

@ -1,25 +0,0 @@
# Desc: Allows to update the operating system
# To fetch package list
apt-get update
# To download and install updates without installing new package.
apt-get update
# To download and install the updates AND install new necessary packages
apt-get dist-upgrade
# Full command:
apt-get update && apt-get dist-upgrade
# To install a new package(s)
apt-get install package(s)
# Download a package without installing it. (The package will be downloaded in your current working dir)
apt-get download modsecurity-crs
# Change Cache dir and archive dir (where .deb are stored).
apt-get -o Dir::Cache="/path/to/destination/dir/" -o Dir::Cache::archives="./" install ...
# Show apt-get installed packages.
grep 'install ' /var/log/dpkg.log

View File

@ -1,15 +0,0 @@
# To search for packages:
aptitude search "whatever"
# To display package records for the named package(s):
aptitude show pkg(s)
# To install a package:
aptitude install package
# To remove a package:
aptitude remove package
# To remove unnecessary package:
aptitude autoclean

View File

@ -1,22 +0,0 @@
# To show some text in ASCII Art:
figlet Cheat
# ____ _ _
# / ___| |__ ___ __ _| |_
#| | | '_ \ / _ \/ _` | __|
#| |___| | | | __/ (_| | |_
# \____|_| |_|\___|\__,_|\__|
#
# To have some text with color and other options:
# Show with a border
toilet -F border Cheat
# Basic show (filled)
toilet Cheat
# mmm # m
# m" " # mm mmm mmm mm#mm
# # #" # #" # " # #
# # # # #"""" m"""# #
# "mmm" # # "#mm" "mm"# "mm
#

View File

@ -1,17 +0,0 @@
# To connect to a running Asterisk session:
asterisk -rvvv
# To issue a command to Asterisk from the shell:
asterisk -rx "<command>"
# To originate an echo call from a SIP trunk on an Asterisk server, to a specified number:
asterisk -rx "channel originate SIP/<trunk>/<number> application echo"
# To print out the details of SIP accounts:
asterisk -rx "sip show peers"
# To print out the passwords of SIP accounts:
asterisk -rx "sip show users"
# To print out the current active channels:
asterisk -rx "core show channels"

View File

@ -1,17 +0,0 @@
# To schedule a one time task
at {time}
{command 0}
{command 1}
Ctrl-d
# {time} can be either
now | midnight | noon | teatime (4pm)
HH:MM
now + N {minutes | hours | days | weeks}
MM/DD/YY
# To list pending jobs
atq
# To remove a job (use id from atq)
atrm {id}

View File

@ -1,2 +0,0 @@
# sum integers from a file or stdin, one integer per line:
printf '1\n2\n3\n' | awk '{ sum += $1} END {print sum}'

View File

@ -1,14 +0,0 @@
# To implement a for loop:
for file in `ls .`;
do
echo $file found;
done
# To implement a case command:
case "$1"
in
0) echo "zero found";;
1) echo "one found";;
2) echo "two found";;
3*) echo "something beginning with 3 found";;
esac

View File

@ -1,36 +0,0 @@
# Add execute for all (myscript.sh)
chmod a+x myscript.sh
# Set user to read/write/execute, group/global to read only (myscript.sh), symbolic mode
chmod u=rwx, go=r myscript.sh
# Remove write from user/group/global (myscript.sh), symbolic mode
chmod a-w myscript.sh
# Remove read/write/execute from user/group/global (myscript.sh), symbolic mode
chmod = myscript.sh
# Set user to read/write and group/global read (myscript.sh), octal notation
chmod 644 myscript.sh
# Set user to read/write/execute and group/global read/execute (myscript.sh), octal notation
chmod 755 myscript.sh
# Set user/group/global to read/write (myscript.sh), octal notation
chmod 666 myscript.sh
# Roles
u - user (owner of the file)
g - group (members of file's group)
o - global (all users who are not owner and not part of group)
a - all (all 3 roles above)
# Numeric representations
7 - full (rwx)
6 - read and write (rw-)
5 - read and execute (r-x)
4 - read only (r--)
3 - write and execute (-wx)
2 - write only (-w-)
1 - execute only (--x)
0 - none (---)

View File

@ -1,11 +0,0 @@
# Change file owner
chown user file
# Change file owner and group
chown user:group file
# Change owner recursively
chown -R user directory
# Change ownership to match another file
chown --reference=/path/to/ref_file file

View File

@ -1,19 +0,0 @@
# To resize an image to a fixed width and proportional height:
convert original-image.jpg -resize 100x converted-image.jpg
# To resize an image to a fixed height and proportional width:
convert original-image.jpg -resize x100 converted-image.jpg
# To resize an image to a fixed width and height:
convert original-image.jpg -resize 100x100 converted-image.jpg
# To resize an image and simultaneously change its file type:
convert original-image.jpg -resize 100x converted-image.png
# To resize all of the images within a directory:
# To implement a for loop:
for file in `ls original/image/path/`;
do new_path=${file%.*};
new_file=`basename $new_path`;
convert $file -resize 150 conerted/image/path/$new_file.png;
done

View File

@ -1,20 +0,0 @@
# set a shell
SHELL=/bin/bash
# crontab format
* * * * * command_to_execute
- - - - -
| | | | |
| | | | +- day of week (0 - 7) (where sunday is 0 and 7)
| | | +--- month (1 - 12)
| | +----- day (1 - 31)
| +------- hour (0 - 23)
+--------- minute (0 - 59)
# example entries
# every 15 min
*/15 * * * * /home/user/command.sh
# every midnight
0 * * * * /home/user/command.sh
# every Saturday at 8:05 AM
5 8 * * 6 /home/user/command.sh

View File

@ -1,35 +0,0 @@
# Download a single file
curl http://path.to.the/file
# Download a file and specify a new filename
curl http://example.com/file.zip -o new_file.zip
# Download multiple files
curl -O URLOfFirstFile -O URLOfSecondFile
# Download all sequentially numbered files (1-24)
curl http://example.com/pic[1-24].jpg
# Download a file and pass HTTP Authentication
curl -u username:password URL
# Download a file with a Proxy
curl -x proxysever.server.com:PORT http://addressiwantto.access
# Download a file from FTP
curl -u username:password -O ftp://example.com/pub/file.zip
# Get an FTP directory listing
curl ftp://username:password@example.com
# Resume a previously failed download
curl -C - -o partial_file.zip http://example.com/file.zip
# Fetch only the HTTP headers from a response
curl -I http://example.com
# Fetch your external IP and network info as JSON
curl http://ifconfig.me/all/json
# Limit the rate of a download
curl --limit-rate 1000B -O http://path.to.the/file

View File

@ -1,2 +0,0 @@
# To cut out the third field of text or stdoutput that is delimited by a #:
cut -d# -f3

View File

@ -1,2 +0,0 @@
# Printout date in format suitable for affixing to file names
date +"%Y%m%d_%H%M%S"

View File

@ -1,17 +0,0 @@
# Read from {/dev/urandom} 2*512 Bytes and put it into {/tmp/test.txt}
# Note: At the first iteration, we read 512 Bytes.
# Note: At the second iteration, we read 512 Bytes.
dd if=/dev/urandom of=/tmp/test.txt count=512 bs=2
# Watch the progress of 'dd'
dd if=/dev/zero of=/dev/null bs=4KB &; export dd_pid=`pgrep '^dd'`; while [[ -d /proc/$dd_pid ]]; do kill -USR1 $dd_pid && sleep 1 && clear; done
# Watch the progress of 'dd' with `pv` and `dialog` (apt-get install pv dialog)
(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0
# Watch the progress of 'dd' with `pv` and `zenity` (apt-get install pv zenity)
(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | zenity --title 'Running dd command (cloning), please wait...' --progress
# DD with "graphical" return
dcfldd if=/dev/zero of=/dev/null bs=500K

View File

@ -1,2 +0,0 @@
# Printout disk free space in a human readable format
df -h

View File

@ -1,10 +0,0 @@
# To release the current IP address:
sudo dhclient -r
# To obtain a new IP address:
sudo dhclient
# Running the above in sequence is a common way of refreshing an IP.
# To obtain a new IP address for a specific interface:
sudo dhclient eth0

View File

@ -1,23 +0,0 @@
# To view the differences between two files:
diff -u version1 version2
# To view the differences between two directories:
diff -ur folder1/ folder2/
# To ignore the white spaces:
diff -ub version1 version2
# To ignore the blank lines:
diff -uB version1 version2
# To ignore the differences between uppercase and lowercase:
diff -ui version1 version2
# To report whether the files differ:
diff -q version1 version2
# To report whether the files are identical:
diff -s version1 version2
# To diff the output of two commands or scripts:
diff <(command1) <(command2)

View File

@ -1,29 +0,0 @@
# INSTALL
# ==============================================================================
# Edit /etc/default/distcc and set theses vars
# STARTDISTCC="true"
# ALLOWEDNETS="127.0.0.1 192.168.1.0/24"# Your computer and local computers
# #LISTENER="127.0.0.1"# Comment it
# ZEROCONF="true"# Auto configuration
# REMEMBER 1:
# Start/Restart your distccd servers before using one of these commands.
# service distccd start
# REMEMBER 2:
# Do not forget to install on each machine DISTCC.
# No need to install libs ! Only main host need libs !
# USAGE
# ==============================================================================
# Run make with 4 thread (a cross network) in auto configuration.
# Note: for gcc, Replace CXX by CC and g++ by gcc
ZEROCONF='+zeroconf' make -j4 CXX='distcc g++'
# Run make with 4 thread (a cross network) in static configuration (2 ip)
# Note: for gcc, Replace CXX by CC and g++ by gcc
DISTCC_HOSTS='127.0.0.1 192.168.1.69' make -j4 CXX='distcc g++'
# Show hosts aviables
ZEROCONF='+zeroconf' distcc --show-hosts

View File

@ -1,70 +0,0 @@
# Basic usage
Indent Select text then press TAB
Cut CTRL-w
Copy ALT-w
Paste CTRL-y
Search/Find CTRL-s
Replace ALT-% (ALT-SHIFT-5)
Save CTRL-x CTRL-s
Load/Open CTRL-x CTRL-f
Undo CTRL-x u
Highlight all text CTRL-x h
Directory listing CTRL-x d
Cancel a command ESC ESC ESC
Font size bigger CTRL-x CTRL-+
Font size smaller CTRL-x CTRL--
# Buffers
Split screen vertically CTRL-x 2
Split screen vertically with 5 row height CTRL-u 5 CTRL-x 2
Split screen horizontally CTRL-x 3
Split screen horizontally with 24 column width CTRL-u 24 CTRL-x 3
Revert to single screen CTRL-x 1
Hide the current screen CTRL-x 0
Kill the current screen CTRL-x k
Move to the next buffer CTRL-x O
Select a buffer CTRL-x b
Run command in the scratch buffer CTRL-x CTRL-e
# Other stuff
Open a shell ALT-x eshell
Goto a line number ALT-x goto-line
Word wrap ALT-x toggle-word-wrap
Spell checking ALT-x flyspell-mode
Line numbers ALT-x linum-mode
Toggle line wrap ALT-x visual-line-mode
Compile some code ALT-x compile
List packages ALT-x package-list-packages
# Sudoing within eshell
By default when using the sudo command within eshell you'll just
get "permission denied" messages. To overcome that type:
alias sudo '*sudo $*'
# Line numbers
To add line numbers and enable moving to a line with CTRL-l:
(global-set-key "\C-l" 'goto-line)
(add-hook 'find-file-hook (lambda () (linum-mode 1)))
# Org-mode
To begin org-mode ALT-x org-mode
Table column separator Vertical/pipe character
Reorganize table TAB
Section heading *
Open/collapse section TAB
Open/collapse All CTRL-TAB
Export in other file formats (eg HTML,PDF) CTRL-c CTRL-e
To make org-mode automatically wrap lines:
(add-hook 'org-mode-hook
'(lambda ()
(visual-line-mode 1)))

View File

@ -1,44 +0,0 @@
# To find files by case-insensitive extension (ex: .jpg, .JPG, .jpG):
find . -iname "*.jpg"
# To find directories:
find . -type d
# To find files:
find . -type f
# To find files by octal permission:
find . -type f -perm 777
# To find files with setuid bit set:
find . -xdev \( -perm -4000 \) -type f -print0 | xargs -0 ls -l
# To find files with extension '.txt' and remove them:
find ./path/ -name '*.txt' -exec rm '{}' \;
# To find files with extension '.txt' and look for a string into them:
find ./path/ -name '*.txt' | xargs grep 'string'
# To find files with size bigger than 5 Mb and sort them by size:
find ./ -size +5M -type f -print0 | xargs -0 ls -Ssh
# To find files bigger thank 2 MB and list them:
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
# To find files modified more than 7 days ago and list file information
find . -type f -mtime +7d -ls
# To find symlinks owned by a user and list file information
find . -type l --user=username -ls
# To search for and delete empty directories
find . -type d -empty -exec rmdir {} \;
# To search for directories named build at a max depth of 2 directories
find . -maxdepth 2 -name build -type d
# To search all files who are not in .git directory
find . ! -iwholename '*.git*' -type f
# Find all files that have the same node (hard link) as MY_FILE_HERE
find / -type f -samefile MY_FILE_HERE 2>/dev/null

View File

@ -1,21 +0,0 @@
# Compile a file
gcc file.c
# Compile a file with a custom output
gcc -o file file.c
# Debug symbols
gcc -g
# Debug with all symbols.
gcc -ggdb3
# Build for 64 bytes
gcc -m64
# Include the directory {/usr/include/myPersonnal/lib/} to the list of path for #include <....>
# With this option, no warning / error will be reported for the files in {/usr/include/myPersonnal/lib/}
gcc -isystem /usr/include/myPersonnal/lib/
# Build a GUI for windows (Mingw) (Will disable the term/console)
gcc -mwindows

View File

@ -1,26 +0,0 @@
# start the debugger
gdb your-executable
# set a breakpoint
b some-method, break some-method
# run the program
r, run
# when a breakpoint was reached:
# run the current line, stepping over any invocations
n, next
# run the current line, stepping into any invocations
s, step
# print a stacktrace
bt, backtrace
# evaluate an expression and print the result
p length=strlen(string)
# list surrounding source code
l, list
# continue execution
c, continue
# exit gdb (after program terminated)
q, quit

View File

@ -1,53 +0,0 @@
# To set your identify:
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
# To set your editor:
git config --global core.editor emacs
# To enable color:
git config --global color.ui true
# To stage all changes for commit:
git add --all
# To commit staged changes
git commit -m "Your commit message"
# To edit previous commit message
git commit --amend
# To removed staged and working directory changes
git reset --hard
# To remove untracked files
git clean -f -d
# To remove untracked and ignored files
git clean -f -d -x
# To push to the tracked master branch:
git push origin master
# To push to a specified repository:
git push git@github.com:username/project.git
# To delete the branch "branch_name"
git branch -D branch_name
# To see who commited which line in a file
git blame filename
# To sync a fork with the master repo:
git remote add upstream git@github.com:name/repo.git # Set a new repo
git remote -v # Confirm new remote repo
git fetch upstream # Get branches
git branch -va # List local - remote branches
git checkout master # Checkout local master branch
git checkout -b new_branch # Create and checkout a new branch
git merge upstream/master # Merge remote into local repo
git show 83fb499 # Show what a commit did.
git show 83fb499:path/fo/file.ext # Shows the file as it appeared at 83fb499.
git diff branch_1 branch_2 # Check difference between branches
git log # Show all the commits
git status # Show the changes from last commit

View File

@ -1,173 +0,0 @@
# Create a key
gpg --gen-key
# Show keys
To list a summary of all keys
gpg --list-keys
To show your public key
gpg --armor --export
To show the fingerprint for a key
gpg --fingerprint KEY_ID
# Search for keys
gpg --search-keys 'user@emailaddress.com'
# To Encrypt a File
gpg --encrypt --recipient 'user@emailaddress.com' example.txt
# To Decrypt a File
gpg --output example.txt --decrypt example.txt.gpg
# Export keys
gpg --output ~/public_key.txt --armor --export KEY_ID
gpg --output ~/private_key.txt --armor --export-secret-key KEY_ID
Where KEY_ID is the 8 character GPG key ID.
Store these files to a safe location, such as a USB drive, then
remove the private key file.
shred -zu ~/private_key.txt
# Import keys
Retrieve the key files which you previously exported.
gpg --import ~/public_key.txt
gpg --allow-secret-key-import --import ~/private_key.txt
Then delete the private key file.
shred -zu ~/private_key.txt
# Revoke a key
Create a revocation certificate.
gpg --output ~/revoke.asc --gen-revoke KEY_ID
Where KEY_ID is the 8 character GPG key ID.
After creating the certificate import it.
gpg --import ~/revoke.asc
Then ensure that key servers know about the revokation.
gpg --send-keys KEY_ID
# Signing and Verifying files
If you're uploading files to launchpad you may also want to include
a GPG signature file.
gpg -ba filename
or if you need to specify a particular key:
gpg --default-key <key ID> -ba filename
This then produces a file with a .asc extension which can be uploaded.
If you need to set the default key more permanently then edit the
file ~/.gnupg/gpg.conf and set the default-key parameter.
To verify a downloaded file using its signature file.
gpg --verify filename.asc
# Signing Public Keys
Import the public key or retrieve it from a server.
gpg --keyserver <keyserver> --recv-keys <Key_ID>
Check its fingerprint against any previously stated value.
gpg --fingerprint <Key_ID>
Sign the key.
gpg --sign-key <Key_ID>
Upload the signed key to a server.
gpg --keyserver <keyserver> --send-key <Key_ID>
# Change the email address associated with a GPG key
gpg --edit-key <key ID>
adduid
Enter the new name and email address. You can then list the addresses with:
list
If you want to delete a previous email address first select it:
uid <list number>
Then delete it with:
deluid
To finish type:
save
Publish the key to a server:
gpg --send-keys <key ID>
# Creating Subkeys
Subkeys can be useful if you don't wish to have your main GPG key
installed on multiple machines. In this way you can keep your
master key safe and have subkeys with expiry periods or which may be
separately revoked installed on various machines. This avoids
generating entirely separate keys and so breaking any web of trust
which has been established.
gpg --edit-key <key ID>
At the prompt type:
addkey
Choose RSA (sign only), 4096 bits and select an expiry period.
Entropy will be gathered.
At the prompt type:
save
You can also repeat the procedure, but selecting RSA (encrypt only).
To remove the master key, leaving only the subkey/s in place:
gpg --export-secret-subkeys <subkey ID> > subkeys
gpg --export <key ID> > pubkeys
gpg --delete-secret-key <key ID>
Import the keys back.
gpg --import pubkeys subkeys
Verify the import.
gpg -K
Should show sec# instead of just sec.

View File

@ -1,26 +0,0 @@
# Basic:
grep pattern file
# case nonsensitive research:
grep -i pattern file
# Recursively grep for string <pattern> in folder:
grep -R pattern folder
# Getting pattern from file (one by line):
grep -f pattern_file file
# Find lines NOT containing pattern
grep -v pattern file
# You can grep with regular expressions
grep "^00" file #Match lines starting with 00
grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" file #Find IP add
# Find all files who contain {pattern} in the directory {directory}.
# This will show: "file:line my research"
grep -rnw 'directory' -e "pattern"
# Exclude grep from your grepped output of ps.
# Add [] to the first letter. Ex: sshd -> [s]shd
ps aux | grep '[h]ttpd'

View File

@ -1,3 +0,0 @@
# To reduce the size of a pdf file:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf

View File

@ -1,8 +0,0 @@
# To show the first 10 lines of file
head file
# To show the first N lines of file
head -n N file
# To show the first N bytes of file
head -c N file

View File

@ -1,3 +0,0 @@
# To see most used top 10 commands:
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10

View File

@ -1,14 +0,0 @@
# Display network settings of the first ethernet adapter
ifconfig wlan0
# Display all interfaces, even if down
ifconfig -a
# Take down / up the wireless adapter
ifconfig wlan0 {up|down}
# Set a static IP and netmask
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
# You may also need to add a gateway IP
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1

View File

@ -1,2 +0,0 @@
# format C/C++ source according to the style of Kernighan and Ritchie (K&R), no tabs, 3 spaces per indent, wrap lines at 120 characters.
indent -i3 -kr -nut -l120

View File

@ -1,40 +0,0 @@
# Show hit for rules with auto refresh
watch --interval 0 'iptables -nvL | grep -v "0 0"'
# Show hit for rule with auto refresh and highlight any changes since the last refresh
watch -d -n 2 iptables -nvL
# Block the port 902 and we hide this port from nmap.
iptables -A INPUT -i eth0 -p tcp --dport 902 -j REJECT --reject-with icmp-port-unreachable
# Note, --reject-with accept:
# icmp-net-unreachable
# icmp-host-unreachable
# icmp-port-unreachable <- Hide a port to nmap
# icmp-proto-unreachable
# icmp-net-prohibited
# icmp-host-prohibited or
# icmp-admin-prohibited
# tcp-reset
# Add a comment to a rule:
iptables ... -m comment --comment "This rule is here for this reason"
# To remove or insert a rule:
# 1) Show all rules
iptables -L INPUT --line-numbers
# OR iptables -nL --line-numbers
# Chain INPUT (policy ACCEPT)
# num target prot opt source destination
# 1 ACCEPT udp -- anywhere anywhere udp dpt:domain
# 2 ACCEPT tcp -- anywhere anywhere tcp dpt:domain
# 3 ACCEPT udp -- anywhere anywhere udp dpt:bootps
# 4 ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
# 2.a) REMOVE (-D) a rule. (here an INPUT rule)
iptables -D INPUT 2
# 2.b) OR INSERT a rule.
iptables -I INPUT {LINE_NUMBER} -i eth1 -p tcp --dport 21 -s 123.123.123.123 -j ACCEPT -m comment --comment "This rule is here for this reason"

View File

@ -1,26 +0,0 @@
# To connect to an IRC server
/connect <server domain name>
# To join a channel
/join #<channel name>
# To set a nickname
/nick <my nickname>
# To send a private message to a user
/msg <nickname>
# To close the current channel window
/wc
# To switch between channel windows
ALT+<number>, eg. ALT+1, ALT+2
# To list the nicknames within a channel
/names
# To change the topic
/topic <description>
# To quit irssi
/exit

View File

@ -1,8 +0,0 @@
# Display wireless settings of the first wireless adapter
iwconfig wlan0
# Take down / up the wireless adapter
iwconfig wlan0 txpower {on|auto|off}
# Change the mode of the wireless adapter
iwconfig wlan0 mode {managed|ad-hoc|monitor}

View File

@ -1,21 +0,0 @@
# Actively follow log (like tail -f)
journalctl -f
# Display all errors since last boot
journalctl -b -p err
# Filter by time period
journalctl --since=2012-10-15 --until="2011-10-16 23:59:59"
# Show list of systemd units logged in journal
journalctl -F _SYSTEMD_UNIT
# Filter by specific unit
journalctl -u dbus
# Filter by executable name
journalctl /usr/bin/dbus-daemon
# Filter by PID
journalctl _PID=123

View File

@ -1,2 +0,0 @@
# To disable the terminal refresh when exiting
less -X

View File

@ -1,2 +0,0 @@
# To create a symlink:
ln -s path/to/the/target/directory name-of-symlink

View File

@ -1,11 +0,0 @@
# Displays everything in the target directory
ls path/to/the/target/directory
# Displays everything including hidden files
ls -a
# Displays all files, along with the size (with unit suffixes) and timestamp
ls -lh
# Display files, sorted by size
ls -S

View File

@ -1,23 +0,0 @@
# List all IPv4 network files
sudo lsof -i4
# List all IPv6 network files
sudo lsof -i6
# To find listening ports:
lsof -Pnl +M -i4
# To find which program is using the port 80:
lsof -i TCP:80
# List all processes accessing a particular file/directory
lsof </path/to/file>
# List all files open for a particular user
lsof -u <username>
# List all files/network connections a given process is using
lsof -c <command-name>
# See this primer: http://www.danielmiessler.com/study/lsof/
# for a number of other useful lsof tips

View File

@ -1,41 +0,0 @@
# headers
h1 header
=========
h2 header
---------
# blockquotes
> first level and paragraph
>> second level and first paragraph
>
> first level and second paragraph
# lists
## unordered - use *, +, or -
* Red
* Green
* Blue
## ordered
1. First
2. Second
3. Third
# code - use 4 spaces/1 tab
regular text
code code code
or:
Use the `printf()` function
# hr's - three or more of the following
***
---
___
# links
This is [an example](http://example.com "Title") inline link.
# emphasis
*em* _em_
**strong** __strong__

View File

@ -1,9 +0,0 @@
# Create a directory and all its parents
mkdir -p foo/bar/baz
# Create foo/bar and foo/baz directories
mkdir -p foo/{bar,baz}
# Create the foo/bar, foo/baz, foo/baz/zip and foo/baz/zap directories
mkdir -p foo/{bar,baz/{zip,zap}}

View File

@ -1,8 +0,0 @@
# To mount / partition as read-write in repair mode:
mount -o remount,rw /
# To mount Usb disk as user writable:
mount -o uid=username,gid=usergroup /dev/sdx /mnt/xxx
# To mount a remote NFS directory
mount -t nfs example.com:/remote/example/dir /local/example/dir

View File

@ -1,14 +0,0 @@
# To connect to a database
mysql -h localhost -u root -p
# To backup all databases
mysqldump --all-databases --all-routines -u root -p > ~/fulldump.sql
# To restore all databases
mysql -u root -p < ~/fulldump.sql
# To create a database in utf8 charset
CREATE DATABASE owa CHARACTER SET utf8 COLLATE utf8_general_ci;
# To add a user and give rights on the given database
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;

View File

@ -1,23 +0,0 @@
# To dump a database to a file (Note that your password will appear in your command history!):
mysqldump -uusername -ppassword the-database > db.sql
# To dump a database to a file:
mysqldump -uusername -p the-database > db.sql
# To dump a database to a .tgz file (Note that your password will appear in your command history!):
mysqldump -uusername -ppassword the-database | gzip -9 > db.sql
# To dump a database to a .tgz file:
mysqldump -uusername -p the-database | gzip -9 > db.sql
# To dump all databases to a file (Note that your password will appear in your command history!):
mysqldump -uusername -ppassword --all-databases > all-databases.sql
# To dump all databases to a file:
mysqldump -uusername -p --all-databases > all-databases.sql
# To export the database structure only:
mysqldump --no-data -uusername -p the-database > dump_file
# To export the database data only:
mysqldump --no-create-info -uusername -p the-database > dump_file

View File

@ -1,30 +0,0 @@
# Connect mode (ncat is client) | default port is 31337
ncat <host> [<port>]
# Listen mode (ncat is server) | default port is 31337
ncat -l [<host>] [<port>]
# Transfer file (closes after one transfer)
ncat -l [<host>] [<port>] < file
# Transfer file (stays open for multiple transfers)
ncat -l --keep-open [<host>] [<port>] < file
# Receive file
ncat [<host>] [<port>] > file
# Brokering | allows for multiple clients to connect
ncat -l --broker [<host>] [<port>]
# Listen with SSL | many options, use ncat --help for full list
ncat -l --ssl [<host>] [<port>]
# Access control
ncat -l --allow <ip>
ncat -l --deny <ip>
# Proxying
ncat --proxy <proxyhost>[:<proxyport>] --proxy-type {http | socks4} <host>[<port>]
# Chat server | can use brokering for multi-user chat
ncat -l --chat [<host>] [<port>]

View File

@ -1,28 +0,0 @@
# WARNING ! netstat is deprecated. Look below.
# To view which users/processes are listening to which ports:
sudo netstat -lnptu
# To view routing table (use -n flag to disable DNS lookups):
netstat -r
# Which process is listening to port <port>
netstat -pln | grep <port> | awk '{print $NF}'
Example output: 1507/python
# Fast display of ipv4 tcp listening programs
sudo netstat -vtlnp --listening -4
# WARNING ! netstat is deprecated.
# Replace it by:
ss
# For netstat-r
ip route
# For netstat -i
ip -s link
# For netstat-g
ip maddr

View File

@ -1,57 +0,0 @@
# Single target scan:
nmap [target]
# Scan from a list of targets:
nmap -iL [list.txt]
# iPv6:
nmap -6 [target]
# OS detection:
nmap -O --osscan_guess [target]
# Save output to text file:
nmap -oN [output.txt] [target]
# Save output to xml file:
nmap -oX [output.xml] [target]
# Scan a specific port:
nmap -source-port [port] [target]
# Do an aggressive scan:
nmap -A [target]
# Speedup your scan:
nmap -T5 --min-parallelism=50 [target]
# Traceroute:
nmap -traceroute [target]
# Ping scan only: -sP
# Don't ping: -PN
# TCP SYN ping: -PS
# TCP ACK ping: -PA
# UDP ping: -PU
# ARP ping: -PR
# Example: Ping scan all machines on a class C network
nmap -sP 192.168.0.0/24
# Use some script:
nmap --script default,safe
# Loads the script in the default category, the banner script, and all .nse files in the directory /home/user/customscripts.
nmap --script default,banner,/home/user/customscripts
# Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy.
nmap --script 'http-*'
# Loads every script except for those in the intrusive category.
nmap --script "not intrusive"
# Loads those scripts that are in both the default and safe categories.
nmap --script "default and safe"
# Loads scripts in the default, safe, or intrusive categories, except for those whose names start with http-.
nmap --script "(default or safe or intrusive) and not http-*"

View File

@ -1,4 +0,0 @@
# To send a desktop notification via dbus:
notify-send -i 'icon-file/name' -a 'application_name' 'summary' 'body of message'
# The -i and -a flags can be omitted if unneeded.

View File

@ -1,11 +0,0 @@
# Dump file in octal format
od /path/to/binaryfile
od -o /path/to/binaryfile
od -t o2 /path/to/binaryfile
# Dump file in hexadecimal format
od -x /path/to/binaryfile
od -t x2 /path/to/binaryfile
# Dump file in hexadecimal format, with hexadecimal offsets and a space between each byte
od -A x -t x1 /path/to/binaryfile

View File

@ -1,21 +0,0 @@
# To create a 2048-bit private key:
openssl genrsa -out server.key 2048
# To create the Certificate Signing Request (CSR):
openssl req -new -key server.key -out server.csr
# To sign a certificate using a private key and CSR:
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
# (The above commands may be run in sequence to generate a self-signed SSL certificate.)
# To show certificate information for a certificate signing request
openssl req -text -noout -in server.csr
# To show certificate information for generated certificate
openssl x509 -text -noout -in server.crt
# To view certificate expiration:
echo | openssl s_client -connect <hostname>:443 2> /dev/null | \
awk '/-----BEGIN/,/END CERTIFICATE-----/' | \
openssl x509 -noout -enddate

View File

@ -1,48 +0,0 @@
# All the following command work as well with multiple package names
# To search for a package
pacman -Ss <package name>
# To update the local package base and upgrade all out of date packages
pacman -Suy
# To install a package
pacman -S <package name>
# To uninstall a package
pacman -R <package name>
# To uninstall a package and his depedencies, removing all new orphans
pacman -Rcs <package name>
# To get informations about a package
pacman -Si <package name>
# To install a package from builded package file (.tar.xz)
pacman -U <file name/file url>
# To list the commands provided by an installed package
pacman -Ql <package name> | sed -n -e 's/.*\/bin\///p' | tail -n +2
# To list explicitly installed packages
pacman -Qe
# To list orphan packages (installed as dependencies and not required anymore)
pacman -Qdt
# You can't directly install packages from the Arch User Database (AUR) with pacman.
# You need yaourt to perform that. But considering yaourt itself is in the AUR, here is how to build a package from its tarball.
# Installing a package from AUR is a relatively simple process:
# - Retrieve the archive corresponding to your package from AUR website
# - Extract the archive (preferably in a folder for this purpose)
# - Run makepkg in the extracted directory. (makepkg-s allows you to install any dependencies automatically from deposits.)
# - Install the package created using pacman
# Assuming $pkgname contains the package name.
wget "https://aur.archlinux.org/packages/${pkgname::2}/$pkgname/$pkgname.tar.gz"
tar zxvf "$pkgname.tar.gz"
cd "$pkgname"
# Build the package
makepkg -s
# Install
sudo pacman -U <package file (.pkg.tar.xz)>

View File

@ -1,9 +0,0 @@
# Concatenate all pdf files into one:
pdftk *.pdf cat output all.pdf
# Concatenate specific pdf files into one:
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
# Concatenate pages 1 to 5 of first.pdf with page 3 of second.pdf
pdftk A=fist.pdf B=second.pdf cat A1-5 B3 output new.pdf

View File

@ -1,23 +0,0 @@
# To view the php version:
php -v
# To view the installed php modules:
php -m
# To view phpinfo() information:
php -i
# To lint a php file:
php -l file.php
# To lint all php files within the cwd:
find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
# To enter an interactive shell:
php -a
# To locate the system's php.ini files:
php -i | grep "php.ini"
# To start a local webserver for the cwd on port 3000 (requires php >= 5.4):
php -S localhost:3000

View File

@ -1,15 +0,0 @@
# To list every process on the system:
ps aux
# To list a process tree
ps axjf
# To list every process owned by foouser:
ps -aufoouser
# To list every process with a user-defined format:
ps -eo pid,user,command
# Exclude grep from your grepped output of ps.
# Add [] to the first letter. Ex: sshd -> [s]shd
ps aux | grep '[h]ttpd'

View File

@ -1,16 +0,0 @@
# Desc: Python is a high-level programming language.
# Basic example of server with python
# Will start a Web Server in the current directory on port 8000
# go to http://127.0.0.1:8000
# Python v2.7
python -m SimpleHTTPServer
# Python 3
python -m http.server 8000
# SMTP-Server for debugging, messages will be discarded, and printed on stdout.
python -m smtpd -n -c DebuggingServer localhost:1025
# Pretty print a json
python -mjson.tool

View File

@ -1,5 +0,0 @@
# Remove files and subdirs
rm -rf path/to/the/target/
# Ignore non existent files
rm -f path/to/the/target

View File

@ -1,6 +0,0 @@
# copy files from remote to local, maintaining file propertires and sym-links (-a), zipping for faster transfer (-z), verbose (-v).
rsync -avz host:file1 :file1 /dest/
rsync -avz /source host:/dest
# Copy files using checksum (-c), rather than time, to detect if the file has changed. (Useful for validating backups).
rsync -avc /source/ /dest/

View File

@ -1,2 +0,0 @@
# Concatenate all pdf files into one:
sam2p *.pdf out.pdf

View File

@ -1,5 +0,0 @@
# To copy a file from your local machine to a remote server:
scp foo.txt user@example.com:remote/dir
# To copy a file from a remote server to your local machine:
scp user@example.com:remote/dir/foo.txt local/dir

View File

@ -1,11 +0,0 @@
# Start a new named screen session:
screen -S session_name
# Detach from the current session:
Press Ctrl+A then press d
# Re-attach a detached session:
screen -r session_name
# List all screen sessions:
screen -ls

View File

@ -1,14 +0,0 @@
# To replace all occurrences of "day" with "night" and write to stdout:
sed 's/day/night/g' file.txt
# To replace all occurrences of "day" with "night" within file.txt:
sed -i 's/day/night/g' file.txt
# To replace all occurrences of "day" with "night" on stdin:
echo 'It is daytime' | sed 's/day/night/g'
# To remove leading spaces
sed -i -r 's/^\s+//g' file.txt
# Remove empty lines and print results to stdout:
sed '/^$/d' file.txt

View File

@ -1,13 +0,0 @@
# To shred a file (5 passes) and verbose output:
shred -n 5 -v file.txt
# To shred a file (5 passes) and a final overwrite of zeroes:
shred -n 5 -vz file.txt
# To do the above, and then truncate and rm the file:
shred -n 5 -vzu file.txt
# To shred a partition:
shred -n 5 -vz /dev/sda
# Remember that shred may not behave as expected on journaled file systems if file data is being journaled.

View File

@ -1,2 +0,0 @@
# To view which users/processes are listening to which ports:
sudo sockstat -l

View File

@ -1,11 +0,0 @@
# To sort a file:
sort file
# To sort a file by keeping only unique:
sort -u file
# To sort a file and reverse the result:
sort -r file
# To sort a file randomly:
sort -R file

View File

@ -1,8 +0,0 @@
# To split a large text file into smaller files of 1000 lines each:
split file.txt -l 1000
# To split a large binary file into smaller files of 10M each:
split file.txt -b 10M
# To consolidate split files into a single file:
cat x* > file.txt

View File

@ -1,45 +0,0 @@
# Test URL and POST data and return database banner (if possible)
./sqlmap.py --url="<url>" --data="<post-data>" --banner
# Parse request data and test | request data can be obtained with burp
./sqlmap.py -r <request-file> <options>
# Fingerprint | much more information than banner
./sqlmap.py -r <request-file> --fingerprint
# Get database username, name, and hostname
./sqlmap.py -r <request-file> --current-user --current-db --hostname
# Check if user is a database admin
./sqlmap.py -r <request-file> --is-dba
# Get database users and password hashes
./sqlmap.py -r <request-file> --users --passwords
# Enumerate databases
./sqlmap.py -r <request-file> --dbs
# List tables for one database
./sqlmap.py -r <request-file> -D <db-name> --tables
# Other database commands
./sqlmap.py -r <request-file> -D <db-name> --columns
--schema
--count
# Enumeration flags
./sqlmap.py -r <request-file> -D <db-name>
-T <tbl-name>
-C <col-name>
-U <user-name>
# Extract data
./sqlmap.py -r <request-file> -D <db-name> -T <tbl-name> -C <col-name> --dump
# Execute SQL Query
./sqlmap.py -r <request-file> --sql-query="<sql-query>"
# Append/Prepend SQL Queries
./sqlmap.py -r <request-file> --prefix="<sql-query>" --suffix="<sql-query>"
# Get backdoor access to sql server | can give shell access
./sqlmap.py -r <request-file> --os-shell

View File

@ -1,23 +0,0 @@
# To ssh via pem file (which normally needs 0600 permissions):
ssh -i /path/to/file.pem user@example.com
# To connect on an non-standard port:
ssh -p 2222 user@example.com
# To execute a command on a remote server:
ssh -t user@example.com 'the-remote-command'
# To tunnel an x session over SSH:
ssh -X user@example.com
# To launch a specific x application over SSH:
ssh -X -t user@example.com 'chromium-browser'
# To create a SOCKS proxy on localhost and port 9999
ssh -D 9999 user@example.com
# -X use an xsession, -C compress data, "-c blowfish" use the encryption blowfish
ssh user@example.com -C -c blowfish -X
# For more information, see:
# http://unix.stackexchange.com/q/12755/44856

View File

@ -1,8 +0,0 @@
# To copy a key to a remote host:
ssh-copy-id username@host
# To copy a key to a remote host on a non-standard port:
ssh-copy-id username@host -p 2222
# To copy a key to a remote host on a non-standard port with non-standard ssh key:
ssh-copy-id ~/.ssh/otherkey "username@host -p 2222"

View File

@ -1,14 +0,0 @@
# To generate an SSH key:
ssh-keygen -t rsa
# To generate a 4096-bit SSH key:
ssh-keygen -t rsa -b 4096
# To update a passphrase on a key
ssh-keygen -p -P old_passphrase -N new_passphrase -f /path/to/keyfile
# To remove a passphrase on a key
ssh-keygen -p -P old_passphrase -N '' -f /path/to/keyfile
# To generate a 4096 bit RSA key with a passphase and comment containing the user and hostname
ssh-keygen -t rsa -b 4096 -C "$USER@$HOSTNAME" -P passphrase

View File

@ -1,5 +0,0 @@
# To redirect stderr to stdout:
some-command 2>&1
# To redirect stderr to a file
some-command 2> errors.txt

View File

@ -1,24 +0,0 @@
# Basic stracing
strace <command>
# save the trace to a file
strace -o strace.out <other switches> <command>
# follow only the open() system call
strace -e trace=open <command>
# follow all the system calls which open a file
strace -e trace=file <command>
# follow all the system calls associated with process
# management
strace -e trace=process <command>
# follow child processes as they are created
strace -f <command>
# count time, calls and errors for each system call
strace -c <command>
# trace a running process (multiple PIDs can be specified)
strace -p <pid>

View File

@ -1,36 +0,0 @@
# List all loaded/active units
systemctl list-units
# Check the status of a service
systemctl status foo.service
# Start a service
systemctl start foo.service
# Restart a service
systemctl restart foo.service
# Stop a service
systemctl stop foo.service
# Reload a service's configuration
systemctl reload foo.service
# Enable a service to startup on boot
systemctl enable foo.service
# Disable a service to startup on boot
systemctl disable foo.service
# List the dependencies of a service
# when no service name is specified, lists the dependencies of default.target
systemctl list-dependencies foo.service
# List currently loaded targets
systemctl list-units --type=target
# Change current target
systemctl isolate foo.target
# Change default target
systemctl enable foo.target

Some files were not shown because too many files have changed in this diff Show More