Scala
Convert Seq To Map
val map = seq.map(a => a.key -> a).toMap
val map = seq.map(a => a.key -> a).toMap
Redis Commands:
sudo yum install -y epel-release
sudo yum install R
alias enc='openssl enc -e -aes128 -base64 -pass "env:PASS"'
alias dec='openssl enc -d -aes128 -base64 -pass "env:PASS"'
between() { sed -n "/^$1/,/^$2/p" | sed '1d;$d'; }
Also:
awk '/^START=A$/,/^END$/ { print }’ data
jq is useful to slice, filter, map and transform structured json data.
brew install jq
#AWS | |
# . install-aws.sh | |
instance_profile=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/` | |
aws_access_key_id=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g'` | |
aws_secret_access_key=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'` | |
aws_secret_access_key=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'` | |
aws_session_token=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep Token | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'` |
#!/bin/bash | |
sudo yum install -y epel-release | |
sudo yum install -y nano | |
sudo yum install -y git | |
#Install Amazon Client | |
curl -O http://peak.telecommunity.com/dist/ez_setup.py | |
sudo python ez_setup.py | |
#Install pip | |
sudo easy_install pip |
This document describes how to use curl with both custom and official CA SSL certificates.
You would need first to install curl , see http://curl.haxx.se/docs/install.html. Using a package manager such as yum, brew, ... for your platform should be the easiest though.
Example for Mac OS: