This file contains 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
$ alias prettyjson='python -m json.tool' | |
$ prettyjson my-json-horrible-file.json |
This file contains 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
*/10 * * * * /bin/execute/this/script.sh >> /var/log/script_output.log 2>&1 | |
# More information on: http://kvz.io/blog/2007/07/29/schedule-tasks-on-linux-using-crontab/ | |
# Crontab generator http://crontab-generator.org/ |
This file contains 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
# general view | |
dpkg --get-selections | grep -v deinstall | |
# detailed view | |
dpkg -l |
This file contains 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
# If using Homebrew | |
brew services start mongodb #start service | |
brew services list #list services to see if it's running | |
brew services stop mongodb #stop service | |
# If starting manually | |
mongod --fork --logpath /usr/local/var/log/mongodb/mongo.log # start service [logpath located in mongod.conf] | |
mongod --shutdown # stop service on linux | |
mongo admin #stop service osx/other | |
db.shutdownServer() |
This file contains 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
lsof -n -i4TCP:[PORT] | grep LISTEN | |
# lsof -n -i4TCP:27017 | grep LISTEN |
This file contains 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
$ mongodump -d some_database -c some_collection | |
$ mongorestore -d some_other_db -c some_or_other_collection dump/some_collection.bson |
This file contains 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
time wget http://www.aip.im -q --output-document=/dev/null | |
# See more at: http://www.aip.im/2012/05/how-to-measure-web-sites-response-time-with-wget/#sthash.EI6QgjGQ.dpuf |
NewerOlder