Skip to content

Instantly share code, notes, and snippets.

@willgvfranco
Last active June 6, 2021 17:17
Show Gist options
  • Save willgvfranco/56ceb2ed53fd3f630358202b51ec59e8 to your computer and use it in GitHub Desktop.
Save willgvfranco/56ceb2ed53fd3f630358202b51ec59e8 to your computer and use it in GitHub Desktop.
ready configs
.git
.ipynb_checkpoints/*
/notebooks/*
/unused/*
Dockerfile
.DS_Store
.gitignore
README.md
env.*
/devops/*
/node_modules
# To prevent storing dev/temporary container data
*.csv
/tmp/*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
keys.py
neusdoc
.idea
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
static/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
# .env
.venv
env/
venv/
node_modules/
*/node_modules/
ENV/
env.bak/
venv.bak/
*.zip
*.rar
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/

Nome do seu projeto

Um resumo curto sobre o que o seu projeto faz

Um ou dois parágrafos sobre seu projeto e o que ele faz.

Instalação

Mac OS X & Linux:

npm install --save

Windows:

edit autoexec.bat

Exemplo de uso

Alguns exemplos que motivariam as pessoas a utilizarem seu projeto ou que demonstrasse que este é últil para alguma coisa. Divida esta parte em partes menores e se possível coloque algum código ou prints de telas.

Ambiente de Desenvolvimento

Descrever como instalar e preparar qualquer dependência de desenvolvimento para que seu projeto possa ser executado localmente e pessoas possam contribuir com o mesmo. Se possível forneça as informações para diferentes plataformas, exemplo Windows, Linux e Mac OS.

Histórico de Atualizações

  • 0.2.1
    • CHANGE: Atualização dos docs (o código não foi alterado)
  • 0.2.0
    • CHANGE: Removida a função setPadrãoXYZ()
    • ADD: Adicionado a função inicializar()
  • 0.1.1
    • FIX: Crash quando executava escrever() (Obrigado ao @Contribuidor)
  • 0.1.0
    • O primeiro lançamento estável
    • CHANGE: Renomeado de Projeto XYZ para Projeto ABC
  • 0.0.1
    • Projeto inicial

Meta

Seu nome - @SeuTwitter - seuemail@gmail.com

Distribuído sobre a licença. Veja LICENÇA para mais informações.

https://github.com/seuusuaurio/seuprojeto

~/repos/name-production.git

repos/name-production.git/restart-app

#!/bin/bash
source /home/neus/projects/advogados/venv/bin/activate && python /home/neus/projects/advogados/manage.py collectstatic --noinput
sudo systemctl restart advogados.service

cli: chmod +x restart-app

repos/name-production.git/post-receive

 #!/bin/sh
 git --work-tree=/home/neus/projects/advogados --git-dir=/home/neus/repos/production.git checkout -f
 echo "Checking out new files on production and restarting app"
 echo $USER
 sudo /home/neus/repos/production.git/restart-app

visudo

%sudo   ALL=(ALL:ALL) ALL
neus   ALL=(ALL) NOPASSWD:/home/neus/repos/production.git/restart-app

how to use

git remote add production ssh://neus@165.227.72.240/home/neus/repos/tweeze-production.git
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hi there');
});
app.listen(3000)

[Unit] Description=Tweeze Django

Requires=gunicorn.socket

After=network.target

[Service] User=neus Group=www-data WorkingDirectory=/home/neus/projects/tweeze Environment="PATH=/home/neus/projects/tweeze/bin" ExecStart=/home/neus/projects/tweeze/venv/bin/gunicorn
--access-logfile -
--workers 3 \

--bind unix:/run/gunicorn.sock \

  --bind 127.0.0.1:8013 \
      backend.wsgi:application

[Install] WantedBy=multi-user.target

sudo systemctl start $FILENAME

server { listen 80; server_name alpha.neustren.com.br;

    location / {
    include proxy_params;
    proxy_pass http://localhost:19999;
    access_log /var/log/nginx/access_netdata.log;
}

}

server { listen 80; server_name 165.227.72.240; root /var/www/masterclass/; index index.php index.html index.htm;

location / {
    try_files $uri $uri/ /404;
}

location ~\.php$ {
    include fastcgi.conf;
    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}

}

server {
server_name xray.neustren.com.br;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/neus/projects/xray;
}
location / {
include proxy_params;
proxy_pass http://127.0.0.1:8007;
}
}

server { listen 80; server_name globo.neustren.com.br;

location / { root /home/neus/projects/globo index index.html;

}

}

[Unit]
Description=Tweeze scraper v1
After=multi-user.target
Conflicts=getty@tty1.service
[Service]
User=neus
Group=www-data
WorkingDirectory=/home/neus/projects/tweeze
Environment=PATH=/home/neus/projects/tweeze/venv/bin
ExecStart=/home/neus/projects/tweeze/venv/bin/python3 scraper/bridge.py
Restart=on-failure
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment