免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2015年1月28日 星期三

heroku dropbox connect


* deploy from dropbox to heroku

0. login heroku.com
1. heroku personal apps -> click the target app(e.g. dropbox-cat) ->
2. click 'Deploy' on the top horizon menu "Resources, Deploy, Metrics, Activity, Access, Settings"
3. -> click 'Dropbox' , Heroku will connect to Dropbox and
create folder 'dropbox-cat' under Dropbox/Apps/Heroku/

4. move or copy or upload app files to Dropbox/Apps/Heroku/dropbox-cat/ [on Dropbox site]

5. Deploy all your changes in the Dropbox folder to target app. [on Heroku site]


* the mechanism is to use dropbox as a folder instead of git repo
* the appname has to match that under Dropbox/Apps/Heroku/


""" ...
Changes in Dropbox will sync to Heroku Git and vice versa.

... """



https://devcenter.heroku.com/articles/dropbox-sync

""" ...

You cannot deploy from any folder in your Dropbox, only the folders that Heroku create in Dropbox/Apps/Heroku will work.
If you have existing code, link your app, wait for Heroku to create the folder in your Dropbox
and move or copy your code into that folder.
...

Collaboration

Dropbox Sync is integrated with the Heroku Collaboration model.
Changes deployed from Dropbox are committed to the app’s git repo.
Heroku will also sync Git pushes to linked Dropbox folders.

Collaborators on an app can each link their Dropbox accounts with the app.
Collaborators using Dropbox will each get their own app folder in their Dropbox accounts.
Changes are automatically synced to all linked Dropbox folders
and collaborators using Git can pull changes deployed using Dropbox.
...

..."""


//=== error occurred when trying to connect existing app to Dropbox
"""
Item could not be created:
Unprocessable entity.

"""


github to heroku, bower not found


* deploy from github to heroku
[prerequisite : create a repo git on github, push an app to the git]


0. login heroku.com
1. heroku personal apps -> click the target app ->
2. click 'Deploy' on the top horizon menu "Resources, Deploy, Metrics, Activity, Access, Settings"
3. -> click 'GitHub(beta)' -> connect to the source git on github
4. -> Manual deploy
5. -> Open app [ click the top icon beside 'star' ]


* if build error
-> click 'Activity' on the top horizon menu "Resources, Deploy, Metrics, Activity, Access, Settings"
-> revise package.json, Procfile ...


* error when trying to deploy angular-phonecat
""" ... sh: 1: bower: not found

npm ERR! angular-phonecat@0.0.0 postinstall: `bower install`
npm ERR! Exit status 127
... """


-->
http://stackoverflow.com/questions/24534920/deploying-to-heroku-with-grunt-bower-node-modules

"engines": {
"node": "0.10.29"
},
"dependencies": {
"bower": "^1.3.5"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install"
},




2015年1月27日 星期二

codio to heroku, RPC failed error,

//=== http://forum.codio.com/t/deploying-app-to-heroku/1589/3
deploy app from codio.com to heroku.com

* first install heroku commandline client for codio
$ parts install heroku-cli


$ cd myApp

* git init if necessary
...


$ heroku login
Enter your Heroku credentials.
Email: .......
Password (typing will be hidden):
Authentication successful.


$ heroku apps
...

* delete an app (e.g. 'oldApp') if 5 apps already exist
$ heroku apps:destroy oldApp
...

* create new app repo on Heroku for myApp
$ heroku apps:create heroku-myApp [default http-git]
[$ heroku create heroku-myApp --ssh-git]
...


* default http-git
$ git remote -v
// $ heroku git:remote --http-git
heroku https://git.heroku.com/heroku-myApp.git (fetch)
heroku https://git.heroku.com/heroku-myApp.git (push)
origin ....git (fetch)
origin ....git (push)



* ssh-git
$ heroku git:remote --ssh-git
$ git remote -v
heroku git@heroku.com:heroku-myApp.git (fetch)
heroku git@heroku.com:heroku-myApp.git (push)
origin ....git (fetch)
origin ....git (push)



