2015-11-24

MacOS - How to prevent process "gamed" from running

On El Capitan MacOS:
launchctl unload -w /System/Library/LaunchAgents/com.apple.gamed.plist

This undoes it:
launchctl load -w /System/Library/LaunchAgents/com.apple.gamed.plist


Before El Capital versions:
sudo defaults write /System/Library/LaunchAgents/com.apple.gamed Disabled -bool true

To undo/reverse the change:
sudo defaults delete /System/Library/LaunchAgents/com.apple.gamed Disabled


2015-11-15

MongoDB - Filter on a couple of fields (simple and using $and:[])

db.COLLECTION_NAME.find(
    FIELD_NAME_1 : EXACT_VALUE_TO_COMPARE_TO
    , FIELD_NAME_2 : EXACT_VALUE_TO_COMPARE_TO
);


db.COLLECTION_NAME.find(
    $and: [
        { FIELD_NAME_1 : EXACT_VALUE_TO_COMPARE_TO }
        , { FIELD_NAME_2 : EXACT_VALUE_TO_COMPARE_TO }
    ]
);


MongoDB - Filter on a given field, if it exists




db.COLLECTION_NAME.find(
    $or: [
        { FIELD_NAME : { $exists : false}}
        , { FIELD_NAME : EXACT_VALUE_TO_COMPARE_TO }
    ]
);


db.COLLECTION_NAME.find(
    FIELD_NAME : { $ne : EXACT_VALUE_TO_COMPARE_TO }
);



2015-11-09

Ubuntu/Linux - Restore your home folder permissions

sudo chown -R "$USER:$USER" "$HOME"


This helps when, for example, Firefox won't start on Ubuntu 15.10... it seems to be due to permissions issues. It worked for me afterwards.