Skip to content

Instantly share code, notes, and snippets.

View User9000's full-sized avatar

Carlo Lam User9000

  • El Centro, CA
View GitHub Profile
@User9000
User9000 / pleaseEscape.py
Created April 9, 2019 01:58 — forked from jonhurlock/pleaseEscape.py
Example Python Code showing cURLing data and POSTing data to Elastic Search, but fails with escaped speech marks
############# My Clusters Health
curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty=true'
{
"cluster_name" : "TweetHadoop",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 15,
@User9000
User9000 / C vs System Calls.md
Created February 4, 2019 00:46 — forked from Integralist/C vs System Calls.md
C vs System Calls and where to find documentation?

What's the issue?

It can be confusing sometimes knowing where to look for documentation when dealing with C †

† that is if you're not a systems engineer, and have no CS degree, nor learnt C

As an example, you might learn about the strace command and start investigating what your Ruby application is up to. In doing so you'll see lots of calls to different functions and you might decide you want to look up the documentation for those functions.

This could be where your first problem arises. You might think "Ruby is written in C, so I'll look at the C documentation" and then come up with nothing.

@User9000
User9000 / dummy-web-server.py
Created January 25, 2019 00:14 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost