diff --git a/sheets/az b/sheets/az index bce8d50..ef34bba 100644 --- a/sheets/az +++ b/sheets/az @@ -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 diff --git a/sheets/bash b/sheets/bash index a5672a9..7f096f5 100644 --- a/sheets/bash +++ b/sheets/bash @@ -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. diff --git a/sheets/fdisk b/sheets/fdisk index 7cf417d..19c6e94 100644 --- a/sheets/fdisk +++ b/sheets/fdisk @@ -47,12 +47,13 @@ UUID= /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 diff --git a/sheets/go b/sheets/go index a054fb3..8357857 100644 --- a/sheets/go +++ b/sheets/go @@ -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 diff --git a/sheets/xargs b/sheets/xargs index f329873..5751f5f 100644 --- a/sheets/xargs +++ b/sheets/xargs @@ -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: