I hereby claim:
- I am pharzan on github.
- I am pharzan (https://keybase.io/pharzan) on keybase.
- I have a public key ASD7kHx7hIepix8J9Oyrh6QAK0VIXiksugOW_TuQgdIv2wo
To claim this, I am signing this object:
| # create a bakup: | |
| sudo su - postgres | |
| pg_dump postgres > postgres_db.bak | |
| # options: | |
| pg_dump -U user_name -h remote_host -p remote_port name_of_database > name_of_backup_file |
| After installing postgreSQL and rebooting Mint when recieved I would recieve the following error saying can't start postgres | |
| while trying to run Django | |
| could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain | |
| socket “/var/run/postgresql/.s.PGSQL.5432”? | |
| sudo mkdir /var/log/postgresql | |
| sudo chown postgres.postgres /var/log/postgresql | |
| sudo su postgres | |
| touch /var/log/postgresql/postgresql-9.1-main.log |
| So how can I question a variable that is a NoneType? | |
| Use is operator, like this | |
| '' | |
| if variable is None: | |
| '' | |
| Why this works? | |
| Since None is the sole singleton object of NoneType in Python, we can use is operator to check if a variable has None in it or not. | |
| Quoting from is docs, |
| So how can I question a variable that is a NoneType? | |
| Use is operator, like this | |
| '' | |
| if variable is None: | |
| '' | |
| Why this works? | |
| Since None is the sole singleton object of NoneType in Python, we can use is operator to check if a variable has None in it or not. | |
| Quoting from is docs, |
| So how can I question a variable that is a NoneType? | |
| Use is operator, like this | |
| '' | |
| if variable is None: | |
| '' | |
| Why this works? | |
| Since None is the sole singleton object of NoneType in Python, we can use is operator to check if a variable has None in it or not. | |
| Quoting from is docs, |
| # inside the script we should have something like below: | |
| def run(*script_args): | |
| print (script_args) | |
| # from the shell when calling the script to run use the --script-args to pass in arguments and they will be recieved as tuples inside the script | |
| #-> example: python manage.py runscript myscript --script-args Testing 123 | |
| will return ('Testing','123') | |
| # inside the script we should have something like below: | |
| def run(*script_args): | |
| print (script_args) | |
| # from the shell when calling the script to run use the --script-args to pass in arguments and they will be recieved as tuples inside the script | |
| #-> example: python manage.py runscript myscript --script-args Testing 123 | |
| will return ('Testing','123') | |
I hereby claim:
To claim this, I am signing this object:
| #listens to the above run to | |
| #FLASK_APP=server.py FLASK_DEBUG=1 python3.5 -m flask run -h 192.168.1.124 -p 8999: | |
| #run this on the local server to listen to socket communication | |
| from flask import Flask, render_template, jsonify | |
| from flask import request as query | |
| app = Flask(__name__) |
| #to format: | |
| from flashbdev import bdev | |
| uos.VfsFat.mkfs(bdev) | |
| vfs = uos.VfsFat(bdev, "") | |
| # to create a boot.py file: | |
| with open("/boot.py", "w") as f: | |
| f.write("""\ | |
| # This file is executed on every boot (including wake-boot from deepsleep) | |
| import esp |