1. Use a proxy service which just exposes one key to that service - this is basically like 3

  2. call the API from the back end - i think that mashape is an API proxy? yahoo also run an API proxy where you can use third party proxies - I have found this to be a bit unreliable.

  3. if the API allows it you can tell it to only allow traffic from one domain - this actually seems like the most reasonable approach.

  4. Use env variables if you have a back end and access to the server.

Posted @ 2019-02-28 12:44

you can link to any wikipedia page by an id

https://en.wikipedia.org/?curid=23251407

random number in this range seems ok:

232562

https://en.wikipedia.org/?curid=232962

get random stuff (doesn't only return articles):

https://en.wikipedia.org/w/api.php?action=query&list=random&rnlimit=5

one random article (CHAR LIMIT exchars=500):

https://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&prop=extracts&exchars=500&format=json

specify an article type (otherwise you get all kinds of non-article things like templates and talks) THE ORDER OF THIS SEEMS TO MATTER

&grnnamespace=0


https://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=1&prop=extracts&format=json

search for articles by a word (here the word is: meaning):

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search%7Calllinks&iwurl=1&srsearch=meaning



/w/api.php?action=query&format=json&list=search%7Calllinks&iwurl=1&srsearch=meaning

Request json: { "action": "query", "format": "json", "list": "search|alllinks", "iwurl": 1, "srsearch": "meaning" }

CORs errors

Adding origin=* fixes CORs errors for requests from localhost for this API.

Posted @ 2019-02-28 12:49

Run as root:

docker stop $(docker ps -q)

Posted @ 2019-02-28 12:57

get current driver info:

sudo lshw -c video

current driver:

configuration: driver=amdgpu latency=0

replace AMDs driver with MESA:

https://launchpad.net/~paulo-miguel-dias/+archive/ubuntu/pkppa

So folloing the advice in the above link i first purged and removed then did

sudo lshw -c video

and it's still using the same driver, so i don't think it's actually using the mesa driver at all

after re-adding the packages it still shows the driver as:

amdgpu

seems the right driver is installed you can check with:

glxinfo | grep "OpenGL version"

says mesa there

The mesa drivers are better but I am still getting graphical problems.

Posted @ 2019-02-28 13:01

See ports in use:

sudo netstat -plnt

Filter the list:

sudo netstat -plnt | grep ':80'

Kill all proccess using a specific port, this will do so violently:

kill -9 $(lsof -t -i:5000)
Posted @ 2019-02-28 14:45