Airdrop won’t send files, says recipient has declined request

Airdrop on my 8mth old iMac has stopped sending docs through airdrop. It can receive ok but when trying to send it comes back with a message saying recipient has declined the request. No messages are being received by the recipient or any actions being made.

Apple won’t help unless I pay £35!!!!!

Any else experienced this?

How to use IMPORTJSON function in google script to request a list of top gainers and their float [on hold]

I’m trying to write a google script that use the IMPORTJSON function to request a list of the top 10 stocks that gained value during the current day. I separated the code into two files. One file has the IMPORTJSON function, and the other has the function that request the data that I need. After requesting the data, the latter function sends it to me by email, but the email that I receive says “Error getting data”.This is the IMPORTJSON script:

    function IMPORTJSON(url,xpath){
    try{
    // /rates/EUR
    var res = UrlFetchApp.fetch(url);
    var content = res.getContentText();
    var json = JSON.parse(content);

    var patharray = xpath.split("/");
    //Logger.log(patharray);

    for(var i=0;i

This is the function is supposed to request the data and send it by email:

    function requestAndSendData() {

    // Get the email address of the active user - that's you.
    var email = Session.getActiveUser().getEmail();

    // Get the name of the document to use as an email subject line.
    var subject = 'runner ';

    // Append a new string to the "url" variable to use as an email body.
    var quote  =IMPORTJSON("https://api.iextrading.com/1.0//stock/market/list/gainers");
    // Send yourself an email with a link to the document.
    GmailApp.sendEmail(email, subject, quote);
    }

I wrote the request function using the IEX API dcoumentation from this website IEX API Documentation

I am not really sure why I am getting this error. I would appreciate any help. Thanks.

dnsmasq not forwarding request to nameserver

I’m trying to run two instances of dnsmasq on a raspberry pi, I’ve gotten quite far. I’m currently trying to get the first dnsmasq server to forward any request it doesn’t know the answer to to the second server but it only seems to be working if I dig

@127.0.0.1. Using the external addresses of the either interface, or querying from another machine doesn’t do it.

Querying either server directly gets the desired result, but trying to get the first server to forward results from the second… not so much.

Config for instance A (lan):

root@Raspberry-server:~# cat /etc/dnsmasq/dnsmasq.conf

port=53
except-interface=eth0.1
bind-interfaces

no-hosts
#changing the cache size makes no difference
#cache-size=5000
cache-size=0

# uncomment to forget about 404 responses
#no-negcache

#resolv-file=/etc/dnsmasq/resolv.lan.conf
#no-poll
no-resolv
strict-order

server=192.168.1.13

auth-server=raspberry.lan,eth0
auth-zone=lan,192.168.1.0/24
host-record=raspberry.lan,192.168.1.11
host-record=htpc.lan,192.168.1.10
host-record=tom.lan,192.168.1.12

Config for instance B (global):

root@Raspberry-server:~# cat /etc/dnsmasq/dnsmasq.blocker.conf

port=53
bind-interfaces
listen-address=192.168.1.13

no-hosts
addn-hosts=/etc/dnsmasq/blocked.host
cache-size=100000

# uncomment to forget about 404 responses
#no-negcache

resolv-file=/etc/dnsmasq/resolv.blocker.conf
#no-poll

strict-order

Instance A status log:

systemd[1]: Starting DNSMasq Lightweight DNS server...
dnsmasq[1651]: dnsmasq: syntax check OK.
dnsmasq[1656]: started, version 2.76 cache disabled
dnsmasq[1656]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
systemd[1]: Started DNSMasq Lightweight DNS server.
dnsmasq[1656]: using nameserver 192.168.1.13#53

Why are “Request header read timeout” messages in error log when page loads are short?

I am running a Rails application with Apache 2.4.10 and mod_passenger. The site uses https exclusively. I am seeing these messages in my error log:

[Wed May 31 19:05:37.528070 2017] [reqtimeout:info] [pid 11111] [client 10.100.23.2:57286] AH01382: Request header read timeout  
[Wed May 31 19:05:37.530672 2017] [reqtimeout:info] [pid 11229] [client 10.100.23.2:57288] AH01382: Request header read timeout  
[Wed May 31 19:05:37.890259 2017] [reqtimeout:info] [pid 10860] [client 10.100.23.2:57271] AH01382: Request header read timeout  
[Wed May 31 19:05:37.890383 2017] [reqtimeout:info] [pid 10859] [client 10.100.23.2:57272] AH01382: Request header read timeout  
[Wed May 31 19:05:37.890459 2017] [reqtimeout:info] [pid 10862] [client 10.100.23.2:57285] AH01382: Request header read timeout  
[Wed May 31 19:05:37.947942 2017] [reqtimeout:info] [pid 10863] [client 10.100.23.2:57287] AH01382: Request header read timeout 

These messages appear in the error log about two to three seconds after the end of my page load. However, the complete page load takes only a few seconds. I am using mod_reqtimeout with this setting:

RequestReadTimeout header=20-40,minrate=500

Since the page load only takes a few seconds I do not understand why the Request header read timeout messages are being logged to the error log.

Why are these messages appearing and what can I do to remedy this?

How to use IMPORTJSON function in google script to request a list of top gainers and their float

I’m trying to write a google script that use the IMPORTJSON function to request a list of the top 10 stocks that gained value during the current day. I separated the code into two files. One file has the IMPORTJSON function, and the other has the function that request the data that I need. After requesting the data, the latter function sends it to me by email, but the email that I receive says “Error getting data”.This is the IMPORTJSON script:

    function IMPORTJSON(url,xpath){
    try{
    // /rates/EUR
    var res = UrlFetchApp.fetch(url);
    var content = res.getContentText();
    var json = JSON.parse(content);

    var patharray = xpath.split("/");
    //Logger.log(patharray);

    for(var i=0;i

This is the function is supposed to request the data and send it by email:

    function requestAndSendData() {

    // Get the email address of the active user - that's you.
    var email = Session.getActiveUser().getEmail();

    // Get the name of the document to use as an email subject line.
    var subject = 'runner ';

    // Append a new string to the "url" variable to use as an email body.
    var quote  =IMPORTJSON("https://api.iextrading.com/1.0//stock/market/list/gainers");
    // Send yourself an email with a link to the document.
    GmailApp.sendEmail(email, subject, quote);
    }

I wrote the request function using the IEX API dcoumentation from this website IEX API Documentation

I am not really sure why I am getting this error. I would appreciate any help. Thanks.

Request Method Mudando de GET para OPTIONS sozinho

Estou com o seguinte código:

$(function() {
    $('#method').change(function() {
        var method = $(this).val();
        if (method == 'GET' || method == 'DELETE')
            $('#json-group').hide();
        else
            $('#json-group').show();
    });

    $('#send-button').click(function() {
        var url = $('#url').val()
        var a = document.createElement('a');
        a.href = url;
        var method = $('#method').val();
        if (method == 'GET')
            var data = '';
        else
            var data = $.trim($('#json').val());
        var md5 = data ? CryptoJS.MD5(data).toString(CryptoJS.enc.Base64) : '';
        var date = (new Date()).toUTCString();

        var parts = [method, md5, date, a.pathname].join('n');
        var hmac = CryptoJS.HmacSHA1(parts, $('#api_secret').val());
        var sig = hmac.toString(CryptoJS.enc.Base64);
        var auth = 'Zopim-Reseller-API ' + $('#api_token').val() + ':' + sig;
        var headers = {'API-Date': date, Authorization: auth};
         $.ajax({
      url: url,
      type: method,
      dataType: 'json',
      success: function() { alert('hello!'); },
      error: function() { alert('boo!'); },
      beforeSend: setHeader
         });

         function setHeader(xhr) {
    xhr.setRequestHeader('Authorization', auth);
    xhr.setRequestHeader('API-Date', date);
  }
    });
});

Esse código deveria mandar uma requisição GET, só que no Chrome ele me informa os seguintes dados:

Remote Address:67.23.229.9:443
Request
URL:https://reseller.zopim.com/api/info
Request Method:OPTIONS

Status Code:200 OK
Request Headersview source
Accept:/
Accept-Encoding:gzip,deflate,sdch
Accept-Language:pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
Access-Control-Request-Headers:accept, authorization, api-date
Access-Control-Request-Method:GET
Connection:keep-alive
Host:reseller.zopim.com
Origin:http://zopim.net.br

E por consequência da esse erro:

XMLHttpRequest cannot load https://reseller.zopim.com/api/info. Request header field Authorization is not allowed by Access-Control-Allow-Headers.

Choice between PUT and a separate request for each change for CRUD-based UI

I’m making an HTTP API for ASP.NET Core Identity.

Basically what I want is a remote version of this: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.usermanager-1?view=aspnetcore-2.1

It has methods like ChangePasswordAsync, ChangePhoneNumberAsync etc.

The easiest way to do this would be to have a separate request model for each of those methods like ChangeUserPasswordRequest, ChangeUserPhoneNumberRequest and separate endpoint for each change like POST /users/changePassword, POST /users/changePhoneNumber.

This is much easier to implement than PUT /users/:id but it is slightly more complicated on the client side with 1 form for everything(where I have just 1 save button). And it would be much easier to have 1 model like UserDto and 1 endpoint for editing everything like PUT /users/:id.

Compare yourself:

public class UserDto
{
    public int Id { get; set; }
    public string PhoneNumber { get; set; }
    public string Email { get; set; }
    public string UserName { get; set; }

    // ... other properties of the user
    // ...
}

[HttpPut("{id}")]
public async Task Put(int id, UserDto userDto)
{
     var user = await _userManager.FindByIdAsync(id.ToString());
     if (user == null) return NotFound();

     if (userDto.PhoneNumber != user.PhoneNumber) // phone number has changed
     {
         var identityResult = await _userManager.ChangePhoneNumberAsync(user, userDto.PhoneNumber, userDto.Token);
         //... error handling
     }
     // compare each property like that and call adequate method
     //...
}

This is much easier for the client, as you just bind UserDto to the form and send it back on the server with one method like UpdateUser(userDto).

Now compare it to action that has single responsibility:

public class ChangeUserPhoneNumberRequest 
{
    public ChangeUserPhoneNumberRequest(string userId, string phoneNumber, string token)
    {
        UserId = userId;
        PhoneNumber = phoneNumber;
        Token = token;
    }

    public string UserId { get; }
    public string PhoneNumber { get; }
    public string Token { get; }
}

[HttpPost("changePhoneNumber")]
public async Task ChangePhoneNumber(ChangeUserPhoneNumberRequest request)
{
    var user = await _userManager.FindByIdAsync(request.UserId.ToString());
    if (user == null) return NotFound();
    var identityResult = await _userManager.ChangePhoneNumberAsync(user, request.PhoneNumber, request.Token);
    //... error handling
}

This looks slightly better on the server and the action is more explicit, however, it seems harder on the client, as you don’t have the comfort like with 1 model that you can just send with 1 method like UpdateUser(userDto) this also has the advantage of not sending unnecessary properties. Instead, you have to send many requests for each property you want to change like SendChangeUserPasswordRequest, SendChangeUserEmailRequest and so on. My UI is not task-based but CRUD-based, hence it is harder.

My UI looks like this:

CRUD based UI

(From: http://balazblogspot.blogspot.com/2018/07/what-is-task-based-ui.html)

In this kind of UI, it seems more natural to have something like PUT, but it is less natural to implement on the server.

I don’t want to change my UI.

Which approach should I take?

Thank you in advance.

IOTA Light Wallet returns Request Error when sending funds

I am running IOTA Light Wallet 2.5.4 and am connected to my own full node that is in-sync with 4 healthy tangle connections. The minimum weight magnitude (MWM) is set to 14.

When attempting to send funds from the wallet the UI displays Sending... for several minutes, and eventually turns red saying Request Error.

This is the server log at the time of the transaction:

11/30 05:15:00.049 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
11/30 05:15:00.049 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 20
11/30 05:15:00.613 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
11/30 05:15:00.613 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 11
11/30 05:15:01.328 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
11/30 05:15:01.328 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 6
11/30 05:15:01.478 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
11/30 05:15:01.478 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 3
11/30 05:15:01.881 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
11/30 05:15:01.881 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 6
11/30 05:15:02.641 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
11/30 05:15:02.641 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 6
11/30 05:15:04.111 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
11/30 05:15:04.111 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 9
11/30 05:15:04.280 [pool-2-thread-2] INFO  com.iota.iri.network.Node - toProcess = 0 , toBroadcast = 0 , toRequest = 1 , toReply = 0 / totalTransactions = 3296908
11/30 05:15:04.334 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: belowMaxDepth
11/30 05:15:04.334 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 30
11/30 05:15:04.838 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
11/30 05:15:04.838 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 23
11/30 05:15:05.492 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Reason to stop: TransactionViewModel is a tip
11/30 05:15:05.493 [XNIO-1 task-8] INFO  com.iota.iri.service.TipsManager - Tx traversed to find tip: 25

Why can I not use this node to run transactions?