Categories
Mastering Development

Browser says access-control-allow-origin header not present in clojure ring

I make a request to a server through the client browser like so https://example.com/bar, but get the error: Access to XMLHttpRequest at ‘https://example.com/bar/’ from origin ‘https://www.example.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. However, when using clj-http.client, I get the following headers: {“Access-Control-Allow-Headers” “Content-Type”, “Server” “Aleph/0.4.4”, “Via” […]

Categories
Development

My Laravel 5.5 app not working on remote server namecheap VPS after deployment but working fine on local server with WAMP

Everything about this app is working fine on my local sever, but refused to work remotely. if i visit the app www.mysite.com. It always shows internal server error. Though i don’t have any route in web.php but i expected to redirect back to 404 not found page but not doing that but it does on […]

Categories
Development

Ajax (JQuery) data not coming to PHP

I need to get data from the object and send it by email (Or show on screen) But php does not see the data that comes, the response from the server is appropriate. JS (my object) testobjectnode = { one: ‘some1’, two: ‘some2’ } JS (ajax fn) $.ajax({ type: “POST”, url: “mail2.php”, data: {‘object’: testobjectnode}, […]

Categories
Development

ElasticSerch Multi level Aggregation

I’m pushing logs to a index. It will have only the response code. I need to aggregate and get the count based on the response code. Index Data : { “took” : 1, “timed_out” : false, “_shards” : { “total” : 3, “successful” : 3, “skipped” : 0, “failed” : 0 }, “hits” : { […]

Categories
Development Linux

looping through JSON array in shell script using for loop

Below is the curl command output, need script or command to print “doc_count” less than 10 and save the “key” in output.txt file. { “took”: 117, “timed_out”: false, “_shards”: { “total”: 1005, “successful”: 1005, “skipped”: 979, “failed”: 0 }, “hits”: { “total”: 205, “max_score”: 0, “hits”: [] }, “aggregations”: { “2”: { “doc_count”: 205, “bg_count”: […]

Categories
Development

Why does my axios call on POST gets CORS error but GET calls do not?

Hi all and happy new year. I’m having an issue in which, my POST requests are getting blocked by CORS, but the GET requests are functioning just fine. I believe the server is setup properly and I think my axios call is correct – not sure what I’m doing wrong. My biggest suspicion is that […]

Categories
Development System & Network

TCP Handshake Takes Too Long / Too Many TCP Retransmission

We have a webserver for API and a game client. We process API requests from the game client but sometimes it takes way too long for a request to come back. Sometimes we have problems with latency, sometimes timeout or sometimes weird Unknown Errors. Here are some wireshark captures; This one didn’t return a response; […]

Categories
Development System & Network Unity

High Rest-API Return Latencies on Unity

1-It sometimes takes too much for a request to complete. For example a simle API request (POST) usually takes 300-400 ms. But sometimes it takes up to 10 seconds and it actually sometimes time outs. Weird part over here is that it even takes too much time that sometimes when working with local API and […]

Categories
Development GitHub

Understanding Hyperledger Fabric Block Extract

I want to receive a better understanding of a block structure of a hyperledger fabric 1.4.2 block and whats happening inside of it. Therefor I used the FabCar Example and made one update process and extracted this relevant block. After downloading this block for analysis, I decoded it with: peer channel fetch 5 mychannel5.block -c […]

Categories
Development JSON System & Network

Convert json file to prometheus metrics

I have nginx json access log like this, a file that append sample like this to end of file. { “time”: “2019-11-27T08:23:39+00:00”, “msec”: 1574843019.787, “ip”: “91.133.248.69”, “agent_name”: “firefox”, “agent_version”: “70”, “agent_os”: “linux”, “agent_os_version”: “”, “agent_category”: “pc”, “agent_vendor”: “mozilla”, “agent_hash”: “5c12a77e”, “geo_country_code”: “IR”, “geo_latitude”: “35.69610”, “geo_longitude”: “51.42310”, “geo_accuracy_radius”: “50”, “geo_continent_name”: “Asia”, “geo_isp”: “Mobile Communication Company of […]