Skip to content

Instantly share code, notes, and snippets.

View bfgits's full-sized avatar

Simon bfgits

  • Shenzhen
View GitHub Profile
@bfgits
bfgits / curl.md
Last active January 12, 2021 07:34 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@bfgits
bfgits / change_dns_servers
Created November 13, 2020 02:19
How can I configure an Amazon Elastic Compute Cloud (Amazon EC2) instance with static DNS server entries that persist when the instance is rebooted?
Short Description
The default behavior of an Amazon EC2 instance associated with an Amazon Virtual Private Cloud (Amazon VPC) is to request a DNS server address at startup using the Dynamic Host Configuration Protocol (DHCP). The DNS server addresses returned in the DHCP response are written to the local /etc/resolv.conf file. Manual modifications to the resolv.conf file with custom DNS server addresses are lost when the instance is restarted. The method that you use to solve this issue depends on your Linux distribution. For more information on VPCs and DNS servers, see Amazon DNS Server.
Resolution
Important: Before you change your Amazon EC2 instance, create a backup using an Amazon Machine Image (AMI) or an Amazon Elastic Block Store (Amazon EBS) snapshot. Changing networking configuration for an instance might render the instance unreachable.
Amazon Linux, Amazon Linux 2
Use one of the following options to configure your Amazon EC2 instance. If you apply both options, then the DNS servers specified in