-o <file> # --output: write to file
-u user:pass # --user: Authentication
-v # --verbose
-vv # Even more verbose
-s # --silent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns an array containing the unique elements from the input array. | |
* | |
* @param {Array} arr - The input array. | |
* @return {Array} An array containing the unique elements from the input array. | |
*/ | |
function uniqueElements(arr) { | |
const uniqueArr = [] | |
const seen = new Set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates the weighted average of an array of numbers. | |
* | |
* @param {number[]} nums - The array of numbers to be averaged. | |
* @param {number[]} weights - The array of weights corresponding to each number in `nums`. | |
* @return {number} The weighted average of the numbers. | |
*/ | |
const weightedAverage = (nums, weights) => { | |
let sum = 0; | |
let weightSum = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
LOG_FILE="appPrint.log" | |
. "Check ownership and permissions of a file.sh" | |
function log() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check ownership and permissions of a file | |
function checkPermissions() { | |
file="$1" | |
expectedOwner="$2" | |
expectedPermissions="$3" | |
expectedUid=`id -u "$expectedOwner"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This is a bash script template in order to help you quick start any script. | |
# It contains some sensible defaults, you can learn more by visiting: | |
# https://google.github.io/styleguide/shell.xml | |
# | |
# This option will make the script exit when there is an error | |
set -o errexit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat file.txt | while read line || [[ -n $line ]]; | |
do | |
printf '%s\n' "$line" # do something with $line here | |
done |
- :help keyword - open help for keyword
- :saveas file - save file as
- :close - close current pane
- K - open man page for word under the cursor