Skip to content

Instantly share code, notes, and snippets.

View forrest-mao's full-sized avatar

maolifu forrest-mao

  • OpsMind
  • Shanghai
View GitHub Profile
var dnsd = require('dnsd')
var http = require('http')
var datx = require('ipip-datx');
var value;
dnsd.createServer(function(req, res) {
var key = JSON.stringify(req.question).split(",")[0].split(":")[1]
value = req.connection.remoteAddress.toString()
@forrest-mao
forrest-mao / global-protect.sh
Created October 16, 2017 06:41 — forked from kaleksandrov/global-protect.sh
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
HTTP状态码 说明
200 操作执行成功。
298 部分操作执行成功。
400 请求报文格式错误。
1. 上传时,上传表单格式有误;
2. URL触发图片处理时,处理参数不正确;
3. 资源管理操作或者持久化处理操作请求格式有误。
401 认证授权失败,可能是密钥信息不正确、数字签名错误或授权已超时。
404 资源不存在。(包括空间资源不存在、镜像源资源不存在)
405 请求方式错误,非预期的请求方式。
406 上传的数据 CRC32 校验错。
419 用户账号被冻结。
echo -e "curl\tqboxrsctl"
#set variables
uploadFile="/home/jemy/Documents/qiniu.png"
uploadHost="upload.qiniu.com"
uploadToken="ELUs327kxVPJrGCXqWae9yioc0xYZyrIpbM6Wh6o:YEZCdEInhP2a-4Whb_D23nPl6b4=:eyJzY29wZSI6ImlmLXBibCIsImRlYWRsaW5lIjoxNDIyMDkxOTk3fQ=="
uploadBucket="if-pbl"
uploadTimes=1000
curlPrefix="curl_pic"
gecho -e "curl\tqboxrsctl"
#set variables
uploadFile="/Users/jemy/Documents/qiniu.png"
uploadHost="up.qiniu.com"
uploadToken="ELUs327kxVPJrGCXqWae9yioc0xYZyrIpbM6Wh6o:YEZCdEInhP2a-4Whb_D23nPl6b4=:eyJzY29wZSI6ImlmLXBibCIsImRlYWRsaW5lIjoxNDIyMDkxOTk3fQ=="
uploadBucket="if-pbl"
uploadTimes=1000
curlPrefix="curl_1277431"

Getting Started with Ufop on Qiniu

====

1. Introduction

这个教程的目的是快速上手部署和使用一个 Ufop 的应用。

当然这个教程开始前需要做一下的准备:

@forrest-mao
forrest-mao / run.py
Last active August 29, 2015 14:12 — forked from longbai/run.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import qiniu
from qiniu.services.storage import bucket as bucketop

Getting Started with Ufop on Qiniu

====

1. Introduction

这个教程的目的是快速上手部署和使用一个 Ufop 的应用。

当然这个教程开始前需要做一下的准备:

package qiniu.demo;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicNameValuePair;
import com.qiniu.api.auth.DigestAuthClient;

callbackUrl returnUrl 和 persistentNotifyUrl 七牛的请求和处理说明和demo

这里 的 对你的 callbackUrl 发送的请求是x-www-form-urlencoded 类型的Post请求 enter image description here 为了给客户端有一致的体验,我们要求 callbackUrl 返回包 Content-Type 为 "application/json",即返回的内容必须是合法的 JSON 文本。 enter image description here

对你的 persistentNotifyUrl 发送的请求 是application/json 类型的POST请求

persistentNotifyUrlRequest