logo
down
shadow

Erlang ssh module not recognizing my ssh keys


Erlang ssh module not recognizing my ssh keys

By : Sujan Dasgupta
Date : November 25 2020, 01:01 AM
it fixes the issue Check the content of your ~/.ssh/config file. I believe that Erlang module is looking for id_rsa or id_dsa files directly in the directory. You might have an entry in your config file for some.host.com which defaults to different key location or different user name. Because of this, logging using command line works and it fails when the module tries to establish connection.
Also check what keys you have currently loaded in your agent session (ssh-add -L). Perhaps your are using a different key for this particular host than you suspect.
code :


Share : facebook icon twitter icon
jshashtable not recognizing equivalent keys

jshashtable not recognizing equivalent keys


By : user3614954
Date : March 29 2020, 07:55 AM
hope this fix your issue There are two minor problems in the code you've posted:
The first parameter in your function declaration should be dId rather than did, but I assume that must be a typo in your example here because the code here throws immediately when Key is called; alert("obj instanceof Key: " + obj instanceof Key); is misleading: it alerts false because operator precedence makes it effectively ("obj instanceof Key: " + obj) instanceof Key.
code :
var h = new Hashtable();
var k1 = new Key(5, 6), k2 = new Key("5", "6");
h.put(k1, 1);
h.put(k2, 2);

alert(h.keys().length);
requirejs modules not recognizing paths keys as keys and looking for key as if it was file name

requirejs modules not recognizing paths keys as keys and looking for key as if it was file name


By : Roman Sovgyria
Date : March 29 2020, 07:55 AM
around this issue You cannot use data-main to load your configuration. What data-main does is tell RequireJS to initiate loading the module it points to, but there is no guarantee when this operation will finish. The error you are getting is because the require in js/index.js executes before js/config is loaded, so it does not use your configuration. A very simple way to fix this problem is by having a module instead of the require you have. So js/index.js would contain:
code :
define(['ooo'], function( $ ) {
    $( document ).ready( function() {
        alert( 'work!' );
    });
});
deps: [ 'index' ]
What is the exact way to send erlang module and erlang function to the mapreduce face in python-riak client l

What is the exact way to send erlang module and erlang function to the mapreduce face in python-riak client l


By : sina
Date : March 29 2020, 07:55 AM
I wish did fix the issue. There are 3 parts to using an Erlang map function with the Python client:
writing and compiling the Erlang module preparing the Riak cluster invoking the function from the Python client
code :
-module(custom_mr).

-export([mapcount/3]).

mapcount(Obj,_Keydata,_Arg) ->
  [length(riak_object:get_values(Obj))].
# /usr/lib/riak/erts-5.9.1/bin/erlc custom_mr.erl
# mkdir /var/lib/riak/custom_code
# mv custom_mr.beam /var/lib/riak/custom_code
# chown -R riak:riak /var/lib/riak/custom_code
# riak attach
1> riak_core_util:rpc_every_member_ann(code,which,[custom_mr]).
{[{'riak@node1.lab.local',"/var/lib/riak/custom_code/custom_mr.beam"},
  {'riak@node2.lab.local',"/var/lib/riak/custom_code/custom_mr.beam"},
  {'riak@node3.lab.local',"/var/lib/riak/custom_code/custom_mr.beam"},
  {'riak@node4.lab.local',"/var/lib/riak/custom_code/custom_mr.beam"}],
 ['riak@node5.lab.local']}
2> custom_mr:mapcount(riak_object:new(<<"test">>,<<"test">>,<<"test">>),keydata,arg).
[1]
import riak

client = riak.RiakClient()

test_bucket = client.bucket('test')

data1 = test_bucket.new('key1',data={'field1':'1data1','field2':'1data2','field3':1})
data1.store()

data2 = test_bucket.new('key2',data={'field1':'2data1','field2':'2data2','field3':2})
data2.store()

data3 = test_bucket.new('key3',data={'field1':'3data1','field2':'3data2','field3':3})
data3.store()

query = riak.RiakMapReduce(client).add('testbucket')
query.map(['custom_mr','mapcount'])

for result in query.run():
    print "%s" % (result)
#python test.py
1
1
1
-module(custom_mr).

-export([mapcount/3,
         mapvalue/3,
         mapfield/3,
         mapfieldwithid/3,
         reducecount/2,
         reducepropsort/2,
         reducedoublesort/2,
         reducesort/2]).

mapcount(Obj,_Kd,_Arg) ->
  [length(riak_object:get_values(Obj))].

mapvalue(Obj,_Kd,_Arg) ->
  [hd(riak_object:get_values(Obj))].

mapfield(Obj,_Kd,Arg) ->
  Val = case catch mochijson2:decode(hd(riak_object:get_values(Obj))) of
    {struct, Data} ->
        case Arg =:= null of
          true -> Data;
          false -> [{Arg,proplists:get_value(Arg,Data)}]
        end;
    _ -> 
        [{Arg,{error,notjson}}]
  end,
  [list_to_binary(mochijson2:encode(Val))]. 

mapfieldwithid(Obj,_Kd,Arg) ->
  Val = case catch mochijson2:decode(hd(riak_object:get_values(Obj))) of
    {struct, Data} ->
        case Arg =:= null of
          true -> Data;
          false -> [{Arg,proplists:get_value(Arg,Data)}]
        end;
    _ -> 
        [{Arg,{error,notjson}}]
  end,
  V = [{bucket,riak_object:bucket(Obj)},{key,riak_object:key(Obj)}|Val],
  [list_to_binary(mochijson2:encode(V))].

reducecount(L,_Arg) ->
  [lists:sum([ N || N <- L, is_integer(N) ])].

