This file contains hidden or 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
import boto3 | |
def update_route53_record(hosted_zone_id, domain_name, action, ip_address, ttl=300): | |
client = boto3.client('route53') | |
# Check if the action is valid | |
if action not in ('UPSERT', 'DELETE'): | |
print("Invalid action. Use 'UPSERT' to add/update or 'DELETE' to remove.") | |
return |
This file contains hidden or 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
server { | |
listen 80; | |
server_name sb.domain.com; | |
return 301 https://sb.domain.com$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name sb.domain.com; |
This file contains hidden or 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
bind 127.0.0.1 | |
protected-mode yes | |
port 6379 | |
tcp-backlog 65384 | |
unixsocket /tmp/redis_6379.sock | |
unixsocketperm 700 | |
timeout 0 | |
tcp-keepalive 300 | |
daemonize no | |
supervised no |
This file contains hidden or 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
[Unit] | |
Description=Redis persistent key-value database | |
After=network.target | |
[Service] | |
ExecStart=/usr/local/bin/redis-server /etc/redis/6379.conf --daemonize no --supervised systemd | |
ExecStop=/usr/libexec/redis-shutdown | |
#Type=notify | |
User=redis | |
Group=redis |
This file contains hidden or 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
{ | |
'data': [ | |
{ | |
'name': 'impressions', | |
'period': 'lifetime', | |
'values': [ | |
{ | |
'value': 13 | |
} | |
], |
This file contains hidden or 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
import requests | |
def get_url(instagram_media_id,instagram_token): | |
url = ""https://graph.facebook.com/v14.0/" + str(instagram_media_id) + "/insights?metric=impressions%2Cengagement%2Creach%2Csaved%2cvideo_views&access_token=" + str(instagram_token) | |
r = requests.get(url) | |
return r.json() |
This file contains hidden or 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
import requests | |
def get_url(instagram_profile_id,instagram_token): | |
url = "https://graph.facebook.com/v14.0/"+str(instagram_profile_id)+"/media?fields=id%2Ccaption%2Cis_comment_enabled%2Ccomments_count%2Clike_count%2Cmedia_type%2Cmedia_url%2Cpermalink&access_token="+str(instagram_token) | |
r = requests.get(url) | |
return r.json() |
This file contains hidden or 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
gcloud scheduler --project micheleone \ | |
jobs create http import_catalog_xmq5ynl8i2i \ | |
--time-zone='America/Los_Angeles' \ | |
--schedule='0 0 * * *' \ | |
--uri='https://retail.googleapis.com/v2alpha/projects/***********/locations/global/catalogs/default_catalog/branches/1/products:import' \ | |
--description='Import Retail catalog data' \ | |
--headers='Content-Type: application/json; charset=utf-8' \ | |
--http-method='POST' \ | |
--message-body='{"inputConfig":{"bigQuerySource":{"projectId":"project-id","datasetId":"retail","tableId":"catalog","dataSchema":"product"}},"reconciliationMode":"INCREMENTAL"}' \ | |
--oauth-service-account-email='' |
This file contains hidden or 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
{"id": sku,"categories":categories],"title":description,"priceInfo":[{"currencyCode":"USD"},{"price":float(exact_price)},{"originalPrice":float(exact_price)},{"cost":float(exact_price)}]} |
This file contains hidden or 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": "product_metadata", | |
"type": "RECORD", | |
"mode": "NULLABLE", | |
"fields": [ | |
{ | |
"name": "images", | |
"type": "RECORD", | |
"mode": "REPEATED", |
NewerOlder