* add SSH key for ssh-git
$ heroku keys: add

$ git push heroku master
[$ git push -u origin master] ?


//=== git config
$ git config -l
$ git config --global -l
$ git config --local -l




//=== if myApp is cloned from another git "partially" [ --depth n , shallow clone ]
error: RPC failed; result=22, HTTP code = 400 ...
fatal: The remote end hung up unexpectedly ...

--> git config http.postBuffer 52428800?
--> try ssh-git got the more relevant error msg

RSA key fingerprint is ...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,50.19.85.132' (RSA) to ...
Initializing repository, done.
Counting objects: 450, done.
Compressing objects: 100% (221/221), done.

*** fatal: protocol error: expected old/new/ref, got 'shallow d18c6 ...

error: pack-objects died of signal 13
error: failed to push some refs to 'git@heroku.com:heroku...



--> git fetch --unshallow

https://github.com/travis-ci/dpl/issues/127
""" ...
Travis' shallow clone can fail heroku deploys using `git` strategy #127
...

... Git 1.9, which added pushing-shallow-clone to the git protocol. Heroku's Git version does not understand this.
... workaround would be to run git fetch --unshallow before the deploy.

... """

2015年1月23日 星期五

nodejs require() 參數用法


var app = require('./app')(cfg, dirp);

./app/index.js
module.exports = function(configFile, dirpath){ ... }



//=== http://stackoverflow.com/questions/7367850/node-js-require-function-and-parameters

""" ...

// somefile
require("lib.js")(app, param2)
// lib.js
module.exports = function(app, param2) { }
...


module.exports = exports = function() 
{ console.log('arguments: %j\n', arguments); };

> var requires = require('./requires')(0,1,2,3,4,5);
arguments: {"0":0,"1":1,"2":2,"3":3,"4":4,"5":5}


...

first check to see that your object is defined properly 
(and spelled properly when you pass it in), 
then check that you don't have syntax errors.

..."""

2015年1月20日 星期二

ssh, https 的差別

//=== 大概來說(roughly speaking)

ssh client 通常是命令列介面(command line interface)
https client 常見的就是瀏覽器(browser)

ssh client 將自身的公鑰(public key) 上傳至 ssh server
https client 則將 https server的公鑰/憑證(public key/certificate) 下載回來

ssh client 用自身的密鑰(private key) 來加密/登入 ssh server
https client 則用 https server的公鑰來加密 ...



2015年1月19日 星期一

codio, drupal starter pack


1. www.codio.com signup and Login
2. click "Starter Packs" on the left side-bar
3. click "CODIO-CERTIFIED / Drupal" starter pack
4. click "Use Pack" on the right side
5. fill in project name for the trial, then codio will install the chosen pack ...

... after installation of starter pack[an ubuntu box?]
6. Project [FileTree] -> Configure
-> Terminal will open and run drush to install drupal

7. Preview to visit the just-create drupal site

8. Project -> Box Info
...
http(s)://xxx-yyyy-3000.codio.io

WEB: Static Content

http://xxx-yyyy.codio.io
https://xxx-yyyy.codio.io
...



//===
Terminal, Shift+Alt+T
Code Beautify, Ctl+Shift+ B



//===
mysql> create database druDB
-> ;
Query OK, 1 row affected (0.01 sec)

mysql> create user codio identified by 'codioxxx'
-> ;
Query OK, 0 rows affected (0.05 sec)

mysql> use mysql;

mysql> delete from user where user='codio';
Query OK, 1 row affected (0.00 sec)

mysql> create user codio@localhost identified by 'codioxxx';


mysql> grant all privileges on druDB.* to codio@localhost;
Query OK, 0 rows affected (0.04 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)



2015年1月8日 星期四

Line 用電話號碼加好友?


[Q] Line 用電話號碼加好友?

//===
試了好一會兒, Line 似乎無法透過電話號碼加好友

必須透過「搖一搖」、「行動條碼」、「ID搜尋」或者 邀請(簡訊/email/...)

或者允許Line上傳 平板/手機 的 通訊錄/聯絡人 資料到Line的伺服器

...