Skip to content

Instantly share code, notes, and snippets.

@raineorshine
Last active December 11, 2015 18:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raineorshine/4643454 to your computer and use it in GitHub Desktop.
Save raineorshine/4643454 to your computer and use it in GitHub Desktop.
Common Linux commands that I use when developing web applications.
# stylus compile & watch
stylus public/style/main.styl -w &
npm outdated # nicest way to list installed modules
npm ls # list installed modules & dependencies
npm ls -g # list globally installed node modules
npm update # check for updated versions of modules in the current package
npm view {pkg} # view a package's published metadata
npm install {pkg} --save # install the latest version of a package and add it to your package.json's dependencies
npm install {pkg} --save-dev # install and save as a devDependency
sudo npm install {pkg} -g
npm version [major|minor|patch|build] # bump the version number
npm publish
# start app
node app.js
# start app with supervisor (ignoring files in /public)
supervisor -i public app.js
# mongo
mongod & # start server
mongo booksimple # interactive shell on the booksimple database
db.users.remove() # if you need to remove the users
db.dropDatabase() # remove the current database
smog # handy web console
# curl
curl https://raw.github.com/RaineOrShine/rjs/master/rjs.js > rjs.js
# heroku
heroku login # login to heroku
heroku create # create a new app (requirements: git repo, package.json, Procfile)
heroku create -r production # create a new app with a remote named 'production'
git push heroku master # push to the remote named heroku
heroku open # open the app in a web browser
foreman start # test app locally
heroku addons:add zerigo_dns:basic
heroku domains:add mydomain.com
heroku domains:remove mydomain.com
# a.ns.zerigo.net
# b.ns.zerigo.net
# c.ns.zerigo.net
# d.ns.zerigo.net
# e.ns.zerigo.net
heroku ps:scale web=1 # scale the web process
heroku ps # list running processes
heroku config
heroku config:pull --overwrite --interactive
heroku logs
heroku run node # run one-off commands
coffee -cw ./
coffee -o scripts/out/ -cw scripts/src/ &
bower install
bower install jquery --save
bower list
foreman start # launch Procfile-based apps locally
yo webapp # scaffold an entire web app using yeoman
grunt # run the default tasks
grunt build # run a specific task
grunt clean:js # pass arguments to a task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment