$ hostname --help
Usage: hostname [-b] {hostname|-F file} set host name (from file)
hostname [-a|-A|-d|-f|-i|-I|-s|-y] display formatted name
hostname display host name
{yp,nis,}domainname {nisdomain|-F file} set NIS domain name (from file)
{yp,nis,}domainname display NIS domain name
dnsdomainname display dns domain name
hostname -V|--version|-h|--help print info and exit
Program name:
{yp,nis,}domainname=hostname -y
dnsdomainname=hostname -d
Program options:
-a, --alias alias names
-A, --all-fqdns all long host names (FQDNs)
-b, --boot set default hostname if none available
-d, --domain DNS domain name
-f, --fqdn, --long long host name (FQDN)
-F, --file read host name or NIS domain name from given file
-i, --ip-address addresses for the host name
-I, --all-ip-addresses all addresses for the host
-s, --short short host name
-y, --yp, --nis NIS/YP domain name
Description:
This command can get or set the host name or the NIS domain name. You can
also get the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account.
Download AzCopy
First, download the AzCopy V10 executable file to any directory on your computer. AzCopy V10 is just an executable file, so there’s nothing to install.
These files are compressed as a zip file (Windows and Mac) or a tar file (Linux). To download and decompress the tar file on Linux, see the documentation for your Linux distribution.
ตรวจสอบเวอร์ชันบน Command prompts
> azcopy --version
azcopy version 10.17.0
ตรวจสอบเวอร์ชันบน PowerShell
> .\azcopy --version
azcopy version 10.17.0
ดู help
> azcopy --help
AzCopy 10.17.0
Project URL: github.com/Azure/azure-storage-azcopy
AzCopy is a command line tool that moves data into and out of Azure Storage.
To report issues or to learn more about the tool, go to github.com/Azure/azure-storage-azcopy
The general format of the commands is: 'azcopy [command] [arguments] --[flag-name]=[flag-value]'.
Usage:
azcopy [command]
Available Commands:
bench Performs a performance benchmark
completion Generate the autocompletion script for the specified shell
copy Copies source data to a destination location
doc Generates documentation for the tool in Markdown format
env Shows the environment variables that you can use to configure the behavior of AzCopy.
help Help about any command
jobs Sub-commands related to managing jobs
list List the entities in a given resource
login Log in to Azure Active Directory (AD) to access Azure Storage resources.
logout Log out to terminate access to Azure Storage resources.
make Create a container or file share.
remove Delete blobs or files from an Azure storage account
set-properties (Preview) Given a location, change all the valid system properties of that storage (blob or file)
sync Replicate source to the destination location
Flags:
--cap-mbps float Caps the transfer rate, in megabits per second. Moment-by-moment throughput might vary slightly from the cap. If this option is set to zero, or it is omitted, the throughput isn't capped.
-h, --help help for azcopy
--log-level string Define the log verbosity for the log file, available levels: INFO(all requests/responses), WARNING(slow responses), ERROR(only failed requests), and NONE(no output logs). (default 'INFO'). (default "INFO")
--output-level string Define the output verbosity. Available levels: essential, quiet. (default "default")
--output-type string Format of the command's output. The choices include: text, json. The default value is 'text'. (default "text")
--skip-version-check Do not perform the version check at startup. Intended for automation scenarios & airgapped use. --trusted-microsoft-suffixes string Specifies additional domain suffixes where Azure Active Directory login tokens may be sent. The default is '*.core.windows.net;*.core.chinacloudapi.cn;*.core.cloudapi.de;*.core.usgovcloudapi.net;*.storage.azure.net'. Any listed here
are added to the default. For security, you should only put Microsoft Azure domains here. Separate multiple entries with semi-colons.
-v, --version version for azcopy
Use "azcopy [command] --help" for more information about a command.
Authorize AzCopy
You can provide authorization credentials by using Azure Active Directory (AD), or by using a Shared Access Signature (SAS) token.
Use this table as a guide:
Storage type
Currently supported method of authorization
Blob storage
Azure AD & SAS
Blob storage (hierarchical namespace)
Azure AD & SAS
File storage
SAS only
Option 1: Use Azure Active Directory
ใช้คำสั่ง azcopy login
> azcopy login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXXX to authenticate.
You can append a SAS token to each source or destination URL that use in your AzCopy commands.
This example command recursively copies data from a local directory to a blob container. A fictitious SAS token is appended to the end of the container URL.
$ sudo ufw app list
Available applications:
Apache
Apache Full
Apache Secure
OpenSSH
As indicated by the output, there are three profiles available for Apache:
Apache: This profile opens only port 80 (normal, unencrypted web traffic)
Apache Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
Apache Secure: This profile opens only port 443 (TLS/SSL encrypted traffic)
It is recommended that you enable the most restrictive profile that will still allow the traffic you’ve configured. Since we haven’t configured SSL for our server yet in this guide, we will only need to allow traffic on port 80:
WSL 2 ติดตั้งได้บน Windows 11 หรือ Windows 10 version 2004+ (Build 19041 and higher)
การติดตั้ง WSL 2
Open PowerShell or Windows Command Prompt in administrator mode by right-clicking and selecting “Run as administrator“
Enter the command: wsl --install
You’ll need to restart your machine following this installation process to begin using WSL.
คำสั่ง wsl --install จะติดตั้ง Ubuntu distribution เป็นค่า default แต่เราสามารถติดตั้ง Linux distributions อื่นได้
ดู Linux distribution ที่มีใน Microsoft Store ใช้คำสั่ง wsl --list --online
> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
OracleLinux_8_5 Oracle Linux 8.5
OracleLinux_7_9 Oracle Linux 7.9
SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4
openSUSE-Leap-15.4 openSUSE Leap 15.4
openSUSE-Tumbleweed openSUSE Tumbleweed
เลือก Linux distribution ที่จะติดตั้งด้วยคำสั่ง wsl --install --distribution <Distribution Name>
เปลี่ยน default Linux distribution ด้วย wsl --set-default <Distribution Name>
ที่ PowerShell เปิด Bash command line ไปที่ home directory ด้วย wsl ~ หรือ เปิด Bash command line โดยยังอยู่ที่พาทเดิมด้วย wsl และออกจาก Bash ด้วย exit
ที่ Bash เรียก Windows File Explorer ให้ชี้ไปที่ current directory path ด้วย explorer.exe . (อย่าลืมพิมพ์จุดด้วย)
คำสั่งของ Ubuntu ใน WSL2
คำสั่ง systemctl ใช้ไม่ได้
$ sudo systemctl status apache2
[sudo] password for jack:
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
$ gcloud version
Google Cloud SDK 334.0.0
alpha 2021.03.26
beta 2021.03.26
bq 2.0.66
core 2021.03.26
gsutil 4.60
View information about gcloud commands and other topics:
$ gcloud help
List accounts whose credentials are stored on the local system:
$ gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT
* example-user-1@gmail.com
example-user-2@gmail.com
To set the active account, run:
$ gcloud config set account `ACCOUNT`
List the properties in your active gcloud CLI configuration: