I hereby claim:
- I am kmfk on github.
- I am kmfk (https://keybase.io/kmfk) on keybase.
- I have a public key ASDOJCqgmXcAhSSjZjuePEXoj5qdbCkr28d0MtNwmP35TQo
To claim this, I am signing this object:
#!/usr/bin/env php | |
<?php | |
echo str_pad( dechex( strtotime( $argv[1] ) ), 8, "0", STR_PAD_LEFT ) . "0000000000000000\n"; |
<?php | |
echo "<pre>"; | |
echo " ######### Both instances connect to the same set of servers: \n\n"; | |
$mc1 = new MongoClient('mongodb://rs1.example.com,rs2.example.com,rs3.example.com', [ 'replicaSet' => 'my_set' ] ); | |
$mc2 = new MongoClient('mongodb://rep1.example.com,rep2.example.com,rep3.example.com', [ 'replicaSet' => 'my_set' ] ); | |
echo " ######### MongoClient - ReplicaSet 1: \n"; | |
print_r( $mc1->listDBs() ); // Shows the correct Dbs |
/* | |
SERVER: MongoDB 2.4.3 | |
NS: test.session | |
*/ | |
/* AFTER INSERTING 20k DOCUMENTS */ | |
db.session.stats(1024) | |
{ | |
"ns": "test.session", | |
"count": 20130, |
I hereby claim:
To claim this, I am signing this object:
## The commands for working with terraform workspaces can be a little verbose, this just makes it easier to interact | |
## with the workspaces commands. It relies on `getops`, @see: https://wiki.bash-hackers.org/howto/getopts_tutorial | |
## | |
## This function can be added to your .bashrc or .zshrc. | |
tfw() { | |
# when no workspace is given, it's expected we're listing | |
if [ -z "$1" ]; then | |
terraform workspace list | |
return $? |
# This function can be added to your bash or zsh rc file - then you setup aliases for | |
# commonly used tools which rely on AWS session tokens to be refreshed through saml2aws. | |
s2a_auth() { | |
yellow=`tput setaf 3` | |
reset=`tput sgr0` | |
now_minus_5=$(date -v "-5M" +"%Y-%m-%dT%T%z") | |
exp_date=$(awk -F "=" '/x_security_token_expires/ {print $2}' ~/.aws/credentials | tr -d ' ') | |
# If a date is not found or there is less than 5 minutes before expiration, re-auth. |