Skip to content

Latest commit

 

History

History
70 lines (56 loc) · 1.96 KB

File metadata and controls

70 lines (56 loc) · 1.96 KB

0502

  1. Flask blueprint
    Flask blueprint를 이용해서 깔끔한 모듈화가 가능하다.
    https://scribblinganything.tistory.com/178

    from flask import Blueprint
    
    blue_book = Blueprint("book", __name__, url_prefix="/book")
    
    @blue_book.route("/read")
    def read():
        return "this is read"
    
    @blue_book.route("/write")
    def write():
        return "this is write"
  2. Pug
    일반 HTML 대신 이용하면 코드가 더 깔끔하다.
    https://www.sitepoint.com/a-beginners-guide-to-pug/

    doctype html
    html(lang='en')
    head
    title Hello, World!
    body
    h1 Hello, World!
    div.remark
        p Pug rocks!
  3. WebSocket
    실시간 통신 IO를 위해 적절하다.
    https://poiemaweb.com/nodejs-socketio
    websocket-polling

  4. MySQL commit 수정 후 apply를 누르면 commit이 적용된다.

  5. PuTTY, Bastion
    PuTTY는 remote session을 만들고 유지해준다.
    Bastion host는 gateway instance이며, 인가되지 않는 IP는 private망에 접속할 수 없게 된다.
    Private망에 접속하기 위해서는 bastion-host를 통해 SSH 터널링을 하여 접속하게 된다.
    CloudVPC https://neocan.tistory.com/362
    https://neocan.tistory.com/363

  6. 비밀번호 DB에 저장
    DB에 저장할때는 SHA256등으로 hash하고, blob로 넣는다.
    https://auth0.com/blog/adding-salt-to-hashing-a-better-way-to-store-passwords/
    https://mobiarch.wordpress.com/2012/11/27/storing-password-hash-in-mysql/

    create table UserLogon ( 
    userId integer NOT NULL,
    password blob NOT NULL,
    
    PRIMARY KEY (userId)
    );
    import hashlib
    string = "saltedpassword"
    hashlib.sha256(string.encode()).hexdigest()