Skip to content

Instantly share code, notes, and snippets.

View kzhangworks's full-sized avatar

Kefeng Zhang kzhangworks

  • Axway
  • Beijing, PRC
View GitHub Profile
@kzhangworks
kzhangworks / gist:4036677
Created November 8, 2012 03:54 — forked from erkde/gist:1233435
Rake tasks to list, export & import Mongo DB collections
namespace :mongo do
def db_name
Mongoid.database.name
end
def db_connection_options
host, port = Mongoid.database.connection.host_to_try
auths = Mongoid.database.connection.auths
#!/bin/bash
set -e
cd ~/
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
tar -zxf mysql-5.1.65.tar.gz
cd mysql-5.1.65
./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
make
@kzhangworks
kzhangworks / gist:7712c47684c895afc19e
Last active August 29, 2015 14:10
POST /v1/admins/apps to create app
curl -b cookies.txt -c cookies.txt -X POST -F "name=local" -F "description=local dev" -F "pretty_json=true" "http://api-local.cloud.appcelerator.com/v1/admins/apps"
{
"meta": {
"code": 200,
"status": "ok",
"method_name": "createApp"
},
"response": {
"apps": [
@kzhangworks
kzhangworks / gist:24eeebaabf642ce5dbff
Created November 26, 2014 07:03
PUT /v1/admins/apps to update app
curl -b cookies.txt -c cookies.txt -X PUT -F "description=test-3" "http://api-local.cloud.appcelerator.com/v1/admins/apps?key=xAP777Rw7uOSlOyRwW7F1BgqBJCsP9S9&pretty_json=true"
{
"meta": {
"code": 200,
"status": "ok",
"method_name": "updateApp"
},
"response": {
"apps": [
@kzhangworks
kzhangworks / gist:b53d2187d5fc02ea7a5c
Created November 26, 2014 07:04
DELETE /v1/admins/apps to delete app
curl -b cookies.txt -c cookies.txt -X DELETE "http://api-local.cloud.appcelerator.com/v1/admins/apps?app_id=54754cd2dda0950809000004&pretty_json=true"
{
"meta": {
"status": "ok",
"code": 200,
"method_name": "deleteApp"
}
}
@kzhangworks
kzhangworks / gist:5668baf3ff7154353f5e
Created November 26, 2014 07:05
GET /v1/admins/apps to show app
curl -b cookies.txt -c cookies.txt -X DELETE "http://api-local.cloud.appcelerator.com/v1/admins/apps?app_id=54754cd2dda0950809000004&pretty_json=true"
{
"meta": {
"status": "ok",
"code": 200,
"method_name": "deleteApp"
}
}
@kzhangworks
kzhangworks / gist:d16269db73ec7d7f3eb9
Created November 26, 2014 07:06
DELETE /v1/admins/apps/data delete app data
curl -b cookies.txt -c cookies.txt -X DELETE "http://api-local.cloud.appcelerator.com/v1/admins/apps/data?app_id=54754cd2dda0950809000004&pretty_json=true"
{
"meta": {
"status": "ok",
"code": 200,
"method_name": "deleteAppData"
}
}
@kzhangworks
kzhangworks / gist:6eff5f51eeab949e7ff6
Created November 26, 2014 07:08
PUT to /v1/admins/apps/apple/certs upload apple certificate
curl -b cookies.txt -c cookies.txt -X PUT -F "certificate_dev=@aps_development.cer" "http://api-local.cloud.appcelerator.com/v1/admins/apps/apple/certs?key=xAP777Rw7uOSlOyRwW7F1BgqBJCsP9S9&pretty_json=true"
{
"meta": {
"code": 400,
"status": "fail",
"message": "Error: Fail to verify certificate file: aps_development.cer. Please make sure the password is correct.",
"method_name": "setApplePushCertificate"
}
}
@kzhangworks
kzhangworks / gist:271e6c1dcd849cb63fe9
Created November 26, 2014 07:09
DELETE to /v1/admins/apps/apple/certs delete apple certificate
curl -b cookies.txt -c cookies.txt -X DELETE "http://api-local.cloud.appcelerator.com/v1/admins/apps/apple/certis?key=xAP777Rw7uOSlOyRwW7F1BgqBJCsP9S9&pretty_json=true"
{
"meta": {
"code": 400,
"status": "fail",
"message": "There is no certificate to remove.",
"method_name": "removeApplePushCertificate"
}
}
@kzhangworks
kzhangworks / gist:cd60836cfacfc78d5066
Last active August 29, 2015 14:10
PUT to /v1/admins/apps/android/certs set android keys
curl -X PUT -F 'android_gcm_sender_id=****' -F 'android_gcm_apikey=*******-kCwc' "http://api-local.cloud.appcelerator.com/v1/admins/apps/android/certs?key=xAP777Rw7uOSlOyRwW7F1BgqBJCsP9S9&pretty_json=true&_session_id=9mtn8gbx92eY7LpRzQ1iV2YZjGA"
{
"meta": {
"code": 200,
"status": "ok",
"method_name": "setAndroidPushCertificates"
},
"response": {