I'm getting a weird and very annoying behavior in my terminal. When I type a protocol (i.e 'http:') then the pipe (|) character a backslash() is automatically inserted before the pipe character.
My test:
type 'htt'+'|' => 'ht|'
type 'htt:'+'|' => 'htt:|'
type 'http'+'|' => 'http|'
type 'http:'+'|' => 'http:\|'
type 'http://foo.com'+'|' => 'http://foo.com\|'
type 'curl http://foo.com'+'|' => 'curl http://foo.com\|'
type 'curl https://foo.com'+'|' => 'curl http://foo.com\|'
The same thing happens when I use 'ftp:' but not when I use 'telnet:'
Does anybody know what could be doing this?
This is my system:
OSX sierra
iTerm2 3.0.12
zsh 5.2 (x86_64-apple-darwin16.1.0)
pretzo (https://github.com/sorin-ionescu/prezto)
Related
Failed to interpret Gremlin query: Query parsing failed. "single and double quotes are not parsing"
g.V('a48543e9-d527-4928-b045-71da15a76bfe').property(single, 'title', '{'fr': '', 'en': 'Title Edit 02'}')
Getting error:
{
"detailedMessage": "Failed to interpret Gremlin query: Query parsing failed at line 1, character position at 77, error message : no viable alternative at input 'g.V('a48543e9-d527-4928-b045-71da15a76bfe').property(single,'title','{\\'fr':'",
"requestId": "4307b026-c0b5-45b0-9ec1-293822ee35ef",
"code": "MalformedQueryException"
}
I think you just need to escape your quotes or perhaps simply choose to wrap in double quotes:
g.V('a48543e9-d527-4928-b045-71da15a76bfe').
property(single, 'title', "{'fr': '', 'en': 'Title Edit 02'}")
Working with Riak 1.4.7
I have a document that has a property that is an array of embedded documents. Here is a sample of the document:
{"prospect":true, "name":"HzNUeioPYynsGdXL6iSFvQ",
"contact_email":"contact#HzNUeioPYynsGdXL6iSFvQ.gr",
"e_shops":[{"store_url":"www.store.url.com","display_name":"hello there"},
{"store_url":"www.store2.url.com","display_name":"hello2 there"}]
}
The corresponding bucket has index enabled and works fine. For example, the following search command locate the object without problem:
search-cmd search index_name contact_email:contact#HzNUeioPYynsGdXL6iSFvQ.gr
The question here is how can I search by the store_url for example.
store_url is a property of an embedded document which, in turn, is an element of an array property of the main document.
1) Do I have to specify a custom schema file in order for the index to index these properties?
2) Do I have to query using some kind of special syntax?
The default JSON extractor should handle that case by joining all of the values in the array in a space separated list. Nested names are handled by joining them with an underscore. So in this case, the field e_shops_store_url would contain www.store.url.com www.store2.url.com. You can query that field normally.
I ran a quick example to demonstrate:
root#node1:~# search-cmd install searchtest
:: Installing Riak Search <--> KV hook on bucket 'searchtest'.
root#node1:~# curl 172.31.0.1:8098/buckets/searchtest/keys/test1 \
-XPUT -H"content-type:application/json" \
-d '{"prospect":true, "name":"HzNUeioPYynsGdXL6iSFvQ",
> "contact_email":"contact#HzNUeioPYynsGdXL6iSFvQ.gr",
> "e_shops":[{"store_url":"www.store.url.com","display_name":"hello there"},
> {"store_url":"www.store2.url.com","display_name":"hello2 there"}]
> }'
root#node1:~# curl 172.31.0.1:8098/buckets/searchtest/keys/test2 \
-XPUT -H"content-type:application/json" \
-d '{"prospect":true, "name":"-HzNUeioPYynsGdXL6iSFvQ",
>"contact_email":"contact#-HzNUeioPYynsGdXL6iSFvQ.gr",
>"e_shops":[{"store_url":"www.store.url.com","display_name":"hello there"},
> {"store_url":"www.store3.url.com","display_name":"hello3 there"}]
>}'
root#node1:~# search-cmd search-doc searchtest e_shops_store_url:www.store.url.com
:: Searching for 'e_shops_store_url:www.store.url.com' / '' in searchtest...
------------------------------
index/id: searchtest/test1
<<"contact_email">> => <<"contact#HzNUeioPYynsGdXL6iSFvQ.gr">>
<<"e_shops_display_name">> => <<"hello there hello2 there">>
<<"e_shops_store_url">> => <<"www.store.url.com www.store2.url.com">>
<<"name">> => <<"HzNUeioPYynsGdXL6iSFvQ">>
<<"prospect">> => <<"true">>
------------------------------
index/id: searchtest/test2
<<"contact_email">> => <<"contact#-HzNUeioPYynsGdXL6iSFvQ.gr">>
<<"e_shops_display_name">> => <<"hello there hello3 there">>
<<"e_shops_store_url">> => <<"www.store.url.com www.store3.url.com">>
<<"name">> => <<"-HzNUeioPYynsGdXL6iSFvQ">>
<<"prospect">> => <<"true">>
------------------------------
:: Found 2 results.
:: Maximum score "0.353553".
I have this piece of code:
BEGIN
DBMS_SCHEDULER.DROP_JOB (
job_name => 'LOANSBUILD.LOANSNEWYORKCLOSE');
END;
/
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => '***.LOANSNEWYORKCLOSE',
job_type => 'PLSQL_BLOCK',
job_action => 'begin loans_schedule_job.loans_close(TRUNC(SYSDATE), ''N''); end;',
start_date => '15-NOV-08 12.00.00.000000000 AM AMERICA/NEW_YORK',
repeat_interval => 'FREQ=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=16;BYMINUTE=0;BYSECOND=0',
auto_drop => FALSE,
job_class => 'DEFAULT_JOB_CLASS',
enabled => TRUE,
comments => 'Test.'
);
END;
/
exit;
When the above is executed from an environment which has oracle sql client 10.2 installed , this goes fine but when the same is executed fron an environment that has 11.2 client installed, this fails as below:
BEGIN
*
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string
ORA-06512: at line 2
The variable nls_date_format is set to 'DD-MON-RR' in the 10.2 environment and set to 'YYYY-MM-DD HH24:MI:SS' in the 11.2 env.
As this was getting compiled for 10.2 env, I updated nls_lang_date in the 11.2 env as well to make it 'DD-MON-RR' but even after that I get the same error. Is there anything else I should be setting.
Please note that I am sysadmin and as this code is getting compiled on of the server, my job is to ensure that it does on others as well. Which also means that I do not have permissions to update code.
According to the CREATE_JOB Procedure documentation, the parameter start_date must be of type TIMESTAMP WITH TIME ZONE.
In your PL/SQL code you are instead passing a string thus relying on implicit conversion.
You could instead use an explicit conversion to the TIMESTAMP WITH TIME ZONE data type such as:
TO_TIMESTAMP_TZ('15-NOV-08 12.00.00.000000000 AM AMERICA/NEW_YORK', 'DD-MON-RR HH:MI:SS.FF AM TZR')
When I try to add a user on OpenLDAP 2.4.32 using ldapmodify which has a german umlaut I get a ldap syntax error
ldapmodify.exe" -a -x -H ldap://localhost -D %LDAP_ROOT% -w %LDAP_SECRET%
dn:uid=aöich,ou=Users,dc=cricbox,dc=in
changetype: add
objectClass:person
objectClass:inetOrgPerson
objectClass:organizationalPerson
uid:aöich
cn:aöich
sn:aöich
ldap_add: Invalid DN syntax (34)
additional info: invalid DN
How to add a user with german mmlaut character on OpenLDAP server ?
Check if your databank schema supports Unicode. Check LDAP documentation here:
attributeType ( 2.5.4.41 NAME 'name'
DESC 'name(s) associated with the object'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
attributeType ( 2.5.4.3 NAME ( 'cn' 'commonName' )
DESC 'common name(s) assciated with the object'
SUP name )
Your attributes should contain:
directoryString 1.3.6.1.4.1.1466.115.121.1.15 Unicode (UTF-8) string
I am trying to implement a complex dialplan that requires interaction with the user. Based on this interaction, the dialplan jumps to another part. Some sample code is given below:
[test]
;This is a test.
exten => 0,n(qa1),NoOp()
exten => 0,1,Verbose(1, "This is a test")
exten => 0,n,Set(USER_ANSWER=0)
exten => 0,n,Read(USER_ANSWER,,1,,2,10)
exten => 0,n,Verbose(1, "User keyed in ${USER_ANSWER}")
exten => 0,n,GotoIf($[$["${USER_ANSWER}"="1"] | $["${USER_ANSWER}"="2"]]?eval1:qa1)
exten => 0,n,Verbose(1, "User keyed in ${USER_ANSWER}")
exten => 0,n(eval),NoOp()
...
On running the above code, asterisk hangs up after evaluating the GotoIf condition above. The error messages are as follows:
-- User entered '1'
-- Executing [0#test:19] Verbose("DAHDI/13-1", "1, "User keyed in 1"") in new stack
"User keyed in 1"
-- Executing [0#test:20] GotoIf("DAHDI/13-1", "1?eval1:qa1") in new stack
-- Goto (test,0,21)
-- Executing [0#test:21] NoOp("DAHDI/13-1", "") in new stack
[Jan 25 10:47:48] WARNING[29738]: pbx.c:3677 pbx_extension_helper: No application 'If' for extension (test, 0, 22)
My questions are:
What does that error message mean?
How can I correct it so it works?
The GotoIf is invoked correctly. The label eval1 has If statements following it. Asterisk does not have If statements. Replacing the If statements with ExecIf did the trick. One can figure out what commands are available by typing, at the Asterisk CLI prompt, the following command:
core show application <command name here>
If the above command returns an output, then that command is available, else not.