Skip to content

Instantly share code, notes, and snippets.

Francesca Krihely FrancescaK

Block or report user

Report or block FrancescaK

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View traveling_santa.txt
{"_id":"Beijing","population":1.952e+07,"location":{"type":"Point","coordinates":[116.383333,39.916667]}}
{"_id":"Delhi","population":2.4953e+07,"location":{"type":"Point","coordinates":[77.23,28.61]}}
{"_id":"Guangzhou","population":2.0597e+07,"location":{"type":"Point","coordinates":[113.266667,23.133333]}}
{"_id":"Mexico City","population":2.0843e+07,"location":{"type":"Point","coordinates":[-99.133333,19.433333]}}
{"_id":"Mumbai","population":2.0741e+07,"location":{"type":"Point","coordinates":[72.825833,18.975]}}
{"_id":"New York","population":1.8591e+07,"location":{"type":"Point","coordinates":[-74.0059,40.7127]}}
{"_id":"North Pole","population":1.0,"location":{"type":"Point","coordinates":[0.0,90.0]}}
{"_id":"Osaka","population":2.0123e+07,"location":{"type":"Point","coordinates":[135.502222,-34.693889]}}
{"_id":"Shanghai","population":2.2991e+07,"location":{"type":"Point","coordinates":[121.5,31.2]}}
{"_id":"São Paulo","population":2.0831e+07,"location":{"type":"Point","coordinates":[-46.633333,-23.5
View gist:0e5b848a09968cfc6b36
$ rpm -ihv centrifydc-5.2.0-rhel3-x86_64.rpm
$ adjoin -V -w -u ldap_admin mongotest.com
ldap_admin@MONGOTEST.COM's password:
View gist:3421358de868fb0518ce
$ kinit alex@MONGOTEST.COM
Password for alex@MONGOTEST.COM:
$ mongo --host lin-client.mongotest.com
> db.getSiblingDB("$external").auth(
{
mechanism: "GSSAPI",
user: "alex@MONGOTEST.COM",
}
)
1
View gist:c2c7b35c6b77a81283cd
$ nano /etc/mongod.conf
# Listen to local interface only. Comment out to listen on all interfaces.
#bind_ip=127.0.0.1
auth=true
setParameter=authenticationMechanisms=GSSAPI
$ service mongod stop
$ env KRB5_KTNAME=/home/ec2-user/mongod_lin.keytab mongod -f /etc/mongod.conf
View gist:f12b60e5519ed1d8e895
$ adkeytab -n -P mongodb/lin-client.mongotest.com@MONGOTEST.COM -U mongodb/lin-client.mongotest.com@MONGOTEST.COM -K /home/ec2-user/mongod_lin.keytab -c "OU=support" -V --user ldap_admin lin-client-svc
ldap_admin@MONGOTEST.COM's password:
$ adquery user lin-client-svc -PS
userPrincipalName:mongodb/lin-client.mongotest.com@MONGOTEST.COM
servicePrincipalName:mongodb/lin-client.mongotest.com
View gist:f45ed8f15bd336ed6d18
$ mongo
> db.getSiblingDB("$external").auth(
{
mechanism: "PLAIN",
user: "alex",
pwd: "xxx",
digestPassword: false
}
)
1
View gist:d37a7a5a7e16b88c312d
$ nano /etc/mongod.conf
auth=true
setParameter=saslauthdPath=/var/run/saslauthd/mux
setParameter=authenticationMechanisms=PLAIN
$ service mongod restart
View gist:38612eb9e1c407c8c858
$ cp -v /etc/pam.d/{sshd,mongodb}
`/etc/pam.d/sshd' -> `/etc/pam.d/mongodb'
View gist:ff947d353f839746ce13
$ service saslauthd start
Starting saslauthd: [ OK ]
$ chkconfig saslauthd on
$ chkconfig --list saslauthd
saslauthd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
View gist:827943acd08ed8f02ec8
$ grep ^MECH /etc/sysconfig/saslauthd
MECH=pam
You can’t perform that action at this time.