- Goto https://console.cloud.google.com and create a new project
- Goto project and create an API service
- Choose Youtube API Data v3 from the inventory marketplace
- Create API key credentials
- Create OAuth 2.0 Client-ID (type other)
- Remark: For access public API data only the API key is require, for read/write access to your account you need the OAuth 2.0 thing
- Browse to the OAuth 2.0 project url: https://accounts.google.com/o/oauth2/auth?client_id=[my_client_id]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/youtube&response_type=code
- You'll get a code for your Youtube account. Together with the OAuth 2.0 Client-ID and Client-Secret you can make a curl request to get a token
- curl --request POST --data "code=[my_code]&client_id=[my_client_id]&client_secret=[my_client_secret]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token
- Put the API Key and the OAuth Token into the keys.yml. The token is valid for one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- include_vars: _elb_secrets.yml | |
- name: Send request to API | |
uri: | |
url: "{{ AUTH_URL_ELB }}" | |
method: POST | |
body_format: raw | |
follow_redirects: all | |
return_content: yes | |
validate_certs: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import subprocess | |
import re | |
def containers(): | |
lxcOutput = subprocess.check_output( ['lxc', 'list' ] ) | |
ips = re.compile( '\d+\.\d+\.\d+\.\d+' ).findall( str( lxcOutput ) ) | |
nodes = dict( hosts = ips, vars = { "ansible_user": "root" } ) | |
inventory = dict( nodes = nodes ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Request ecs list by tags from ECS API | |
uri: | |
url: "{{ AUTH_URL_ECS }}/servers?tags={{ mykey }}.{{ myvalue }}" | |
method: GET | |
return_content: yes | |
validate_certs: yes | |
HEADER_Content-Type: "application/json" | |
HEADER_X-Auth-Token: "{{ token['x_subject_token'] }}" | |
register: ecslist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: "localhost" | |
gather_facts: no | |
tasks: | |
- name: Search for projects | |
uri: | |
url: "https://translate.openstack.org/rest/projects" | |
method: GET | |
return_content: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python i18njson-translate.py --help | |
Usage: i18njson-translate.py [OPTIONS] INPUTFILE OUTPUT | |
Process and translate .po or JSON files and generate translated .po file | |
in result. Can work with exist .po files and if in initial file msgid | |
dissapear then mark translaed string as obsolete. Try to play nice with | |
version control systems and follow initial file order format, you will get | |
predicteable diffs. | |
Options: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content-Type: multipart/mixed; boundary="===============8494485615320709508==" | |
MIME-Version: 1.0 | |
--===============8494485615320709508== | |
Content-Type: text/cloud-boothook; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="boothook.sh" | |
#cloud-boothook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<!-- CSS Code --> | |
<style type="text/css" scoped> | |
.GeneratedMarquee { | |
font-family:Arial, sans-serif; | |
font-size:2em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```plantuml | |
title Train QA | |
actor "Traveller" as traveller | |
participant "DB station realtime API" as db | |
participant "Data collector" as trains2 | |
participant "Google Spreadsheet" as google | |
participant "Tableau data viz" as tableau |
OlderNewer