Minimal example how to use CouchDB JSON exports without any server-side middleware (Ruby, Python, PHP, etc) and showcase its features.
For real „standalone applications“, called CouchApps, see the CouchDB book.
| # http://rubular.com/regexes/11722 | |
| # sudo gem install dm-core | |
| # sudo gem install dm-validations | |
| # sudo gem install do_sqlite3 | |
| # parse walk server (www.planobe.com.br) log files and write to a database called walk_server.sqlite3 on current directory/db | |
| # Using: | |
| # ruby wsparser.rb walk_server2/LOGS/ | |
| require 'rubygems' |
| THIS DOCUMENT MOVED TO http://chneukirchen.github.com/rps/ | |
| AND http://github.com/chneukirchen/rps | |
| = Ruby Packaging Standard | |
| The aim of this document is two-fold. First, to specify a common | |
| structure of how a Ruby package distributed as source (that is, but | |
| not limited to, development directories, version-controlled | |
| repositories, .tar.gz, Gems, ...) should conform to. |
| # Use this commands inside app folder | |
| git init | |
| git status | |
| git add . | |
| git commit -a | |
| touch tmp/.gitignore log/.gitignore vendor/.gitignore | |
| # Create this .gitignore file | |
| .DS_Store | |
| log/*.log |
| require 'win32ole' | |
| # based on this tutorial http://www.autoitscript.com/autoit3/docs/tutorials/notepad/notepad.htm | |
| # 1. Download http://www.zapt.in/9Qt | |
| # 2. Put the AutoItX3.dll on c:\windows\system32 | |
| # 3. Open the DOS Prompt and register the dll with: "regsvr32 C:\windows\system32\AutoItX3.dll | |
| # 4. Install Ruby if you don't have it already installed: http://www.rubyinstaller.org/ | |
| # 5. Execute this file | |
| @au3 = WIN32OLE.new "AutoItX3.Control" |
Minimal example how to use CouchDB JSON exports without any server-side middleware (Ruby, Python, PHP, etc) and showcase its features.
For real „standalone applications“, called CouchApps, see the CouchDB book.
| From 991801b97297ac5047f42412e2d5ef3eb7bab0d8 Mon Sep 17 00:00:00 2001 | |
| From: luisbebop <[email protected]> | |
| Date: Thu, 29 Jul 2010 15:02:58 -0300 | |
| Subject: [PATCH] Implemented W3C CORS on httpd interface. Closes COUCHDB-832 | |
| --- | |
| src/couchdb/couch_httpd.erl | 27 ++++++++++++++++++++------- | |
| 1 files changed, 20 insertions(+), 7 deletions(-) | |
| diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl |
| # where do you want couchdb and its deps to be installed | |
| COUCHDB_PREFIX=/opt/couchdb-1.0.0 | |
| # download, chmod and install | |
| curl "http://dl.couchone.com/dl/20e4ab59869fc48828db075f7c000c70/couchdb-1.0.0_1-linux-x64-installer.bin" -O | |
| echo "`curl http://dl.couchone.com/dl/_design/dl/_show/sha1/20e4ab59869fc48828db075f7c000c70 --silent` couchdb-1.0.0_1-linux-x64-installer.bin" | sha1sum --check - | |
| chmod u+x couchdb-1.0.0_1-linux-x64-installer.bin | |
| ./couchdb-1.0.0_1-linux-x64-installer.bin --prefix $COUCHDB_PREFIX --mode unattended | |
| # link into /etc/init.d/couchdb and setup couchdb for auto-startup |
| AppObject = CreateAppObj(4); // for ETHERNET | |
| //terminais Vx510 6A2 com modem ethernet comum ou Vx510 11A1 com modem ethernet interno USB | |
| if (SVC_INFO_MODULE_ID(3) == 22) | |
| comnObj = uclFactory->Create(COM3, &ret, (ApplicationObj *)AppObject,ETHERNET); | |
| else | |
| comnObj = uclFactory->Create(COM_ETH1, &ret, (ApplicationObj *)AppObject,ETHERNET); | |
| // utilizado camada IP/PPP em DIAL, GPRS, GSM suportados pelas rotinas da biblioteca UCL | |
| ret = AssignUcltoTCP(comnObj, timer, 20000, 60000, 30000, 15000, 6000, 6000); |
| //tcp ssl | |
| if(strcmp(UCLprotocol, "TCP") == 0 && withSSL) | |
| { | |
| handleSocket = socket(AF_INET, SOCK_STREAM | SOCK_SSL, 0); | |
| if(handleSocket >= 0) | |
| { | |
| if((strcmp(UCLmedia, "ETHERNET")) == 0) | |
| { | |
| timeout.tv_sec = 5; | |
| timeout.tv_usec = 100; |
| module Crc16 | |
| def crc16_hex(buf) | |
| crc = crc16(buf) | |
| # to swap the number just invert the order of the indexes [0..1] and [2..3] | |
| "#{crc.to_s(16).rjust(4,"0")[0..1]}#{crc.to_s(16).rjust(4,"0")[2..3]}".upcase | |
| end | |
| def crc16(buf, crc=0) | |
| buf.each_byte{|x| crc = ((crc<<8) ^ CCITT_16[(crc>>8) ^ x])&0xffff} |