Difference between revisions of "Meteor"

From Wiki2
(Created page with " https://atmosphere.meteor.com/ packages by community [https://atmosphere.meteor.com/wtf/app wtf] Running the app :With the smart package installed and smart.json in place yo...")
 
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
==http://meteor.com==
[http://projectricochet.com/blog/meteor-js-performance#.UwZ-cvldWSo meteor performance]
http://shiggyenterprises.wordpress.com/2013/09/28/developing-a-full-text-search-enabled-meteor-app/
https://www.openshift.com/blogs/day-15-meteor-building-a-web-app-from-scratch-in-meteor Great! parleyV12/var/www/fworks/meteor/epool
http://yauh.de/articles/376/best-learning-resources-for-meteorjs
https://github.com/DiscoverMeteor/Microscope
https://hackpad.com/Top-Resources-for-learning-MeteorJS-Nrpnr6CHiGs
http://andrewscala.com/meteor/


https://atmosphere.meteor.com/ packages by community [https://atmosphere.meteor.com/wtf/app wtf]
https://atmosphere.meteor.com/ packages by community [https://atmosphere.meteor.com/wtf/app wtf]
Line 4: Line 18:
Running the app
Running the app
:With the smart package installed and smart.json in place you can now run your app using Meteorite to start using the newly installed package.
:With the smart package installed and smart.json in place you can now run your app using Meteorite to start using the newly installed package.
mrt -p 3333
====running on another machine====
ROOT_URL=http://10.0.1.101:3000 meteor
ROOT_URL=http://10.0.1.101:3000 mtr //meteorite smart.json
====perhaps another Meteor is running?====
sudo ps -x | grep meteor
sudo kill -s KILL 29484
====how to deploy====
http://stackoverflow.com/questions/21208957/deploying-meteor-app-to-own-server/21210384#21210384
=====epoll example=====
{{:mongodb}}
====stuff2getM====
=====predictive search=====
http://stackoverflow.com/questions/13010151/input-text-return-event-in-meteor
=====items and nitems====


mrt -p 3333
#add {{> nitiems}} to main and create {{nitems}} template in stuff2get.html
#create Tempalete.nitems.items and wire it up to respond to itemsHandle by adding Template.nitems.loading and Templates.nitiems.any_list_selected

Latest revision as of 18:25, 20 February 2014

http://meteor.com

meteor performance

http://shiggyenterprises.wordpress.com/2013/09/28/developing-a-full-text-search-enabled-meteor-app/

https://www.openshift.com/blogs/day-15-meteor-building-a-web-app-from-scratch-in-meteor Great! parleyV12/var/www/fworks/meteor/epool

http://yauh.de/articles/376/best-learning-resources-for-meteorjs

https://github.com/DiscoverMeteor/Microscope

https://hackpad.com/Top-Resources-for-learning-MeteorJS-Nrpnr6CHiGs

http://andrewscala.com/meteor/

https://atmosphere.meteor.com/ packages by community wtf

Running the app

With the smart package installed and smart.json in place you can now run your app using Meteorite to start using the newly installed package.
mrt -p 3333

running on another machine

ROOT_URL=http://10.0.1.101:3000 meteor
ROOT_URL=http://10.0.1.101:3000 mtr //meteorite smart.json

perhaps another Meteor is running?

sudo ps -x | grep meteor
sudo kill -s KILL 29484

how to deploy

http://stackoverflow.com/questions/21208957/deploying-meteor-app-to-own-server/21210384#21210384

epoll example

mongo

install on pi3

manual install to ubuntu

  1. wget
  2. create binaries
  3. add user
  4. change owner/permissions strip extra shit
  5. copy binaries to /usr/bin
  6. create a log directory
  7. set its owner/premisions
  8. create a /etc/mongodb.conf
  9. create systemd seervice entry
  10. sudo service mongodb start/status/stop
  11. create symlinks to executable directories
  12. create symlink to buried conf files


http://andyfelong.com/2016/01/mongodb-3-0-9-binaries-for-raspberry-pi-2-jessie/

sudo adduser --ingroup nogroup --shell /etc/false --disabled-password --gecos"" --no-create-home mongodb



mongo examples

works

show dbs
use stuffDb
show collections
db.users.insert({email:"mckenna.tim@gmail.com"})
  WriteResult({ "nInserted" : 1 })
db.users.find().pretty()
db.users.update({email:"mckenna.tim@gmail.com"},{email:"mckenna.tim@gmail.com", timestamp: Date.now()})

db.lists.find({lid: "Jutebi"}, {items:1}).pretty()

var u = db.lists.find({lid: "Jutebi"}, {items:1})
u.pretty()
while (u.hasNext()) {print(tojson(u.next()));}
u.forEach(function(x){print(tojson(x))})
// u.forEach(function(x){print(x.product)})
u.forEach(function(x){print(x)})

db.lists.find({lid: "Jutebi"}, {"items.product":1}).pretty() //just the products

var w = db.lists.find({lid: "Jutebi"}, {"items.product":1}) 
w.pretty()
w.forEach(function(x){print(tojson(x))})
w.toArray()
var t = db.lists.find({lid: "Jutebi"}, {"items.product":1}).toArray()

==== doesnt db.lists.find({lid: "Jutebi"}, {"items.product":1}).forEach(function(x){print(x.product);})

var u = db.lists.find({lid: "Jutebi"}, {items:1})

while(u.hasNext()){print(u.Next().product);} while (u.hasNext()) {print(tojson(u.next()));}

db.devices.find({devid:"CYURD001"})

db.devices.update({devid:"CYURD001"}, {$set:{loc:{ lat: 14.34500000, lng: -72.44400000, timezone: "America/New_York", address: "12 Parley Vale, Jamaica Plain, MA 02130" }}})

var nt = { lat: 14.34500000, lng: -72.44400000, timezone: "America/New_York", address: "12 Parley Vale, Jamaica Plain, MA 02130" }

var nt = { devid: 'YRUDBD0001', domain: 'parley', userarr: [], loc: { lat: 2334555.3344, lng: 12345.2344, timezone: -5, address: '12 Parley Vale, Jamaica Plain, MA 02130' }, users: [], usersarr: []}


back to databases

Mongod defaults the database location to: /data/db/

mongo3

mongoimport 3

 C:\Program Files\MongoDB\Server\3.0\bin>mongoimport --db bus --collection bus_row --file C:\wamp\www\hackathon\hubhacks2\boggedbus\bus.json
C:\Program Files\MongoDB 2.6 Standard\bin>
mongoimport --db bus --collection bus_row --file C:\wamp\www\hackathon\hubhacks2\boggedbus\server\bus.json

mongodump mongorestore

dump

mongodump -db stuffDb
tar czvf dump.tar.gz dump

restore(first drop existing)

mongo 
 >use stuffDb
 >db.dropDatabase()
tar xvf dump.tar.gz
mongorestore dump

replica set

I'd like to configure replica set for development so I can use mongod on my laptop when the internet is not available and use a server hosted mongod when the internet is available.

so far...

  • you need three instances so I've added a third on another host
  • rs.add(host) happens on the primary, my laptop has no known url so it needs to be the primary
  • before I go offline I need to run mongod on the laptop
  • when I have internet, I kill mongod on the laptop causing the serverhosted db to take over as primary (by making the other secondary decline the honor)
  • when the laptop mongod comes back up it takes control and gets the current data.
  • rinse repeat

mongo scypy monay

http://emptysqua.re/blog/mongodb-boston/

mongoskin

tutorial

basic mongo

mongo meteor

sudo ps -x |grep mongo
2251 pts/2    Sl+    0:00 /home/tim/.meteor/tools/09b63f1ed5/mongodb/bin/mongod --bind_ip 127.0.0.1:3002 
--dbpath /var/www/fworks/meteor/stuff2get/.meteor/local/db --oplogSize 8 --replSet meteor 
mongo --port 3002


from https://www.openshift.com/blogs/day-15-meteor-building-a-web-app-from-scratch-in-meteor

where is mongo?

   tim@TIM-HP ~
   $ mongo
   MongoDB shell version: 2.4.8
   connecting to: test
   > show dbs
   angular-directory-db    0.203125GB
   local   0.078125GB
   test    0.203125GB
   > use angular-directory-db
   switched to db angular-directory-db
   > show collections
   employees
   system.indexes
   > db.employees.find().pretty()

installing-mongodb-on-windows-the-wamp-way

on parleyV12

https://www.digitalocean.com/community/articles/how-to-install-mongodb-on-ubuntu-12-04

sudo service mongodb start

The MongoDB instance stores its data files in the /var/lib/mongodb and its log files in /var/log/mongodb/mongodb.log

on ubuntu lucid

stuff2getM

predictive search

http://stackoverflow.com/questions/13010151/input-text-return-event-in-meteor

=items and nitems

  1. add {{> nitiems}} to main and create Template:Nitems template in stuff2get.html
  2. create Tempalete.nitems.items and wire it up to respond to itemsHandle by adding Template.nitems.loading and Templates.nitiems.any_list_selected