How to fix error reset link formatting when reset password erpnext? - erpnext

Hello… I have error reset link when reset password for user like this:
http://xxxxx.xxxxxx.com,xxxxx.xxxxxx.com:8000/update-password?key=MpqDCOxDO7vEZUCHi5F8rfSHeIgzBLyo
The link is duplicated, contains comma and port number !
It should like this:
https://xxxxx.xxxxxx.com/update-password?key=xxxxxxxxxxxxxxxx
Any kind of help please?

This problem will resolve if you set your host_name in site_config.json file of that particular site

Related

how to reset the keyring of stored email password in Visual Studio Code in Windows with yagmail?

I'm using knockknock to email myself when training a model is complete.
I am using VS Code. The first time I
use the #email_sender(recipient_emails=email_address), it prompted me for a password, which I typed in the wrong one.
Unfortunately VS Code stores the password in a keyring, and I cannot figure out how to reset this value. How to reset the password stored in the keyring?
VS Code apparently only prompts you for your email password the FIRST time you use knockknock's #email_sender decorator, but every time after that, VS Code does NOT prompt for the password, so I have no way to adjust/fix the password to the right one.
How to reset the stored password in the keyring? I think knockknock uses the yagmail library
It took me a while but I eventually found the solution:
import keyring
# to show the set password
print(keyring.get_password("yagmail", "your_email"))
# to change to the current password
keyring.set_password("yagmail", "your_email", "new_password")

FIX QuoteRequest Header fields out of order (or Unsupported Message)

I'm trying to send QuoteRequest to get quote before deciding to whether to place an order, but the Fix server is unhappy. It seems to me that I follow the documentation here and here, but obviously I'm missing something obvious.
Although, I send same message to two identical installations if FIXimulate (Windows and Mac) and receive two different resonses.
here is config.ini
# default settings for sessions
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=60
SenderCompID=BANZAI
[SESSION]
BeginString=FIX.4.2
TargetCompID=FIXIMULATOR
StartTime=00:00:00
EndTime=00:00:00
# overide default setting for RecconnectInterval
ReconnectInterval=30
HeartBtInt=30
SocketConnectPort=9878
# SocketConnectHost=127.0.0.1
SocketConnectHost=192.168.1.67
DataDictionary=FIX42.xml
FileStorePath=.
Message I send:
8=FIX.4.2|9=90|35=R|34=2|49=BANZAI|52=20170322-11:48:49.000|56=FIXIMULATOR|131=0004|146=1|55=AMZN|38=100|10=180
using updated code to avoid fiddling manually with Header:
def sendQuoteRequest(self):
message = quickfix.Message()
message.getHeader().setField(quickfix.BeginString(quickfix.BeginString_FIX42))
message.getHeader().setField(quickfix.MsgType(quickfix.MsgType_QuoteRequest))
message.setField(quickfix.QuoteReqID("0004")) # 131
group = quickfix43.QuoteRequest().NoRelatedSym()
group.setField(quickfix.Symbol('AMZN'))
group.setField(quickfix.OrderQty(100))
message.addGroup(group)
print "QuoteRequest: " + str(message)
quickfix.Session.sendToTarget(message, self.sessionID)
But still I have the same error back 58=Unsupported Message Type|372=R|380=3:
8=FIX.4.2|9=105|35=j|34=2|49=FIXIMULATOR|52=20170322-11:48:49.689|56=BANZAI|45=2|58=Unsupported Message Type|372=R|380=3|10=099
I'm totaly confused and would really appriciate help!
I have used QF with Python extensively and always set the header fields as in the documentation and as you have done. I think the problem is actually in your last line. Try only passing the message itself, as opposed to the message and your sessionID, like:
quickfix.Session.sendToTarget(message)
Also, when I call this, for some reason I have to write
quickfix.Session_sendToTarget(message)
which is very different. We may be operating with different versions of QF. In any case it looks like your message is going out but if you get desperate you might try the underscore.

CNAME and WHM - how to stop domain name being appended automatically

Really quick one - I am attempting to use mailgun for my email.
One of the requirements is to add a CNAME = mailgun.org
I am attempting to do this via WHM - and can successfully create the record under 'Edit DNS Zone' for the domain.
The problem is that it is auto-appending my domain name after the 'mailgun.org' entry
So when I save the record gets saved as mailgun.org.mydomainname.com
How can I stop the auto-append of my domain name to a CNAME??
For anyone who has this problem the answer is simple - just add a fullstop after mailgun.org (mailgun.org.)
Simplest things but when you don't know them they can be a real pain!
I had the same problem and solved it by adding an extra blank after entering mailgun.org.
So type the following: mailgun.org.(add a space after the final period)

