I hereby claim:
- I am davetownsend on github.
- I am davetownsend (https://keybase.io/davetownsend) on keybase.
- I have a public key whose fingerprint is 9151 93CF B605 3101 DA87 F75D CCD3 E43A 7A70 A986
To claim this, I am signing this object:
pre_build: | |
commands: | |
- yum install epel-release -y | |
- yum install jq -y | |
- param_name=/myapp/$STAGE/deploy_role | |
- DEPLOY_ROLE=$(aws ssm get-parameter --name $param_name | jq ".Parameter.Value" | tr -d \") |
functions: | |
auth: | |
handler: exampleAuth.verify | |
iamRoleStatements: | |
- Effect: Allow | |
Action: ssm:GetParameters* | |
Resource: arn:aws:ssm:#{AWS::Region}:#{AWS::AccountId}:parameter/${self:provider.apiname}/${self:provider.stage}/okta/* | |
- Effect: 'Allow' | |
Action: 'kms:Decrypt' | |
Resource: arn:aws:kms:#{AWS::Region}:#{AWS::AccountId}:key/${ssm:/example/${self:provider.stage}/kms/keyid~true} |
module.exports.verify = middy(verify).use( | |
ssm({ | |
cache: true, | |
cacheExpiryInMillis: 5 * 60 * 1000, | |
setToContext: true, | |
names: { | |
ISSUER: `/example/${stage}/okta/issuer`, | |
CLIENT_ID: `/example/${stage}/okta/clientid`, | |
AUDIENCE: `/example/${stage}/okta/audience` | |
} |
exampleData: | |
handler: example.getExample | |
events: | |
- http: | |
path: /${self:provider.apiname}/read | |
method: get | |
authorizer: | |
name: auth | |
identitySource: method.request.header.Authorization | |
identityValidationExpression: ^Bearer [-0-9a-zA-z\.]*$ |
functions: | |
auth: | |
handler: exampleAuth.verify |
I hereby claim:
To claim this, I am signing this object:
# run from cli to re-load new enries in lanuchd.conf | |
grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl |
// needed to rename over 900 files in a dir from a pattern like | |
// noa_6989589000_201404080445010001.pdf to NAR6989589000.pdf where the 6989589000 part | |
// (different on every file) is the needed in the new file. | |
// simply run from the CLI: groovy rename.groovy | |
dir = "/path to files" | |
def pre = "NAR", ext = ".pdf" | |
new File(dir).eachFile() { f -> | |
def name = f.name.split('_')[1] | |
f.renameTo("${pre}${name}${ext}") |
package org.dt.cachetest; | |
import net.sf.ehcache.config.CacheConfiguration; | |
import org.springframework.cache.annotation.CachingConfigurer; | |
import org.springframework.cache.annotation.EnableCaching; | |
import org.springframework.cache.ehcache.EhCacheCacheManager; | |
import org.springframework.cache.interceptor.KeyGenerator; | |
import org.springframework.cache.interceptor.SimpleKeyGenerator; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.ComponentScan; |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.zshrc | |
. ~/.zshrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl -L https://www.npmjs.com/install.sh | sh |