Create a file wsgi.py and write your bootstrap script like this:
from app import applicationn
if __name__ == "__main__":
application.run()Ref: https://stackoverflow.com/a/44789323
create a new branch
git checkout -b new_clean_branch
apply all changes
| 1. Extract all (PHP) requests from apache access.log: | |
| grep -Eo '"POST /[a-zA-Z0-9_ ]+/[a-zA-Z0-9_]+.php HTTP/1.1"' access.log | |
| 2. find all urls in a folder across all files: | |
| grep -rnEo "(http|https)://[a-zA-Z0-9./?=_-]*" folder/ | |
| 3. SED delete range of lines in a huge text files: | |
| sed -i '21,141d' file |
Toggle hidden files I
Create new file at given directory cursor: ma
| #log_format custom '$request_body'; | |
| log_format custom '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $bytes_sent ' | |
| '"$http_referer" "$http_user_agent" "$request_body"'; | |
| log_format json_combined escape=json | |
| '{' | |
| '"time_local":"$time_local",' | |
| '"remote_addr":"$remote_addr",' | |
| '"remote_user":"$remote_user",' |
| #!/bin/sh | |
| ##Useage: ./getes.sh | |
| ## To dry run query: ./getes.sh -v -x POST -d '{a:b}' http://elasticurl | |
| ## To actually run query: ./getes.sh -x POST -d '{a:b}' http://elasticurl | |
| ## Default action is search, so you can omitt -x GET switch | |
| METHOD="GET" | |
| DATA="{}" | |
| DRYRUN=0 |
| #!/bin/bash | |
| ## Below script allows to fetch private github/gitlab repo | |
| ## Assume, $PRIVATE_SSH = | |
| ## -----BEGIN OPENSSH PRIVATE KEY----- | |
| ## b3BlbnNzaC1rZXktdjEAAAAABG5..... | |
| cat > /root/.ssh/id_rsa <<EOF | |
| -----BEGIN OPENSSH PRIVATE KEY----- | |
| b3BlbnNzaC1rZXktdjEAAAAABG5..... |
| FROM python:3 | |
| EXPOSE 8000 | |
| CMD ["python", "-m", "http.server"] |
| # | |
| # iptables configuration | |
| # | |
| # The following allows in- and outbound traffic | |
| # within a certain `CIDR` (default: `192.168.0.0/24`), | |
| # but blocks all other network traffic. | |
| # | |
| ALLOWED_CIDR1=172.0.0.0/16 | |
| ALLOWED_CIDR2=13.233.249.192 |
| version: '3' | |
| services: | |
| consul-agent-1: &consul-agent | |
| image: consul:latest | |
| networks: | |
| - consul-demo | |
| command: "agent -retry-join consul-server-bootstrap -client 0.0.0.0" |