Skip to content

Articles

  • Linux: Add and list aliases

    Print all existing aliases alias Add a new alias alias list=’ls -la’ In the above example, an alias list has been added which actually runs the command ls -la

  • MongoDB: Copy a collection from one database to another

    It’s quite simple db..find().forEach(function(d){ db.getSiblingDB(”)[”].insert(d); }); You can do a mongodump of a collection from one database and then mongorestore the collection to the other database. I used robomongo and it a documents view, just used this query with the right names for collections and databases, I was able to copy around 3000 records in… Read More »MongoDB: Copy a collection from one database to another

  • Git: Amend the last commit

    So you just committed some code only to realize you had a few files missing from your commit, which you forgot to add. This happens a lot in everyday coding and git has an easy fix for that. If you are like me, you have done something like resetting the head to the commit before… Read More »Git: Amend the last commit