2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-12 19:10:26 +00:00

Substitute tabs for (4) spaces

This commit is contained in:
terminalforlife 2020-03-16 19:51:55 +00:00
parent bcb2d06328
commit de9000196e
5 changed files with 29 additions and 28 deletions

View File

@ -62,11 +62,11 @@ az disk list --output table
# Copy blob
az storage blob copy start \
--source-uri 'https://md-ldh5nknx2rkz.blob.core.windows.net/jzwuuuzzapn0/abcd?sv=2017-04-17&sr=b&si=68041718-6828-4f5e-9e6e-a1b719975062&sig=XXX' \
--account-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX== \
--account-name destaccount \
--destination-container vms \
--destination-blob DESTINATION-blob.vhd
--source-uri 'https://md-ldh5nknx2rkz.blob.core.windows.net/jzwuuuzzapn0/abcd?sv=2017-04-17&sr=b&si=68041718-6828-4f5e-9e6e-a1b719975062&sig=XXX' \
--account-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX== \
--account-name destaccount \
--destination-container vms \
--destination-blob DESTINATION-blob.vhd
# List virtual networks
az network vnet list --output table

View File

@ -6,23 +6,23 @@ done
# For example:
for CurDay in Monday Tuesday Wednesday Thursday Friday Saturday Sunday
do
printf "%s\n" "$CurDay"
printf "%s\n" "$CurDay"
done
# To implement a case statement:
case $1 in
0)
echo "Found a '0'." ;;
echo "Found a '0'." ;;
1)
echo "Found a '1'." ;;
echo "Found a '1'." ;;
2)
echo "Found a '2'." ;;
echo "Found a '2'." ;;
3*)
echo "Something beginning with '3' found." ;;
'')
echo "Nothing (null) found." ;;
*)
echo "Anything else found." ;;
echo "Something beginning with '3' found." ;;
'')
echo "Nothing (null) found." ;;
*)
echo "Anything else found." ;;
esac
# Turn on built-in Bash debugging output:
@ -67,8 +67,8 @@ command -v ${program} >/dev/null 2>&1 || error "${program} not installed"
# However, that is a solution commonly found in a script using the Bourne shell, so
# in this case, an alternative, Bash-like, and more accurate version could be:
if ! type -fP bash > /dev/null 2>&1; then
printf "ERROR: Dependency 'bash' not met." >&2
exit 1
printf "ERROR: Dependency 'bash' not met." >&2
exit 1
fi
# Send both STDOUT and STDERR from COMMAND to FILE. The `2>&1` must go at the end.

View File

@ -47,12 +47,13 @@ UUID=<blkid#> /opt defaults 0 0 # 00 disable disk checking and metadata dumping
mount -a
df -h /opt
# Extending a physical disk (vm)
1. Unmount drive - comment out /etc/fstab entry for /dev/sdc
2. Increase drive physical space
3. parted /dev/sdc - 'p' #print partitions on /dev/sdc
4. fdisk /dev/sdc - 'p' - 'd' - 'n' (defaults) - w # delete old partition, create new partition
5. reboot
6. e2fsck -f /dev/sdc1
7. resize2fs /dev/sdc1
8. mount /dev/sdc1 - uncomment fstab
# Extending a physical disk (vm). Step 3 prints partitions on `/dev/sdc`. Step
# 4 deletes the old partition, then creates a new one.
1. Unmount drive. Comment out `/etc/fstab` entry for `/dev/sdc`.
2. Increase drive physical space
3. parted /dev/sdc - 'p'
4. fdisk /dev/sdc - 'p' - 'd' - 'n' (defaults) - w
5. reboot
6. e2fsck -f /dev/sdc1
7. resize2fs /dev/sdc1
8. mount /dev/sdc1 - uncomment fstab

View File

@ -19,5 +19,5 @@ go install
# See also:
# Go language cheat sheets at /go/
# list of pages: /go/:list
# learn go: /go/:learn
# learn go: /go/:learn
# search in pages: /go/~keyword

View File

@ -15,8 +15,8 @@ find -name \*.pdf -type f -print0 | xargs -0rn10 rm
find -name \*.pdf | xargs -I{} rm -rf '{}'
# Will show every .pdf like:
# &toto.pdf=
# &titi.pdf=
# &toto.pdf=
# &titi.pdf=
# -n1 => One file by one file. ( -n2 => 2 files by 2 files )
find -name \*.pdf | xargs -I{} -n1 echo '&{}='
# The above is, however, much faster and easier without xargs: