chubin / cheat.sh

the only cheat sheet you need
https://cheat.sh/
MIT License
38.14k stars 1.78k forks source link

Uncached cheat.sh queries not returning anything. #322

Closed sentientmachine closed 2 years ago

sentientmachine commented 2 years ago

The cht.sh server is returning cached items okay, as in:

http://cheat.sh/python/sum http://cheat.sh/python/pandas

But new never before seen queries such as:

http://cheat.sh/python/pandas+dataframe+sum+count http://cheat.sh/python/dataframe+sum http://cheat.sh/python/pandas+gbp http://cheat.sh/python/gbp http://cheat.sh/python/token

All return:

$ curl cheat.sh/
python/dataframe+sum
#  404 NOT FOUND
#  
#  Unknown cheat sheet. Please try to reformulate your query.
#  Query format:

 /LANG/QUESTION

#  Examples:

 /python/read+json
 /golang/run+external+program
 /js/regex+search

#  See /:help for more info.
#  
#  If the problem persists, file a GitHub issue at
#  github.com/chubin/cheat.sh or ping @igor_chubin

Screenshot: https://imgur.com/C4pWaw3.png

sudo please be giving me username and password serverside so I can go in and fix your code, sh | -recursive force (this is a joke)

abitrolly commented 2 years ago

Most probably cache ate all disk space. Or StackOverflow limited cht.sh access with some CAPTCHa. Or both.

sudo please be giving me username and password serverside so I can go in and fix your code, sh | -recursive force

And what is it the plan?

sentientmachine commented 2 years ago

If stackoverflow has gated their API's that makes me sad. Hopefully serverside can be rumbled back to life. What is the fee structure, if money is preventing a fix money can be borrowed into existence.

abitrolly commented 2 years ago

@chubin knows. All I can see is that server is hosted on Hetzner, and as far as I know Hetzner doesn't provide any Open API to query disk space, mem, CPU stats and fee that is needed to keep them up.

chubin commented 2 years ago

Thank you for the ticket. I know about the problem existence before, but the issue is still very important, and motivating :)

The problem is here since December 16, and we have been trying to solve it. I hope that the solution is close, and the problem will be fixed soon. It is in our proprietary search engine, and it nothing of the resource limitation, full disks, etc kind of problems. So let's just wait and I will come up with a solution.

Please excuse me for the inconvenience.

@abitrolly Sorry for my disappearance, I saw your commits and the things you did, thank you very much for them. I hope I will come back to the project soon.

chubin commented 2 years ago

Happy new year! :christmas_tree:

The problem is fixed. Please check if it works for you.

sentientmachine commented 2 years ago

It's fixed.

I've been tearing apart the cublas libraries lately for people trying to N-Gpu accelerate their python code, octave code or pandas dataframes code, so that heavy ML related operations (dot products, linear algebra etc) go 1 to 4 orders of magnitude faster than with a CPU because you can use all 10 thousand cores in parallel to do the work. Your service is helping me drill in that.

Comments buried 15 layers deep in that code are laid down by Nvidia and Google developers hide hints in comments for how to increase your probability of passing the 8 onsite interviews from zero to five zeros and a one. If you're the kind of person who hacks on the labyrinth of cuda, then apparently that's a thing they like to see.

chubin commented 2 years ago

@sentientmachine Eric, you've switched from R to Python completely, or was it was temporary for a short time?

sentientmachine commented 2 years ago

@chubin For better or worse I've been jumping around between maybe 10 computer languages, C++, Java, Python, R, Octave, Perl, Bash, Psql, vimscript, php, html5, github markdown, latex, javascript, and probably a few others.

We all should have agreed to just stick with C++ for everything, it would have been easier that way.

Like Jim Cramer I subscribe to the ideology of "what's working now". R can do machine learning stuffs in 6 lines of code that takes hundreds for other languages. https://clint.id.au/?p=1900 I was able to get a solid 1.5 TFLOPS out of my 1080TI GPU for the first time ever this week for matrix and linear algebra transforms, which is all machine learning is, so that's gratifying, next action swap the engine, duct tape the transmission back on.

Older programmers will lift their nose in disgust and ask why is your coin making machine made of 9 different programming languages? Why not just stick one we've got an episode of hoarders over here.

https://xkcd.com/1838/

abitrolly commented 2 years ago

And more Rust and Ruby stuff is coming. )

sentientmachine commented 2 years ago

@abitrolly Once you've got your dev environment and skill set up to muster on Rust, Ruby and Golang, I'll need to throw that all away and focus on PHP, Java, Julia, Dart, Swift, and Powershell to run on an Azure cloud instance. https://www.youtube.com/watch?v=PktyJR_U2J0

http://cheat.sh/julia/write+to+file

sentientmachine commented 2 years ago

Reopening because this bug crops up every 2 to 5 months.

This query works because serverside has cached the response: http://cheat.sh/psql/convert+numeric+column+to+integer

This query produces an internal server error because serverside has not cached the response: http://cheat.sh/psql/convert+numeric+column+to+double

Error Message:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

It's in serverside code only available to masterchief. Anyone have root password to his servers? /jk

abitrolly commented 2 years ago

I am not sure if the caching code is in the repository. Exposing cache metrics would be helpful for diagnostics. Then add cache invalidation for stale entries. It may happen that there is no cache invalidation at all, so the server stops when disk or memory is full. But I haven't looked into the code yet. Just got five minutes to comment.

abitrolly commented 2 years ago

In particular, adding cache/disk/mem metrics to the "Internal Server Error" page would help to diagnose what is going on.

sentientmachine commented 2 years ago

Code is working again effective now(), Closing. http://cheat.sh/psql/convert+numeric+column+to+integer http://cheat.sh/psql/convert+numeric+column+to+double If serverside is too expensive to maintain since there's a real cost component let me know kthx.