
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wpf kolos 3 20.01.2020 jmolinski | |
BENCHMARK = False | |
def add_if_valid(n, m, t, q, d, x, y, c, v): | |
if x < 0 or y < 0 or y >= m or x >= n: | |
return | |
if t[x][y] == False: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=uWSGI instance to serve NAME backend | |
After=network.target | |
[Service] | |
User=NAME | |
Group=NAME | |
WorkingDirectory=/home/NAME/REPO-NAME | |
Environment=PATH=/home/NAME/NAME-env/bin | |
ExecStart=/home/NAME/NAME-env/bin/uwsgi --ini /home/NAME/NAME.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name IP; | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location /media/ { | |
root /home/NAME/REPO-NAME/media; | |
} | |
location / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
master=True | |
processes=1 | |
socket=/home/NAME/socks/NAME.sock | |
wsgi-file=/home/NAME/REPO-NAME/wsgi/wsgi.py | |
chmod-socket=777 | |
vacuum=true | |
wsgi-disable-file-wrapper = true | |
die-on-term=True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. apt-get update | |
2. apt-get install python-pip python-dev libpq-dev postgresql postgresql-contrib | |
3. sudo su - postgres | |
4. psql | |
5. | |
``` | |
CREATE DATABASE myproject; | |
CREATE USER myprojectuser WITH PASSWORD 'password'; | |
ALTER ROLE myprojectuser SET client_encoding TO 'utf8'; | |
ALTER ROLE myprojectuser SET default_transaction_isolation TO 'read committed'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. dodanie sie do authorized hosts cat ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" | |
2. dodanie usera na serwerze - adduser NAME | |
4. apt-get update | |
3. apt-get install nginx | |
4. create nginx config at /etc/nginx/sites-available/NAME - vim /etc/nginx/sites-available/NAME | |
5. remove default - rm /etc/nginx/sites-enabled/default && rm /etc/nginx/sites-available/default | |
6. create link to sites-enabled - ln -s /etc/nginx/sites-available/NAME /etc/nginx/sites-enabled/NAME | |
7. create NAME.ini in /home/NAME/ | |
8. create /home/NAME/logs/uwsgi/ directory | |
9. create /home/NAME/socks dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys;print('#include<stdio.h>\nmain(){char a[30000],*p=&a;%s;}'%';'.join([{'>':'++p','<':'--p','+':'++*p','-':'--*p','.':'putchar(*p)',',':'*p=getchar()','[':'while(*p){',']':'}'}.get(x,'') for x in sys.stdin.read()])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys;print('#include<stdio.h>\nmain(){char a[30000],*p=&a;%s}'%''.join([{'>':'++p;','<':'--p;','+':'++*p;','-':'--*p;','.':'putchar(*p);',',':'*p=getchar();','[':'while(*p){',']':'}'}.get(x,'') for x in sys.stdin.read()])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys;print('#include<stdio.h>\nmain(){char a[30000]={0};char* p=&a;%s}'%''.join([{'>':'++p;','<':'--p;','+':'++*p;','-':'--*p;','.':'putchar(*p);',',':'*p=getchar();','[':'while(*p){',']':'}'}.get(x,'') for x in sys.stdin.read()])) |
NewerOlder