I hereby claim:
- I am dtailor on github.
- I am dtailor (https://keybase.io/dtailor) on keybase.
- I have a public key ASBiHLMc6dEiRpClfT9utqBxnAv5eBM_HaogyBvjorC5vQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # List all databases | |
| sudo -u postgres psql --list | |
| # Create backup file | |
| sudo -u postgres pg_dump [database_name] > dumpl.sql | |
| # Drop the database | |
| sudo -u prostgres dropdb [database_name] | |
| # Create a new database |
| import datetime | |
| from django.utils.timezone.utcnow().replace(tzinfo=utc) | |
| now = datetime.datetime.utcnow().replace(tzinfo=utc) | |
| midnight = now.replace(hour=0,minute=0,second=0,microsecond=0) | |
| queries = YourModel.objects.filter(time__gte = midnight ) |
| import socket | |
| from struct import * | |
| s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP) | |
| while True: | |
| pack = s.recvfrom(20000) | |
| #Get the single element from the tuple |