Commit 2774cb27 authored by Vincent Tam's avatar Vincent Tam

Work on TGV

parent bdc5c307
Pipeline #29081901 passed with stages
in 1 minute and 7 seconds
......@@ -29,20 +29,115 @@ class="fa fa-folder-o" aria-hidden></i>.
### apg
**A**vanced **p**assword **g**enerator.
My preferred way: partial <i class="fa fa-git" aria-hidden></i> management.
1. _Partial_ password saved: `apg -a 1 -n 1 -m 6 -x 8 -M SNCL > output.txt`
2. <i class="fa fa-git" aria-hidden></i> manages partial password_s_.
3. (De)centralized <i class="fa fa-git" aria-hidden></i> _local_ storage. (bare repo on USB <i class="fa fa-usb" aria-hidden></i> devices)
<i class="fa fa-info-circle" aria-hidden></i> <i class="fa fa-flag-o"
aria-hidden></i> <i class="fa fa-sort-alpha-asc" aria-hidden></i> Flags
explanations: (in alphabetical order)
- `-a [0|1]`: algorigthm
+ `0`: can be "pronounced"
+ `1`: "random" <i class="fa fa-random" aria-hidden></i> string
- `-m`: minimum password length
- `-M`: mode
+ `c`: _should_ include **c**apital letter
+ `C`: _must_ include **c**apital letter
+ `l`: _should_ include **l**owercase letter
+ `L`: _must_ include **l**owercase letter
+ `n`: _should_ include **n**umber
+ `N`: _must_ include **n**umber
+ `s`: _should_ include **s**pecial character
+ `S`: _must_ include **s**pecial character
- `-n`: number of output passwords
- `-x`: maximum password length
### apt-get
<span class="fa-stack"> <i class="fa fa-square-o fa-stack-2x"></i> <i class="fa
fa-terminal fa-stack-1x"></i></span> CLI Package manager. Requires sudo
priviledge.
| <span class="fa-stack"> <i class="fa fa-square-o fa-stack-2x"></i> <i class="fa fa-terminal fa-stack-1x"></i></span> sudo apt-get ... | Function |
| --- | --- |
| `update` | update local repo |
| `upgrade` | upgrade package version |
| `install` | install a package |
| `remove` | remove a package |
| `purge` | remove a package and erase its folder |
| `autoremove` | automatiqucally remove unnessary dependencies |
| `clean` | remove unused local cache files |
### awk
I use it to extract column(s). I _don't_ know why double quotes `"` _doesn't_
work.
$ ls -dl * | awk '{print $9}'
archetypes
config.toml
content
layouts
public
static
themes
### blkid
Display hard disk UUID.
### cat
**Cat**enate files and display them (in STDOUT).
**Cat**enate (combine) files and display them (in STDOUT).
- `-n`: display line number
This can be used with the "null device" to show string _without_ leaving a trace
in the bash history.
$ cat > /dev/null
foo bar ...
$
### convert
General usage: `convert [input-option] [input-file] [output-option]
[output-file]`.
Supported formats: JPG, PNG, GIF, SVG, etc
GUI softwares (e.g. [GIMP] enable preview of processed images, which is
_necessary_ in image sharpening. Therefore, I only list _a few_ options below.
#### format conversion
$ convert foo.ppm -quality [num] bar.jpg
`[num]` takes value from `1` to `100`. The higher the value, the better the
quality and the larger the file.
#### image manipulation
This is good for batch processing.
Options:
- `-crop`
- `-rotate [DEG]`: rotate `input-file` by `DEG` _clockwisely_.
- `-resize [DIM1] [DIM2]`: resize image (if `DIM2` is missing, largest dimension
will be taken)
### date
- `-I`: display date in format `YYYY-MM-DD`
### dpkg
### du
Display **d**isk **u**sage in KB. Only folders <i class="fa fa-folder-o"
......@@ -87,7 +182,8 @@ explanations: (in alphabetical order)
I found the concept of "level" hard to understand when I ran this in `.`
because the output was cluttered with fo||lders <i class="fa fa-folder-o"
aria-hidden></i> holding <i class="fa fa-git" aria-hidden></i> objects.
aria-hidden></i> holding <i class="fa fa-git" aria-hidden></i> binary
objects.
Let me illustrate this idea with the following example.
......@@ -115,10 +211,21 @@ explanations: (in alphabetical order)
20K layouts/
- `--exclude=[FILE]`
- `-s`: summary, display only the directory in the argument. (equivalent to `-d
0`)
- `-s`: summary, display only `[DIR(S)]`'s size. (equivalent to `-d 0`) This
can be used to _measure the size of a folder_ <i class="fa fa-folder-o"
aria-hidden></i>.
$ du -s static content
212 static
3656 content
- `--time`: also display time in the middle of each row
$ du --time static
8 2018-08-28 16:58 static/css
196 2018-07-26 15:47 static/img
212 2018-08-28 16:58 static
### echo
Display all arguments (in STDOUT).
......@@ -235,6 +342,16 @@ explanations: (in alphabetical order)
- `-w`: match whole _word_, similar to `\<` and `\>` in [Vim].
- `-q`: quiet
### head
Print first `n` lines of a file or STDOUT. (`n = 10` by default)
### hexdump
Display binary files as blocks of hexadecimal numbers.
- `-c`: character
### ifconfig
Display and/or modify connection info.
......@@ -249,9 +366,22 @@ General usage: `less [FILE]`
| Key <i class="fa fa-keyboard-o" aria-hidden></i> | Function |
| --- | --- |
| `h` | Show help page |
| `j` | Scroll one line down |
| `k` | Scroll one line up |
| `b` | Scroll one page **b**ackward |
| `f` | Scroll one page **f**orward |
| `d` | Scroll half page **d**own |
| `u` | Scroll half page **u**p |
| `g` | Jump to first line |
| `G` | Jump to last line |
| `j` | Move the cursor one line down |
| `k` | Move the cursor one line up |
| `/` | Forward search |
| `?` | Backword search |
| `n` | **N**ext match |
| `N` | Previous match |
| `h` | Show **h**elp page |
| `q` | **Q**uit |
Some of the above keys can be _quantified_ by prepending a number as in [Vim].
### ls
......@@ -314,14 +444,47 @@ explanations: (in alphabetical order)
### more
### openssh
### openssl
### rsync
### screendump
Record a <span class="fa-stack"> <i class="fa fa-square-o fa-stack-2x"></i> <i
class="fa fa-terminal fa-stack-1x"></i></span> TTY session into a text file
(with _one single long line_). Require sudo previledge.
$ sudo screendump 1 > ~/mylog.txt
[sudo] password for vin100:
$ cat ~/mylog.txt
Ubuntu 18.04.1 LTS vin100-LIFEBOOK-LH532 tty1
vin100-LIFEBOOK-LH532 login:
...
### sed
**S**tream **ed**itor
<i class="fa fa-info-circle" aria-hidden></i> <i class="fa fa-flag-o"
aria-hidden></i> <i class="fa fa-sort-alpha-asc" aria-hidden></i> Flags
explanations: (in alphabetical order)
- `-e`: extended mode
- `-i`: in place editing
- `-n`: no normal output
### sleep
Start an idle process for `n` seconds, which `n` is the first argument.
Remarks: I _can't_ say that the shell <span class="fa-stack"> <i class="fa
fa-square-o fa-stack-2x"></i> <i class="fa fa-terminal fa-stack-1x"></i></span>
is suspended despite its apparent effect as _appending_ `&` to the command
allows it to _run in background_.
### shrinkpdf
### sort
......@@ -330,14 +493,92 @@ explanations: (in alphabetical order)
### stty
### tail
Print last `n` lines of a file or STDOUT. (`n = 10` by default)
### tee
Redirect command output into STDOUT _and_ a file. To be used for inspecting and
capturing command output simultaneously.
$ ls | tee eles
archetypes
config.toml
content
layouts
public
static
themes
$ cat eles
archetypes
config.toml
content
layouts
public
static
themes
<i class="fa fa-info-circle" aria-hidden></i> `>` captures the command output
_without_ showing it (except errors).
### time
Record the time taken for running a command.
### uniq
Remove duplicate lines of input file(s) or STDIN.
### vim
**Im**proved text-editor from **vi**, which is preloaded on every GNU/Linux and
FreeBSD distro. (even on Mac OS)
- `-R`: read-only mode
| Normal mode key <i class="fa fa-keyboard-o" aria-hidden></i> | Function |
| --- | --- |
| `<C-b>` | Scroll one page **b**ackward |
| `<C-f>` | Scroll one page **f**orward |
| `<C-d>` | Scroll half page **d**own |
| `<C-u>` | Scroll half page **u**p |
| `g` | Jump to first line |
| `G` | Jump to last line |
| `h` | Move the cursor one character left |
| `j` | Move the cursor one character down |
| `k` | Move the cursor one character up |
| `l` | Move the cursor one character right |
| `/` | Forward search |
| `?` | Backword search |
| `n` | **N**ext match |
| `N` | Previous match |
| `i` | **I**nsert character under the cursor |
| `q` | **Q**uit |
P.S. It was my favorite editor.
### wc
**W**ord **c**ount
1. Use files: output character, word and line counts, followed by file name
$ wc .gitmodules
4 11 133 .gitmodules
2. Use STDOUT: also show these three counts, but _without_ file name
$ cat .gitmodules | wc
4 11 133
- `c`: character count
- `w`: word count
- `l`: line count
### xargs
### xwd
[Vim]: http://www.vim.org
[GIMP]: https://www.gimp.org
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment