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
| import argparse | |
| import logging | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--verbose', '-v', action='count', default=1) | |
| args = parser.parse_args() | |
| args.verbose = 70 - (10*args.verbose) if args.verbose > 0 else 0 | |
| logging.basicConfig(level=args.verbose, format='%(asctime)s %(levelname)s: %(message)s', |
| \n | |
| ============= HOST: ==========\n | |
| \n | |
| local_ip: %{local_ip}\n | |
| local_port: %{local_port}\n | |
| remote_ip: %{remote_ip}\n | |
| remote_port: %{remote_port}\n | |
| \n | |
| ======= CONNECTION: ==========\n | |
| \n |
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
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c and [c.
Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
| git config --global url."https://github.com/".insteadOf [email protected]: | |
| git config --global url."https://".insteadOf git:// |
In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run,
you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:
ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'(note that all in this command line stands for the target hostname)
If you have only one host to run your playbook against, your inventory string must ends with ,
| apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| name: mongodb-pv-claim | |
| labels: | |
| app: mongodb | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: |