112 lines
2.8 KiB
Groff
112 lines
2.8 KiB
Groff
|
.\" Automatically generated by Pandoc 3.1.5
|
||
|
.\"
|
||
|
.\" Define V font for inline verbatim, using C font in formats
|
||
|
.\" that render this, and otherwise B font.
|
||
|
.ie "\f[CB]x\f[]"x" \{\
|
||
|
. ftr V B
|
||
|
. ftr VI BI
|
||
|
. ftr VB B
|
||
|
. ftr VBI BI
|
||
|
.\}
|
||
|
.el \{\
|
||
|
. ftr V CR
|
||
|
. ftr VI CI
|
||
|
. ftr VB CB
|
||
|
. ftr VBI CBI
|
||
|
.\}
|
||
|
.TH "CHEATSHEET" "7" "" "Version 1.0" "Cheatsheet for stuff Hugh forgets"
|
||
|
.hy
|
||
|
.SH NAME
|
||
|
.PP
|
||
|
\f[B]cheatsheet\f[R] - tips and reminders for Hugh.
|
||
|
.SH SYNOPSIS
|
||
|
.PP
|
||
|
\f[B]man cheatsheet\f[R]
|
||
|
.IP
|
||
|
.nf
|
||
|
\f[C]
|
||
|
pandoc --standalone -t man cheatsheet.7.md -o cheatsheet.7
|
||
|
ln -s /User/hugh/coding/man/chatesheet.7 /usr/local/share/man/man7/
|
||
|
\f[R]
|
||
|
.fi
|
||
|
.SH DESCRIPTION
|
||
|
.PP
|
||
|
This is a man page to remind Hugh of some basic commands and techniques
|
||
|
he uses but forgets a lot in git, Python etc.
|
||
|
.SH EXAMPLES
|
||
|
.PP
|
||
|
\f[B]git\f[R]
|
||
|
.TP
|
||
|
\f[V]git branch -d [name of branch to delete]\f[R]
|
||
|
Delete a git branch
|
||
|
.TP
|
||
|
\f[V]git reset [file]\f[R]
|
||
|
\f[I]Unstage\f[R] file but retain contents
|
||
|
.TP
|
||
|
\f[V]git _reset_ [commit]\f[R]
|
||
|
\f[I]Undo\f[R] all commits after \f[I]commit\f[R], preserving changes
|
||
|
locally
|
||
|
.TP
|
||
|
\f[V]git reset HEAD --hard\f[R]
|
||
|
\f[I]Undo\f[R] all changes to tracked files (since last commit)
|
||
|
.TP
|
||
|
\f[V]git clone [url]\f[R]
|
||
|
Download project and its history
|
||
|
.TP
|
||
|
\f[V]git merge [branch]\f[R]
|
||
|
Merge changes from \f[I]branch\f[R] into the current local branch
|
||
|
.TP
|
||
|
\f[V]git fetch [remote] pull/[id]/head:[branchname]\f[R]
|
||
|
Where \f[I]remote\f[R] is the remote name you want to fetch from,
|
||
|
\f[I]id\f[R] is the PR id, and \f[I]branchname\f[R] is the name you want
|
||
|
to give to the new LOCAL branch you will create with this command.
|
||
|
e.g.\ \f[I]fetch bookwyrm pull/999/head:testing\f[R]
|
||
|
.PP
|
||
|
\f[B]python\f[R]
|
||
|
.TP
|
||
|
\f[V]python -m http.server [port]\f[R]
|
||
|
Spins up a web server with file root wherever you called this from, on
|
||
|
\f[I]port\f[R]
|
||
|
.TP
|
||
|
\f[V]venv\f[R]
|
||
|
TODO
|
||
|
.PP
|
||
|
\f[B]Docker\f[R]
|
||
|
.TP
|
||
|
\f[V]docker volume prune\f[R]
|
||
|
Delete all volumes not being used by a currently-running process.
|
||
|
.TP
|
||
|
\f[V]docker exec -d [container] [command]\f[R]
|
||
|
Execute a \f[I]command\f[R] inside the running \f[I]container\f[R] as a
|
||
|
daemon (background task)
|
||
|
.PP
|
||
|
\f[B]hashes and random strings\f[R]
|
||
|
.TP
|
||
|
\f[V]openssl rand -hex [number]\f[R]
|
||
|
Create a random string with \f[I]number\f[R] of bytes, using hex
|
||
|
.TP
|
||
|
\f[V]openssl rand -base64 [number]\f[R]
|
||
|
Create a random string with \f[I]number\f[R] of bytes, using base64
|
||
|
.TP
|
||
|
\f[V]echo -n \[dq]string to hash\[dq] | md5\f[R]
|
||
|
returns an md5 hash of the string
|
||
|
.TP
|
||
|
\f[V]md5 big_huge_file.iso\f[R]
|
||
|
returns md5 hash of the file
|
||
|
.TP
|
||
|
\f[V]openssl md5 big_huge_file.iso\f[R]
|
||
|
also returns md5 hash of the file
|
||
|
.PP
|
||
|
\f[B]Duck Duck Go\f[R]
|
||
|
.TP
|
||
|
\f[I]https://duckduckgo.com/?q=password+strong+32\f[R]
|
||
|
Strong random password
|
||
|
.TP
|
||
|
\f[I]https://duckduckgo.com/?q=qr+code+your+text+here\f[R]
|
||
|
Get a QR code for returning whatever text you entered
|
||
|
.SH SEE ALSO
|
||
|
.PP
|
||
|
git(1) python(1) md5(1)
|
||
|
.SH AUTHORS
|
||
|
Hugh Rundle.
|