neulab/tldr huggingface dataset:
# mount remote directory
sshfs {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}
# unmount remote directory
umount {{mountpoint}}
# mount remote directory from server with specific port
sshfs {{username}}@{{remote_host}}:{{remote_directory}} -p {{2222}}
# use compression
sshfs {{username}}@{{remote_host}}:{{remote_directory}} -C
# follow symbolic links
sshfs -o follow_symlinks {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}
# send a message with the content of `message.txt` to the mail directory of local user `username`
sendmail {{username}} < {{message.txt}}
# send an email from you@yourdomain.com (assuming the mail server is configured for this) to test@gmail.com containing the message in `message.txt`
sendmail -f {{you@yourdomain.com}} {{test@gmail.com}} < {{message.txt}}
# send an email from you@yourdomain.com (assuming the mail server is configured for this) to test@gmail.com containing the file `file.zip`
sendmail -f {{you@yourdomain.com}} {{test@gmail.com}} < {{file.zip}}
# call a command and display its output if it returns a nonzero exit code
cronic {{command}}
# compile a bison definition file
bison {{path/to/file.y}}
# compile in debug mode, which causes the resulting parser to write additional information to the standard output
bison --debug {{path/to/file.y}}
# specify the output filename
bison --output {{path/to/output.c}} {{path/to/file.y}}
# be verbose when compiling
bison --verbose
# take a list of file names from standard input and add them [o]nto an archive in cpio's binary format
echo "{{file1}} {{file2}} {{file3}}" | cpio -o > {{archive.cpio}}
# copy all files and directories in a directory and add them [o]nto an archive, in [v]erbose mode
find {{path/to/directory}} | cpio -ov > {{archive.cpio}}
# p[i]ck all files from an archive, generating [d]irectories where needed, in [v]erbose mode
cpio -idv < {{archive.cpio}}
# import an existing patch from a file
quilt import {{path/to/filename.patch}}
# create a new patch
quilt new {{filename.patch}}
# add a file to the current patch
quilt add {{path/to/file}}
# after editing the file, refresh the current patch with the changes
quilt refresh
# apply all the patches in the series file
quilt push -a
# remove all applied patches
quilt pop -a
# print files and directories up to 'num' levels of depth (where 1 means the current directory)
tree -L {{num}}
# print directories only
tree -d
# print hidden files too with colorization on
tree -a -C
# print the tree without indentation lines, showing the full path instead (use `n` to not escape nonprintable characters)
tree -i -f
# print the size of each file and the cumulative size of each directory, in humanreadable format
tree -s -h --du
# print files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files
tree -P '{{*.txt}}' --prune
# print directories within the tree hierarchy, using the wildcard (glob) pattern, and pruning out directories that aren't ancestors of the wanted one
tree -P {{directory_name}} --matchdirs --prune
# print the tree ignoring the given directories
tree -I '{{directory_name1|directory_name2}}'
# copy a single file (open an editor with the source filename on the left and the target filename on the right)
qcp {{source_file}}
# copy multiple jpg files
qcp {{*.jpg}}
# copy files, but swap the positions of the source and the target filenames in the editor
qcp --option swap {{*.jpg}}
# measure the current download speed
fast
# measure the current upload speed in addition to download speed
fast --upload
# display results on a single line to reduce spacing
fast --single-line
# lookup a, aaaa, and mx records of a domain
host {{domain}}
# lookup a field (cname, txt,...) of a domain
host -t {{field}} {{domain}}
# reverse lookup an ip
host {{ip_address}}
# specify an alternate dns server to query
host {{domain}} {{8.8.8.8}}
# give the [u]ser who owns a file the right to e[x]ecute it
chmod u+x {{file}}
# give the [u]ser rights to [r]ead and [w]rite to a file/directory
chmod u+rw {{file_or_directory}}
# remove e[x]ecutable rights from the [g]roup
chmod g-x {{file}}
# give [a]ll users rights to [r]ead and e[x]ecute
chmod a+rx {{file}}
# give [o]thers (not in the file owner's group) the same rights as the [g]roup
chmod o=g {{file}}
# remove all rights from [o]thers
chmod o= {{file}}
# change permissions recursively giving [g]roup and [o]thers the ability to [w]rite
chmod -R g+w,o+w {{directory}}
# recursively give [a]ll users [r]ead permissions to files and e[x]ecute permissions to subdirectories within a directory
chmod -R a+rX {{directory}}
# display information on all available gpus and processes using them
nvidia-smi
# display more detailed gpu information
nvidia-smi --query
# monitor overall gpu usage with 1second update interval
nvidia-smi dmon
# start `bc` in interactive mode using the standard math library
bc -l
# calculate the result of an expression
bc <<< "(1 + 2) * 2 ^ 2"
# calculate the result of an expression and force the number of decimal places to 10
bc <<< "scale=10; 5 / 3"
# calculate the result of an expression with sine and cosine using `mathlib`
bc -l <<< "s(1) + c(1)"
# expose a local http service on a given port
ngrok http {{80}}
# expose a local http service on a specific host
ngrok http {{foo.dev}}:{{80}}
# expose a local https server
ngrok http https://localhost
# expose tcp traffic on a given port
ngrok tcp {{22}}
# expose tls traffic for a specific host and port
ngrok tls -hostname={{foo.com}} {{443}}
# recursively check the current directory, showing progress on the screen and logging error messages to a file
cppcheck . 2> cppcheck.log
# recursively check a given directory, and don't print progress messages
cppcheck --quiet {{path/to/directory}}
# check a given file, specifying which tests to perform (by default only errors are shown)
cppcheck --enable={{error|warning|style|performance|portability|information|all}} {{path/to/file.cpp}}
# list available tests
cppcheck --errorlist
# check a given file, ignoring specific tests
cppcheck --suppress={{test_id1}} --suppress={{test_id2}} {{path/to/file.cpp}}
# check the current directory, providing paths for include files located outside it (e.g. external libraries)
cppcheck -I {{include/directory_1}} -I {{include/directory_2}} .
# check a microsoft visual studio project (`*.vcxproj`) or solution (`*.sln`)
cppcheck --project={{path/to/project.sln}}
# move a single file (open an editor with the source filename on the left and the target filename on the right)
qmv {{source_file}}
# move multiple jpg files
qmv {{*.jpg}}
# move multiple directories
qmv -d {{path/to/directory1}} {{path/to/directory2}} {{path/to/directory3}}
# move all files and directories inside a directory
qmv --recursive {{path/to/directory}}
# move files, but swap the positions of the source and the target filenames in the editor
qmv --option swap {{*.jpg}}
# convert `filename.pdf` to plain text and print it to standard output
pdftotext {{filename.pdf}} -
# convert `filename.pdf` to plain text and save it as `filename.txt`
pdftotext {{filename.pdf}}
# convert `filename.pdf` to plain text and preserve the layout
pdftotext -layout {{filename.pdf}}
# convert `input.pdf` to plain text and save it as `output.txt`
pdftotext {{input.pdf}} {{output.txt}}
# convert pages 2, 3 and 4 of `input.pdf` to plain text and save them as `output.txt`
pdftotext -f {{2}} -l {{4}} {{input.pdf}} {{output.txt}}
# create a new package
stack new {{package_name}} {{template_name}}
# compile a package
stack build
# run tests inside a package
stack test
# compile a project and recompile every time a file changes
stack build --file-watch
# compile a project and execute a command after compilation
stack build --exec "{{command}}"
# run a program and pass an argument to it
stack exec {{program_name}} -- {{argument}}
# create a new angular application inside a directory
ng new {{project_name}}
# add a new component to one's application
ng generate component {{component_name}}
# add a new class to one's application
ng generate class {{class_name}}
# add a new directive to one's application
ng generate directive {{directive_name}}
# run the application with the following command in its root directory
ng serve
# build the application
ng build
# run unit tests
ng test
# check the version of your current angular installation
ng version
# initialise a configuration file
envoy init {{host_name}}
# run a task
envoy run {{task_name}}
# run a task from a specific project
envoy run --path {{path/to/directory}} {{task_name}}
# run a task and continue on failure
envoy run --continue {{task_name}}
# dump a task as a bash script for inspection
envoy run --pretend {{task_name}}
# connect to the specified server via ssh
envoy ssh {{server_name}}
# check a single python file
pyflakes check {{path/to/file}}.py
# check python files in a specific directory
pyflakes checkPath {{path/to/directory}}
# check python files in a directory recursively
pyflakes checkRecursive {{path/to/directory}}
# check all python files found in multiple directories
pyflakes iterSourceCode {{path/to/directory_1}} {{path/to/directory_2}}
# open a file
ex {{path/to/file}}
# save and quit
wq<Enter>
# undo the last operation
undo<Enter>
# search for a pattern in the file
/{{search_pattern}}<Enter>
# perform a regular expression substitution in the whole file
%s/{{regular_expression}}/{{replacement}}/g<Enter>
# insert text
i<Enter>{{text}}<C-c>
# switch to vim
visual<Enter>
# list all devices
kdeconnect-cli --list-devices
# list available (paired and reachable) devices
kdeconnect-cli --list-available
# request pairing with a specific device, specifying its id
kdeconnect-cli --pair --device {{device_id}}
# ring a device, specifying its name
kdeconnect-cli --ring --name {{device_name}}
# share an url or file with a paired device, specifying its id
kdeconnect-cli --share {{URL|path/to/file}} --device {{device_id}}
# send an sms with an optional attachment to a specific number
kdeconnect-cli --name {{device_name}} --send-sms {{message}} --destination {{phone_number}} --attachment {{path/to/file}}
# unlock a specific device
kdeconnect-cli --name {{device_name}} --unlock
# simulate a key press on a specific device
kdeconnect-cli --name {{device_name}} --send-keys {{key}}