2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-19 03:25:44 +00:00
Commit Graph

681 Commits

Author SHA1 Message Date
terminalforlife
1e7c9ae57e Use more(1) as a fallback for paging 2020-11-17 02:12:54 +00:00
terminalforlife
66a38b7196 Tighten Main(), and use pager by default
The use of `[ -t 1 ]` won't check for interactivity, rather, whether
STDOUT is viable? If so, it might be best to check the `$-` variable
(I think that's it) for the `i` character, like the standard default
Debian `.bashrc` interactivity checks. Or, my preference, check the
`$PS1` is not empty, which works well in my own `.bashrc` file.

The `Main()` function was spread a bit too far, but is now more
appropriate; has no real impact, just clarify when reading.

Although the use of less(1) pager is enabled by default, it can be
disabled now with the `--no-pager|-P` flags.
2020-11-17 02:09:38 +00:00
terminalforlife
17454dc8f4 Add whitelisting functionality
We can now specify our own whitelisting file, overriding the default of
'lenchk-excludes' which must stay in the same directory as lenchk, at
least for now. The custom file can be wherever you want it, however.

I'd like to use the `readarray`/`mapfile` BASH built-in for populating
the array variable, but it didn't seem to want to work, so I just went
for another `while read` loop. It's working very nicely as-is, though.

I've changed the required whitelist format to one of simplicity: one
filename per line. Why the previous format? Because of files which may
have a newline character in them, but I realised in this environment
that's just not going to happen; force of habit, I guess.

I'd like to allow users to be able to whitelist entire directories, but
I don't see that being so high on the priority list, for now.

What do you think?
2020-11-17 01:49:52 +00:00
terminalforlife
6ef4f6e9fc Add option to ignore 'sheets/*/*' subdirectories 2020-11-17 00:56:16 +00:00
terminalforlife
2bc31bd7dc Address less-related bug regarding summary 2020-11-17 00:48:59 +00:00
Igor Chubin
81f234e0eb
Merge pull request #133 from terminalforlife/master
Add lenchk (tester to replace max_length)
2020-11-16 22:56:48 +01:00
terminalforlife
6de63e8df8 Correct spelling errors (duh!) 2020-11-16 21:24:14 +00:00
terminalforlife
9bd8c37f8a Correct Err() instance (wrong directory name) 2020-11-16 21:22:49 +00:00
terminalforlife
fa546de881 Add lenchk (max_length functionality, and some)
Hope this helps. I wish I'd known this is what you were after, but I
guess it didn't click! This is an area I love and excel at, so I
hoped to put that to use here.

* The colorization flag might help when there are a lot of results.

* By far, the indented line number and preview of the offending lines
  is the most useful aspect of lenchk, making it much easier to track
  down troublesome lines, especially for the inexperienced.

* I've accounted for `//` lines (C languages), although some like
  Javascript, HTML, and CSS I've yet to get around to.

* There's a summary, which is probably pointless, but it might help to
  keep track of our progress in getting through the files.

* It's ever-so-slightly more efficient and portable, but ultimately, -
  I'd say making it use just /bin/sh would be better, but Bash is
  pretty common-place these days, and has features which make lenchk
  much cleaner.

  Ideally, I'd have written this in Perl, due to the limited lifespan
  of this tester, because a shell can only handle so much data before
  it starts to chug. I figured, however, that not everyone will have
  Perl.

If this commit isn't accepted, no worries, as I'm sure I can repurpose
it for use elsewhere.

Want it, but have issues? Let me know, and I'll get on that ASAP.

Note that I've removed max_length in this commit, to avoid confusion.
2020-11-16 21:09:55 +00:00
Igor Chubin
2abb75a33f
Merge pull request #131 from MFTabriz/master
add another example to ch-run
2020-11-12 21:56:31 +01:00
Igor Chubin
f058d7d647
Merge pull request #132 from MFTabriz/patch-1
add link to the issue page
2020-11-12 21:55:21 +01:00
Meisam
8a7db69085
add link to the issue page 2020-11-12 17:24:22 +01:00
mtabriz
eabd18aa74 fix the style 2020-11-12 17:07:42 +01:00
mtabriz
8e07a37f7d add another example to ch-run 2020-11-12 16:02:09 +01:00
Igor Chubin
86baa0e06c
Extend cheat sheet format dscription 2020-11-12 11:08:03 +01:00
Igor Chubin
3c79257969
Update simple curl call description 2020-11-12 11:04:04 +01:00
Igor Chubin
fd0cb41bcd
Merge pull request #129 from chubin/tests
Add tests/max-length
2020-11-12 11:01:22 +01:00
Igor Chubin
dd8d8307e5
Merge pull request #130 from terminalforlife/master
New File, New Examples, and Some Code/Comment Tweaks
2020-11-12 09:11:38 +01:00
terminalforlife
e380f4eeb5 Add read sheet + 2 examples
I realise it's a built-in, and that its operation can wildly differ,
depending on the shell used, which is why I've added that the sheet is
for the Bash built-in. I'm not sure how this project handles multiple
different tools by the same name; worth looking into, @chubin?
2020-11-12 04:20:39 +00:00
terminalforlife
98dd514d7b Add important policies tip for udisksctl
Without knowledge of this, people trying out an Ubuntu- or Debian-based
distribution will be frustrated when trying to use udisksctl(1). I ran
into this situation myself, so discovering this was a relief.
2020-11-12 04:04:29 +00:00
terminalforlife
a559fd580f Add variable spacing example to printf 2020-11-12 03:44:19 +00:00
terminalforlife
8576445e17 Improve wording & code readability of xargs
I've also un-squished flags & their arguments to avoid confusion.
2020-11-12 03:39:19 +00:00
terminalforlife
ac2480bca9 Bring consistency of formatting to ch-* sheets 2020-11-12 03:38:29 +00:00
terminalforlife
bb5e860c01 Add cdparanoia sheet + an example 2020-11-12 03:37:56 +00:00
Igor Chubin
3f5b5264ea Add tests/max-length 2020-11-11 20:48:50 +01:00
Igor Chubin
592eef7e29
Merge pull request #128 from MFTabriz/master
add basic Charliecloud commands
2020-11-10 16:50:48 +01:00
mtabriz
b7e75f1271 enforce 80char max line length
misc. cleanup
2020-11-10 16:42:53 +01:00
mtabriz
c2dbffd666 add basic Charliecloud commands
https://github.com/hpc/charliecloud
2020-11-10 16:18:56 +01:00
Igor Chubin
7a2557b17a
Merge pull request #127 from terminalforlife/master
New Files & Examples (Including `ffmpeg`, Per #124)
2020-11-09 22:07:25 +01:00
terminalforlife
3ba771bcaf Add ffmpeg file + examples, per PR #124
Thinking about it, I'm not sure ffmpeg(1) is bulky enough to warrant a
_ffmpeg page. Maybe see if it gets more attention, then go from there?
2020-11-09 19:35:39 +00:00
terminalforlife
3de050a116 Add read() example to perl file 2020-11-09 19:35:18 +00:00
Igor Chubin
b499c90c2a
Merge pull request #126 from toretto/patch-1
Update nmap
2020-11-09 17:43:00 +01:00
Steven Zeegers
a5fed1dcc8
Update nmap
Fixed two typo's and didn't dare to touch anything else.
2020-11-09 16:58:02 +01:00
Igor Chubin
6e49a334ca
Merge pull request #125 from wangzhe3224/patch-1
fix typo in learn
2020-11-08 13:01:32 +01:00
Zhe Wang
f2b127257b
fix typo in learn 2020-11-07 13:18:54 +00:00
Igor Chubin
0a365d0c15
Merge pull request #124 from gfrein/patch-1
Update convert
2020-11-05 21:26:54 +01:00
Georg Frein
825c29a0f1
Update convert 2020-11-05 21:06:30 +01:00
Igor Chubin
968cfc4e22
Merge pull request #123 from terminalforlife/master
Slight Presentation Tweak
2020-11-02 20:16:59 +01:00
terminalforlife
c4a1df60a4 Slightly tweak presentation for consistency
If I missed something crucial in my minor edits of the wording of the
descriptions, please let me know, @MFTabriz.
2020-11-02 16:44:08 +00:00
Igor Chubin
a5f3dfa9af
Merge pull request #122 from MFTabriz/master
add heaptrack
2020-11-02 14:31:01 +01:00
mtabriz
e91221e728 add heaptrack 2020-11-02 13:26:04 +01:00
Igor Chubin
fcfc96cbc7
Merge pull request #121 from uburuntu/patch-1
fix: missed space in python
2020-10-29 23:08:20 +01:00
Ramzan Bekbulatov
71e99697ac
fix: missed space in python 2020-10-29 12:03:44 +03:00
Igor Chubin
69071e734b
Merge pull request #119 from mcint/say
Say: whitespace sensitive argument fix
2020-10-27 20:59:41 +01:00
Loren McIntyre
0f2ce0a089 sheet/say: Escaping/quoting special shell character for help 2020-10-27 12:35:43 -07:00
Igor Chubin
4f947347a2
Merge pull request #120 from terminalforlife/master
Add New Files & Examples
2020-10-27 07:28:36 +01:00
terminalforlife
2ede22b157 Merge master branch from origin 2020-10-27 00:57:48 +00:00
terminalforlife
20a73754f0 Add basic parsing example for sensors(1) 2020-10-27 00:56:44 +00:00
terminalforlife
85446caec1 Add sensors file and a couple of examples 2020-10-27 00:52:28 +00:00
terminalforlife
b8d100158b Add links2 with plenty of examples 2020-10-27 00:42:27 +00:00