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'; | |
$mongo = new MongoDB\Client("mongodb://taterli:f697bb912da7f4d210382c67@127.0.0.1:27017"); | |
$db = $mongo->wa; //选择数据库 | |
$collection = $db->zhihu; //选择文档集合 | |
$next_qid = null; /* 首次 */ | |
$first_qid = 0; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <net/if.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.h> | |
#include <netinet/ether.h> | |
#include <netpacket/packet.h> | |
#include <netinet/in.h> | |
#include <time.h> |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using System.Runtime.InteropServices; | |
using System.Diagnostics; |
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
<?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'] |