Create event log entry with powershell and fill in user

I need to create entry to Windows Event Log (e.g. application log). I know how to do all the stuff beside filling in the user who performed the action.
Example:
I need to create a script, that writes some message into application log. I used this tutorial, which worked fine: http://blogs.technet.com/b/heyscriptingguy/archive/2013/06/20/how-to-use-powershell-to-write-to-event-logs.aspx
But I am not able to influence the "user". When adding entry in windows log, it always fills "User: N/A".
Any idea how to pass "user" argument to the "write-eventlog" cmdlet?
Thank you for your help.
Even though (as far as I'm aware) Write-EventLog does not provide an option to write directly to the "User" field, you have two workarounds:
Use built-in standalone exec "EventCreate.exe" (type in eventcreate /? to see the manual)
This one does support providing the username field. I'm not sure, but it may require a password for that user too.
Second workaround would be to pass $env:USERNAME to the "message" field of Write-EventLog. This way you will still obtain the environment's current user.
I hope that helped.

How do I get the text-form verification code when doing auto site access in Perl?

I'm playing around with Win32::IE:Mechanize to try to access some authentication-required sites automatically. So far I've achieved moderate success, for example, I can automatically log in to my yahoo mailbox. But I find many sites are using some kind of image verification mechanism, which is possibly called CAPTCHA. I can do nothing to them. But one of the sites I'm trying to auto access is using a plain-text verification code. It is comnposed of four digits, selectable and copyable. But they're not in the source file which can be fetched using
$mech->content;
I searched for the keyword that appears on the webpage but not in the source file through all the files in the Temporary Internet Files but still can't find it.
Any idea what's going on? I was suspecting that the verification code was somehow hidden in some cookie file but I can't seem to find it :(
The following is the code that completes all the fields requirements except for the verification code:
use warnings;
use Win32::IE::Mechanize;
my $url = "http://www.zjsmap.com/smap/smap_login.jsp";
my $eccode = "myeccode";
my $username = "myaccountname";
my $password = "mypassword";
my $verify = "I can't figure out how to let the script get the code yet"
my $mech = Win32::IE::Mechanize->new(visible=>1);
$mech->get($url);
sleep(1); #avoids undefined value error
$mech->form_name("BaseForm");
$mech->field(ECCODE => $eccode);
$mech->field(MEMBERACCOUNT => $username);
$mech->field(PASSWORD => $password);
$mech->field(verify => $verify);
$mech->click();
Like always any suggestions/comments would be greatly appreciated :)
UPDATE
I've figured out a not-so-smart way to solve this problem. Please comment on my own asnwer posted below. Thanks like always :)
This is the reason why they are there. To stop program like yours to do automated stuff ;-)
A CAPTCHA or Captcha is a type of
challenge-response test used in
computing to ensure that the response
is not generated by a computer.
This appears to be an irrelevant number. The page uses it in 3 places: generating it; displaying it on the form next to the input field for it; and checking for the input value being equal to the random number chosen. That is, it is a client-only check. Still, if you disable javascript it looks like, I'm guessing, important cookies don't get set. If you can execute JavaScript in the context of the page (you should be able to with a get method call and a javascript URI), you could change the value of random_number to f.e. 42 and fill that in on the form.
The code is inserted by JavaScript – disable JS, reload the page and see it disappear. You have to hunt through the JS code to get an idea where it comes from and how to replicate it.
Thanks to james2vegas, zoul and Shoban.
I've finally figured out on my own a not-so-smart but at-least-workable way to solve the problem I described here. I'd like to share it here. I think the approach suggested by #james2vegas is probably much better...but anyway I'm learning along the way.
My approach is this:
Although the verification code is not in the source file but since it is still selectable and copyable, I can let my script copy everything in the login page and then extract the verification code.
To do this, I use the sendkeys functions in the Win32::Guitest module to do "Select All" and "Copy" to the login page.
Then I use Win32:Clipboard to get the clipboard content and then Regexp to extract the code. Something like this:
$verify = Win32::Clipboard::GetText();
$verify =~ s/.* (\d{4}).*/$1/msg;
A few thoughts:
The random number is generated by something like this in Perl
my $random_number = int(rand(8999)) + 1000; #var random_number = rand(1000,10000);
And then it checks if $verify == $random_number. I don't know how to catch the value of one-session-only $random_number. I think it is stored somewhere in the memory. If I can capture the value directly then I wouldn't have gone to so much trouble of using this and that extra module.