Skip to content

Instantly share code, notes, and snippets.

main.py:46: in __init__
self.self0 = ""
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E AttributeError: __fields_set__
from fastapi import FastAPI
from datetime import date
from pydantic import BaseModel
from typing import List, Sequence, TypeVar, Generic
from fastapi_pagination import Page as BasePage, add_pagination, paginate
from fastapi import Query
from fastapi_pagination.bases import AbstractPage, AbstractParams, RawParams
from fastapi_pagination import Params as BaseParams
from fastapi import FastAPI
from pydantic import BaseModel
from fastapi_pagination import Page, add_pagination, paginate
app = FastAPI()
class User(BaseModel):
name: str
def square_nums(nums)
yield(map(lambda x: x ** x, nums))
[jenia@jenia ~]$ sudo nfs-ls nfs://192.168.1.0/srv/nfs
Failed to mount nfs share : nfs_mount_async failed. Failed to start connection. Failed to start connection. connect() to server failed. Network is unreachable(101)
[jenia@jenia ~]$
[jenia@jenia ~]$
[jenia@jenia ~]$
[jenia@jenia ~]$ sudo exportfs -arv
point 1
point 2
point 3
@jenia
jenia / gist:1fa532083e554284650cf5a62d0a2e96
Created November 12, 2020 15:42
File structure python
~/example/program.py
~/example/tests/uni-tests.py
~/example/program.py
=====================
#!/usr/bin/python3
class A():
def f(self):
print("hello")
@jenia
jenia / example-pointer.py
Created August 5, 2020 01:48
I want to pass the flag's pointer
#!/usr/bin/python3
def f(flag):
flag = False
def g(flag):
print(flag)
def main():
flag = True
# echo-client.py
import sys
import trio
import time
# arbitrary, but:
# - must be in between 1024 and 65535
# - can't be in use by some other program on your computer
# - must match what we set in our echo server
PORT = 12345
@jenia
jenia / echo server
Last active August 1, 2020 16:27
How to send requests for 60 seconds and wait for all responses
#echo-server.py
import trio
from itertools import count
# Port is arbitrary, but:
# - must be in between 1024 and 65535
# - can't be in use by some other program on your computer
# - must match what we set in our echo client
PORT = 12345
- name: Create db container and connect to network
docker_container:
name: "{{ app_name }}"
image: "{{ app_image}}"
networks:
- name: "{{ docker_network_name }}"
when: app_name == "certain_app" or app_name == "certain_other_app"