$ curl -s -H "X-Something: yeah" localhost:8000 > /dev/null
$ python serv.py
ERROR:root:User-Agent: curl/7.37.1
Host: localhost:8000
Accept: */*
X-Something: yeah
| # -*- coding: utf-8 -*-\ | |
| """ | |
| The MIT License (MIT) | |
| Copyright (c) 2015 Zalando SE | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights |
| # Lambda function to create partition for Cloudtrail log on daily basis. | |
| # You need to schedule it in AWS Lambda. | |
| ''' | |
| ------------------------------------------- | |
| AWS Athena Create Partitions Automatically | |
| ------------------------------------------- | |
| Version 1.0 | |
| Author: SqlAdmin |
| image: docker:latest | |
| # When using dind, it's wise to use the overlayfs driver for | |
| # improved performance. | |
| variables: | |
| DOCKER_DRIVER: overlay | |
| GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID | |
| IMAGE_NAME: image_id | |
| services: |
| goaccess -f haproxy.log --log-format='%^ %^ %^:%^:%^ %^ %^[%^]: %h:%^ [%d:%t.%^] %^ %^ %^/%^/%^/%^/%L %s %b %^ %^ %^ %^/%^/%^/%^/%^ %^/%^ "%r"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' -q |
| #!/usr/bin/env python | |
| import boto3 | |
| import argparse | |
| def lookup_by_id(sgid): | |
| sg = ec2.get_all_security_groups(group_ids=sgid) | |
| return sg[0].name | |
| After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
| The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
| Database files have to be updated before starting the server, here are the steps that had to be followed: | |
| # need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
| brew unlink postgresql | |
| brew install [email protected] | |
| brew unlink [email protected] | |
| brew link postgresql |
$ curl -s -H "X-Something: yeah" localhost:8000 > /dev/null
$ python serv.py
ERROR:root:User-Agent: curl/7.37.1
Host: localhost:8000
Accept: */*
X-Something: yeah
Follow the applicable install instructions for the downloads.
| sudo apt-get install tor | |
| # check tor service running on port 9050 (ss -aln | grep 9050) | |
| # change ip after every 10 sec | |
| edit vi /etc/tor/torrc and add MaxCircuitDirtiness 10 | |
| # use tor proxy in python request | |
| install requests==2.10.0 (pip install requests==2.10.0) (currently 2.11 giving error) |
This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.
buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repositoryconfigure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in a s3-deployment-custom-resource sub-folder of the repoapp-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu