spb/README.md

1# spb - Simple PasteBin 2 3## What? 4 5This is a simple pastebin made with `node.js` &amp; a `sqlite3` backend. 6 7Note: The old mongodb codebase is in the [mongodb](https://github.com/aktsbot/spb/tree/mongodb) branch. 8 9## Why ? 10 11I needed my own pastebin for "research" ;) 12 13## How ? 14 15- clone the repo 16- take a look at [config.js](./config.js) 17- `$ npm install` 18- Get sqlite database ready 19 ``` 20 $ sqlite3 spb.db < sql/pastes.sql 21 ``` 22- `$ npm start` 23- pop open `http://localhost:3030` on the browser 24 25## Can I see ? 26 27https://spb.aktsbot.in 28 29## Inspiration 30 31- http://sprunge.us/ 32- http://ix.io/ 33 34## Migration from mongodb to sqlite3 35 36The initial version of spb was built to use mongodb for its database. This new version 37will be using sqlite. 38 39If you have a good chunk of pastes that you wish to move over, here's what you do 40 41- hop on the vm and take a mongodb dump like so 42 ``` 43 $ mongoexport -d spb -c pastes --jsonArray -o pastes.json 44 ``` 45 this create a `pastes.json` file which holds all of your old data. 46 47- copy the `pastes.json` file into the `extras` folder and then run 48 ``` 49 $ node extras/mongo_migrate.js 50 ``` 51 You might see a warning like so which you can ignore. 52 ``` 53 (node:10559) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time 54 (Use `node --trace-warnings ...` to show where the warning was created) 55 ``` 56 57 Please make sure you setup the sqlite database before hand 58 ``` 59 $ sqlite3 spb.db < sql/pastes.sql 60 ``` 61 62 63 64## License 65 66[WTFPL](http://www.wtfpl.net/)