db.grantRolesToUser("admin",[{role:"root","db":"admin"}])
|
Reference: http://stackoverflow.com/questions/23943651/mongodb-admin-user-not-authorized
My online tech scrapbook where I keep my notes in case I need to look them up later
db.grantRolesToUser("admin",[{role:"root","db":"admin"}])
|
- name: stat the dest path
stat: path=/path/dest
register: statdest
- name: move file
command: mv /path/src /path/dest
when: statdest.stat.exists == false
|
$ str="one two three"
$ set -- $str
$ echo $1
one
$ echo $2
two
$ echo $3
three
|
- hosts: appservers
vars_files:
- vars.yml
|
var1Name: var1Value
var2Name: var2Value
var3Name: var3Value
|
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmtxxxxxxxxx",
"Effect": "Allow",
"Action": [
"elasticloadbalancing:RegisterInstancesWithLoadBalancer",
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer"
],
"Resource": [
"arn:aws:elasticloadbalancing:aws-region:aws-account-id:loadbalancer/*"
]
}
]
}
|
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmtxxxxxxxx",
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": [
"*"
]
}
]
}
|
aws logs create-log-stream --log-group-name groupName --log-stream-name streamName
|
local_action: command xxxxxxxxx
|
{{ ansible_ec2_instance_id }}
|
db.collectionName.count({"arrayName":{$exists:true},$where:'this.arrayName.length>3'})
|
sudo pip install ansible
|
java -DvarName1=varValue1 -DvarName2=varValue2
|
db.coll.update({},{$set:{"attr":”value”]}},{multi:true})
|
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "xxxxxxxxxxx",
"Effect": "Allow",
"Action": [
"ec2:*"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:Region": "us-west-2"
}
}
}
]
}
|