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)
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

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

@forrest-mao
forrest-mao / pfop.ph
Last active August 29, 2015 14:06 — forked from ikbear/pfop.ph
<?php
require_once("../../qiniu/http.php");
require_once("../../qiniu/auth_digest.php");
require_once("../../qiniu/utils.php");
$accessKey = "aW6EvpZBvWr5Qq3HiFCLiCmvkJORHN8oE-vKR8-z";
$secretKey = "8T270kMZuVZHRjLt6ACKdXj3VAAwPbmeOykQdmOA";
$bucket = "kouqiangzhongzhi";