Using south
- setup the model
python manage.py schemamigration models --initial
- dump data if you have to
python manage.py dumpdata -e contenttypes -e auth.Permission --natural > data.json
- syncdb
| sudo nano /etc/apt/sources.list | |
| deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo aptitude install postgresql-9.6 | |
| pg_lsclusters | |
| sudo pg_dropcluster 9.6 main --stop | |
| pg_lsclusters | |
| sudo service postgresql status | |
| sudo service postgresql stop |
| npm install -g gltf-pipeline | |
| https://github.com/AnalyticalGraphicsInc/gltf-pipeline | |
| # re-pack the model into a GLB, adding Draco compression | |
| gltf-pipeline -i orginal.gltf -o optimized.glb --binary --draco | |
| gltf-pipeline -i optimized.glb -o tmp/tmp.gltf --separate --json | |
| # optimize the textures in tmp/ |
| { | |
| "bootstrapped": true, | |
| "in_process_packages": | |
| [ | |
| ], | |
| "installed_packages": | |
| [ | |
| "All Autocomplete", | |
| "Anaconda", | |
| "ApplySyntax", |
| pip install twine | |
| python setup.py sdist | |
| twine upload dist/PACKAGE-1.1.0.tar.gz -u realsby -p Bassword |
Using south
python manage.py schemamigration models --initial
python manage.py dumpdata -e contenttypes -e auth.Permission --natural > data.json
| Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" | |
| Header set Content-Security-Policy "script-src * 'unsafe-inline' 'unsafe-eval'; style-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; connect-src * 'unsafe-inline'; frame-src 'self' *.domain.com;" | |
| Header always set X-Frame-Options "sameorigin" | |
| Header set X-XSS-Protection "1" | |
| Header set Referrer-Policy "no-referrer-when-downgrade" | |
| Header set Feature-Policy "microphone none;camera none;" | |
| Header set X-Content-Type-Options "nosniff" | |
| add_header Strict-Transport-Security max-age=63072000; | |
| add_header Content-Security-Policy "script-src * 'unsafe-inline' 'unsafe-eval'; style-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; connect-src * 'unsafe-inline'; frame-src 'self' *.domain.com;"; |
| Docker shellden cikmak icin: ctrl + D | |
| docker network create --driver bridge docker-network1 | |
| container icindeki postgresql portu 5432, container disinda gercek bilgisayarda 4321 den oraya erisimi aciyoruz. | |
| docker run --name postgres1 --network docker-network1 -v /tmp/pgdata:/var/lib/postgresql/data -p 4321:5432 -e POSTGRES_PASSWORD=PPPPASSWORDDDDD -d postgres:9.6.9 | |
| docker run -it --rm --network docker-network1 postgres:9.6.9 psql -h postgres1 -U postgres | |
| docker run -it --rm --network docker-network1 postgres:9.6.9 /bin/bash | |
| silmek icin: | |
| docker stop postgres1 && docker rm postgres1 |
| Aşağıdaki kod text.file içinde belirli bir metini arar ve kaçıncı satırlarda yer aldığını basar. | |
| grep -n Text_Metin text.file | |
| Aşağıdaki kod text.file daki 6453 üncü satır ve öncesindeki 3 satırı (toplamda 4 satırı) basar. | |
| head -n 6453 text.file | tail -n 4 | |
| Binrotada şunlara baktım: | |
| grep -n MAL_ /var/log/uwsgi/binrota_pro.log |
| wget --adjust-extension --span-hosts --convert-links --backup-converted --page-requisites --no-parent https://tr.sputniknews.com | |
| wget --span-hosts --backup-converted --page-requisites --no-parent --content-disposition https://tr.sputniknews.com | |
| file qs.sh | |
| ------- | |
| # /bin/bash | |
| for i in `find $1 -type f` | |
| do | |
| mv $i `echo $i | cut -d? -f1` | |
| done |
| Regex: | |
| (?:url\(|<(?:link|script|img)[^>]+(?:src|href)\s*=\s*)(?!['"]?(?:data|http))['"]?([^'"\)\s>]+) | |
| Use: | |
| https://regexr.com/ | |
| Paste your text and click List button. |