- Open the sudo file:
sudo vim /etc/pam.d/sudo
- Add the line above in the first line of the sudo file
auth sufficient pam_tid.so
const { to } = require("await-to-js"); | |
const { Amplify } = require("aws-sdk"); | |
const amplify = new Amplify(); | |
const config = { | |
AMPLIFY_FRONTEND_APP_ID: "your_app_id", | |
AMPLIFY_FRONTEND_DOMAIN: "your_domain.com", | |
AMPLIFY_FRONTEND_BRANCH: "your_branch_env" | |
}; |
sudo vim /etc/pam.d/sudo
auth sufficient pam_tid.so
// npm install await-to-js | |
const { to } = require("await-to-js"); | |
const { CognitoIdentity } = require("aws-sdk"); | |
const identity = new CognitoIdentity(); | |
const IDENTITY_POOL_ID = "<your identity pool id>"; | |
exports.handler = async (event) => { | |
const { issuer } = event.identity; |
env: environment name
region: aws region
codestarConnection: codestar connection arn https://docs.aws.amazon.com/cli/latest/reference/codestar-connections/create-connection.html
branch: bitbucket branch to continuous deployment
repo: bitbucket repo with pattern username/repository_name
grep -E 'resource.+"codefresh_project"' ./squads/**/*.tf | sed -E 's/([a-z_\/]+):.+" "(.+)" {/\1:\2/g' | | |
while IFS=":"; read -r key value; do | |
export key=$key value=$value | |
cat $key | grep name | sed -E 's/.+name.+\"(.+)\"/\1/g' | | |
xargs -I{} grep -E 'project_name.+"{}"' ./squads/**/*.tf | sed -E 's/([a-z\/_-]+):.+/\1/g' > tmp.txt | |
while read file; do | |
if [ -z "$(grep depends_on $file)" ]; then | |
replace="\ndepends_on = [codefresh_project.${value}]\n}" | |
perl -i"" -pe "s/^}/${replace}/g" $file | |
terraform fmt $file |
locals { | |
subfolders = toset(distinct(flatten([for _, v in fileset(".", "./dir/**") : regex("./dir/([^/]*).*", dirname(v))]))) | |
} |
# you may use nginx with real ip module | |
server { | |
# your host or vpc cidr_block or the docker gateway address ip | |
set_real_ip_from 10.0.0.0/24; | |
real_ip_header X-Forwarded-For; | |
location ~ \.php$ { | |
# you should pass the header X-Forwarded-For with the real ip from frontend, the AWS ELB/ALB pass by default | |
fastcgi_param REMOTE_ADDR $http_x_forwarded_for; |
# Configuration | |
git config user.name "My Name" | |
git config user.email "myemail@domain.com" | |
# Initialize a git repository | |
git init | |
# Add all files to be commited | |
git add . |
# step 1 | |
# execute the command to get the certificates | |
openssl s_client -showcerts -connect start.spring.io:443 | |
# copy the lines stating in: Certificate chain (including this line) | |
# Ending in last -----END CERTIFICATE----- | |
# step 2 | |
# create the cert file with this content | |
mkdir $HOME/certs |
@Component | |
public class Beans { | |
@Bean @RequestScope(proxyMode = ScopedProxyMode.TARGET_CLASS) | |
public WebDriver webDriver() { | |
ChromeOptions options = new ChromeOptions() | |
.addArguments("--no-sandbox") | |
.setHeadless(true); | |
ChromeDriver driver = new ChromeDriver(options); |