linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux [2021/03/16 19:28] – roger | linux [2024/11/17 12:59] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 79: | Line 79: | ||
===== Download an entire website using wget ===== | ===== Download an entire website using wget ===== | ||
- | <code bash> | + | More: https://gist.github.com/mikecrittenden/ |
+ | <code bash> | ||
+ | wget \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | ===== Create a X.509 sha256 self signed certificate ===== | ||
+ | |||
+ | <code bash> | ||
+ | openssl req \ | ||
+ | -x509 \ | ||
+ | -newkey rsa:4096 \ | ||
+ | -sha256 \ | ||
+ | -keyout mykeyname.key \ | ||
+ | -out mycertname.pem \ | ||
+ | -days 365 | ||
+ | -nodes # only if you need no password | ||
+ | </ | ||
+ | |||
+ | ===== Find ===== | ||
+ | |||
+ | ==== Find a specific file in the specified folder ==== | ||
+ | |||
+ | You can use: | ||
+ | |||
+ | <code bash> | ||
+ | find mypath -type f -name " | ||
+ | </ | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ===== xargs ===== | ||
+ | |||
+ | '' | ||
+ | |||
+ | <code bash> | ||
+ | find . -type f -name \" | ||
+ | </ | ||
+ | |||
+ | What's happening? | ||
+ | |||
+ | * First, we are performing a [[linux# | ||
+ | <code bash> | ||
+ | ./ | ||
+ | ./ | ||
+ | </ | ||
+ | * Then, we pipe the output of the find command to '' | ||
+ | * '' | ||
+ | |||
+ | |||
+ | This command in particular is very usefull to check if all the JSON files in a repository are well formated in a CI/CD step. | ||
+ | |||
+ | ===== ncdu ===== | ||
+ | |||
+ | Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don’t have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed. | ||
+ | |||
+ | Usage: | ||
+ | |||
+ | <code bash> | ||
+ | ncdu -x / | ||
+ | </ | ||
+ | |||
+ | Where ''/'' | ||
+ | |||
+ | ===== awk ===== | ||
+ | |||
+ | ==== Print the first column of a string ==== | ||
+ | |||
+ | <code bash> | ||
+ | echo "This is a string" | ||
+ | # Output: " | ||
+ | </ | ||
+ | |||
+ | ==== Print a full string in lowercase or uppercase ==== | ||
+ | |||
+ | <code bash> | ||
+ | echo "This Is A CaPiTaLiZeD String" | ||
+ | # Output: "this is a capitalized string" | ||
+ | |||
+ | echo "This Is A CaPiTaLiZeD String" | ||
+ | # Output: "THIS IS A CAPITALIZED STRING" | ||
+ | </ |
linux.1615922914.txt.gz · Last modified: 2024/11/17 12:59 (external edit)