$ 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
``` | |
I was getting this error too. I tried many suggestions, dint work. This one worked.. | |
check which python & its ssl version | |
python -c "import ssl; print(ssl.OPENSSL_VERSION)" | |
OpenSSL 1.0.2f 28 Jan 2016 | |
python3 -c "import ssl; print (ssl.OPENSSL_VERSION)" | |
OpenSSL 0.9.8zh 14 Jan 2016 |
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 postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |
From: https://stackoverflow.com/questions/24685508/how-to-find-unused-amazon-ec2-security-groups | |
Note: this only considers security use in EC2, not other services like RDS. You'll need to do more work to include security groups used outside EC2. The good thing is you can't easily (might not even be possible) to delete active security groups if you miss one associated w/another service. | |
Using the newer AWS CLI tool, I found an easy way to get what I need: | |
First, get a list of all security groups | |
aws ec2 describe-security-groups --query 'SecurityGroups[*].GroupId' --output text | tr '\t' '\n' | |
Then get all security groups tied to an instance, then piped to sort then uniq: |
$ 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# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
#!/bin/bash | |
# get all running docker container names | |
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}') | |
host=$(hostname) | |
# loop through all containers | |
for container in $containers | |
do | |
echo "Container: $container" |