sortfun(F) ->
  fun(A,B) ->
    proplists:get_value(F,A,<<"zzzz">>) =< proplists:get_value(F,B,<<"zzzz">>)
  end. 

reducepropsort(L,Arg) ->
  Decoded = [ I || {struct,I} <- [ mochijson2:decode(E) || E <- L], is_list(I)],
  Sorted = lists:sort(sortfun(Arg), Decoded),
  [ list_to_binary(mochijson2:encode(I)) || I <- Sorted ].

reducesort(L,_Arg) ->
  lists:sort(L).

reducedoublesort(L,Arg) ->
  Decoded = [ lists:sort(I) || {struct,I} <- [ mochijson2:decode(E) || E <- L], is_list(I)],
  Sorted = lists:sort(sortfun(Arg), Decoded),
  [ list_to_binary(mochijson2:encode(I)) || I <- Sorted ].
import riak

client = riak.RiakClient(pb_port=8087, host="172.31.0.1", protocol='pbc')

test_bucket = client.bucket('test_bucket')

data1 = test_bucket.new('key1',data={'field1':'1data1','field2':'1data2','field3':1, 'zone':'D'})
data1.store()

data2 = test_bucket.new('key2',data={'field1':'2data1','field2':'2data2','field3':2, 'zone':'A'})
data2.store()

data3 = test_bucket.new('key3',data={'field1':'3data1','field2':'3data2','field3':3, 'zone':'C'})
data3.store()


def printresult(q):
  for result in q.run():
    print "%s" % (result)

print "\nCount the number of values in the bucket"
query = riak.RiakMapReduce(client).add('test_bucket')
query.map(['custom_mr','mapcount'])
query.reduce(['custom_mr','reducecount'])
printresult(query)

print "\nList all values in natual sort order"
query = riak.RiakMapReduce(client).add('test_bucket')
query.map(['custom_mr','mapvalue'])
query.reduce(['custom_mr','reducesort'])
printresult(query)

print "\nList all values sorted by 'zone'"
query = riak.RiakMapReduce(client).add('test_bucket')
query.map(['custom_mr','mapfield'])
query.reduce(['custom_mr','reducepropsort'],{'arg':'zone'})
printresult(query)

print "\nList all values sorted by 'zone', also sort the fields in each object"
query = riak.RiakMapReduce(client).add('test_bucket')
query.map(['custom_mr','mapfield'])
query.reduce(['custom_mr','reducedoublesort'],{'arg':'zone'})
printresult(query)

print "\nList just field3, sorted"
query = riak.RiakMapReduce(client).add('test_bucket')
query.map(['custom_mr','mapfield'],{'arg':'field3'})
query.reduce(['custom_mr','reducepropsort'],{'arg':'field3'})
printresult(query)

print "\nList just bucket,key,field3, sorted by field3"
query = riak.RiakMapReduce(client).add('test_bucket')
query.map(['custom_mr','mapfieldwithid'],{'arg':'field3'})
query.reduce(['custom_mr','reducepropsort'],{'arg':'field3'})
printresult(query)

print "\nReturn just the zone for key2"
query = riak.RiakMapReduce(client).add('test_bucket','key2')
query.map(['custom_mr','mapfield'],{'arg':'zone'})
printresult(query)

print "\nReturn the bucket,key,zone for key1 and key3"
query = riak.RiakMapReduce(client).add('test_bucket',['key1','key3'])
query.map(['custom_mr','mapfieldwithid'],{'arg':'zone'})
query.reduce(['custom_mr','reducepropsort'],{'arg':'zone'})
printresult(query)
# python ~/test.py

Count the number of values in the bucket
3

List all values in natual sort order
{"field2": "1data2", "field3": 1, "field1": "1data1", "zone": "D"}
{"field2": "2data2", "field3": 2, "field1": "2data1", "zone": "A"}
{"field2": "3data2", "field3": 3, "field1": "3data1", "zone": "C"}

List all values sorted by 'zone'
{"field2":"2data2","field3":2,"field1":"2data1","zone":"A"}
{"field2":"3data2","field3":3,"field1":"3data1","zone":"C"}
{"field2":"1data2","field3":1,"field1":"1data1","zone":"D"}

List all values sorted by 'zone', also sort the fields in each object
{"field1":"2data1","field2":"2data2","field3":2,"zone":"A"}
{"field1":"3data1","field2":"3data2","field3":3,"zone":"C"}
{"field1":"1data1","field2":"1data2","field3":1,"zone":"D"}

List just field3, sorted
{"field3":1}
{"field3":2}
{"field3":3}

List just bucket,key,field3, sorted by field3
{"bucket":"test_bucket","key":"key1","field3":1}
{"bucket":"test_bucket","key":"key2","field3":2}
{"bucket":"test_bucket","key":"key3","field3":3}

Return just the zone for key2
{"zone":"A"}

Return the bucket,key,zone for key1 and key3
{"bucket":"test_bucket","key":"key3","zone":"C"}
{"bucket":"test_bucket","key":"key1","zone":"D"}
Vue.js not recognizing data keys

Vue.js not recognizing data keys


By : Saumil Shah
Date : March 29 2020, 07:55 AM
Any of those help data must be a function which must return the object of defined data variables, like following:
code :
  data: function () {
    return {
      'firstname': '',
    }
  }
PyQt not recognizing arrow keys

PyQt not recognizing arrow keys


By : johntown
Date : March 29 2020, 07:55 AM
I hope this helps . If your want to don't focus child widget anything. If your want only main QWidget, set Children No Focus Policy;
Example, hope is helps;
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org