An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| --- | |
| # Deploy rails app from localhost to remote servers | |
| - name: Set up AWS infrastructure | |
| hosts: localhost | |
| connection: local | |
| roles: | |
| - setup_aws | |
| - name: Package app |
There are two main modes to run the Let's Encrypt client (called Certbot):
Webroot is better because it doesn't need to replace Nginx (to bind to port 80).
In the following, we're setting up mydomain.com.
HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.
| # Index | |
| --------------------------------------------------------------------- | |
| curl -XPUT http://localhost:9200/pictures/ -d ' | |
| { | |
| "settings": { | |
| "analysis": { | |
| "analyzer": { | |
| "index_analyzer": { | |
| "tokenizer": "standard", |
| #!/bin/sh | |
| echo "\n --- delete index" | |
| curl -X DELETE 'http://localhost:9200/' | |
| echo "\n --- create index and put mapping into place" | |
| curl -X POST 'http://localhost:9200/myindex/' -d '{ | |
| "mappings" : { | |
| "person" : { | |
| "properties" : { |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name example.com www.example.com *.example.com; | |
| include global/letsencrypt-redirect.conf; | |
| } | |
| server { | |
| listen 443 ssl http2; |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
| certbot revoke -d your-site.com -d your-site.net |