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
<?php | |
while (true) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://auth.docker.io/token?scope=repository:imdevops/hfish:pull&service=registry.docker.io"); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = json_decode(curl_exec($ch), true); | |
curl_close($ch); |
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 | |
# -*- coding:utf-8 -*- | |
import base64 | |
import hashlib | |
import hmac | |
import json | |
import random | |
from datetime import datetime | |
from urllib.parse import urlencode |
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
<?php | |
$graphql = '{ | |
inbox(namespace: "prefix" tag:"") { | |
result message count emails { | |
id | |
namespace | |
tag | |
timestamp |
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
import json | |
import boto3 | |
import datetime | |
def lambda_handler(event, context): | |
ec2 = dict() | |
cloudwatch = boto3.client('cloudwatch') | |
for metric in ['CPUUtilization', 'CPUCreditUsage', 'CPUCreditBalance']: | |
response = cloudwatch.get_metric_statistics( | |
Namespace = 'AWS/EC2', |
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
<?php | |
require_once 'vendor/autoload.php'; | |
error_reporting(0); | |
function make_books($url) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); |
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
import requests | |
import json | |
import base64 | |
import sqlite3 | |
import zlib | |
import time | |
from datetime import datetime | |
from gql import gql, Client | |
from gql.transport.requests import RequestsHTTPTransport |
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
<?php | |
require 'vendor/autoload.php'; | |
$credentials = new Aws\Credentials\Credentials('x', 'x'); | |
$sts = new Aws\Sts\StsClient([ | |
'version' => 'latest', | |
'region' => 'us-east-1', | |
'credentials' => $credentials | |
]); |
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
import boto3 | |
client = boto3.client('sts',region_name='us-east-1',aws_access_key_id='xxxx',aws_secret_access_key='xxxx') | |
response = client.assume_role( | |
RoleArn = 'arn:aws:iam::066600000000:role/xxx', | |
RoleSessionName = 'newsession', | |
DurationSeconds = 43200 | |
)['Credentials'] |
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
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTShadowClient | |
import logging | |
import time | |
import json | |
import os | |
import threading | |
clientId="piserver" | |
thingName="AWSIoTPi" | |
myAWSIoTMQTTShadowClient = AWSIoTMQTTShadowClient(clientId) |
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
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTShadowClient | |
import logging | |
import time | |
import json | |
class shadowCallbackContainer: | |
def __init__(self, deviceShadowInstance): | |
self.deviceShadowInstance = deviceShadowInstance | |
# 回调函数,云平台接收到新数据. |