This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -v /datadir:/data/db --name mongo -p 27017:27017 -d mongo --auth | |
docker exec -it mongo mongo | |
> use admin | |
> db.system.users.find() | |
> db.createUser({ user: 'admin', pwd: 'admin', roles: [ { role: "root", db: "admin" } ] }); | |
> use some-db | |
> db.createUser({ user: 'user', pwd: 'user', roles: [ "readWrite" ] }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build | |
docker build -t image-name . | |
# Tag & push | |
docker tag image-id account/image-name:latest | |
docker login | |
docker push account/image-name | |
# Launch MongoDB container | |
docker run -v /datadir:/data/db --name mongo-service -d mongo mongod --smallfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Backup and restore to local | |
$ mongodump --host localhost --port 27017 --db db-name -u XXX -p YYY --out db-backup | |
$ zip -r db-backup.zip db-backup | |
$ scp -i keys/key.pem ubuntu@ip:app/db-backup.zip ~/Downloads | |
$ mongorestore --db db-name --drop db-backup/db-name | |
// Dump from mongo cloud | |
$ mongod --dbpath [db-path] --replSet [replset-name] | |
$ mongo | |
> rs.initiate({ _id: "db_name", members: [{ _id: 1, host: "localhost:27017" }] }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo nano /etc/systemd/system/startup.service | |
[Unit] | |
Description=Startup | |
[Service] | |
ExecStart=/usr/local/bin/startup.sh | |
[Install] | |
WantedBy=default.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Cold observable: | |
* produce values upon each subscription | |
*/ | |
const coldObs$ = Rx.Observable.interval(1000) | |
/* | |
* Warm observable: | |
* share the value source to all subscriptions, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . | |
';;,. ::' | |
,:::;,,' :ccc, | |
,::c::,,,,. :cccc, | |
,cccc:;;;;;. cllll, | |
,cccc;.;;;;;, cllll; | |
;cccc; .;;;;;;. coooo; | |
;llll; ,:::::'loooo; | |
;llll: ':::::loooo: | |
:oooo: .::::llodd: |
- Server that streams music from cloud services like Spotify
- Install here
brew tap mopidy/mopidy
brew install mopidy
OlderNewer