bulkupload without username/password prompt - google-app-engine

I have a process which generates daily some data, which I would like to update to a java app running on the appengine using bulkupload, using the command:
appcfg.py upload_data
--url=http://your_app_id.appspot.com/_ah/remote_api --kind= --filename=
It works perfectly, but it always asks me for my username/password.
Is there any way to save the credentials, use certificates, to avoid the username prompt?

Add these options:
--email=
--passin
and at the end : < "your password file.txt"

Seems this technique no longer works with SDK 1.9.17. The updated docs include some new oauth2 command line options, but the instructions are rather confusing. Anyone able to use either the old passin or the new oauth2 techniques? How?

Related

How to create core in solr 7 when using Basic Authentication

I'm using basic authentication in my solr project. I want to create new core but it gives me this error.
ERROR: Solr requires authentication for http://localhost:8983/solr/admin/info/system. Please supply valid credentials. HTTP code=401
I'm creating the core like this
solr create -c StorageCore -credentials solr:SolrRocks
How can I fix this problem?
UPDATE
That command argument is only supported when enabling authentication through the command line tool.
For using the control script with basic auth:
Using the Solr Control Script with Basic Auth
Add the following line
to the solr.in.sh or solr.in.cmd file. This example tells the bin/solr
command line to to use "basic" as the type of authentication, and to
pass credentials with the user-name "solr" and password "SolrRocks":
SOLR_AUTH_TYPE="basic"
SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"

Create Solr core in console with authentication

I have a Solr core that needs an authentication. Let's say I have a user with password password.
When I now try to create a Solr core in the console with
bin\solr create -c test
I get an HTTP Error 401.
Of course I need to specify my user. How can I add my user and password in the console?
Something like bin\solr create -c test -authentication user:password
Using Command Line scripts with BasicAuth
Add the following line to the (/opt/solr/bin) solr.in.sh or solr.in.cmd file. This example tells the bin/solr command line to to use "basic" as the type of authentication, and to pass credentials with the user-name "solr" and password "SolrRocks":
SOLR_AUTH_TYPE="basic"
SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"
look:
https://lucene.apache.org/solr/guide/6_6/basic-authentication-plugin.html#BasicAuthenticationPlugin-UsingBasicAuthwithSolrJ
If you use Basic Authentication than first set in the CMD Console:
set SOLR_AUTH_TYPE=basic
set SOLR_AUTHENTICATION_OPTS="-Dbasicauth=USER:PASS"
Customize USER:PASS for your need
It has been a while so, I am not sure if you still have this issue. But this can help others who may come across this like how I did.
I am new to solr, so there could be a better way of doing this than what I have here.
Are you using zookeeper for authentication?
Assuming you are using zookeeper for authentication
First of all, I checked and I don't think there is an -authentication parameter for solr create command.
So, this is how I hacked around this issue:
Stopped solr
Started solr without zookeeper
created the core like how you tried for the test core
Then uploaded configuration of the test core to zookeeper. I followed this document - https://systemsarchitect.net/2013/04/06/painless-guide-to-solr-cloud-configuration/
Restarted zookeeper server
Started solr with -p 8983 -z zookeeper_hostname:zookeeper_port
You should be able to access your test core with authentication enabled

ClientLoginException from appcfg.sh

I am attempting to upload a new version of a Google App Engine Application with appcfg.sh
upload but get the following exception:
com.google.appengine.tools.admin.ClientLoginServerConnection$ClientLoginException:
Email "...#gmail.com" and password do not match.
When prompted, I use the same Email address (...#gmail.com) and password that works just fine for logging into Google Developers Console e.g. using Safari.
Could this be a problem with my terminal settings? (I am using OS X Yosemite. If I type the password on the command line it appears as expected.)
I'd recommend the "password-less login with oauth2" explained at https://cloud.google.com/appengine/docs/python/tools/uploadinganapp#Python_Password-less_login_with_OAuth2 .
Just run appcfg.py --oauth2 with whatever command you require, and you'll be asked, once, to authorize your Google userid in your browser; then, the credentials are stored in file .appcfg_oauth2_tokens, and used thereafter. The page above goes into details about how to control the authorization process more finely, but, for me, the simple approach I'm summarizing here has been quite satisfactory.

login to remote using "mstsc /admin" with password

I want to use mstsc /admin to login to a server silently. My batch file reads the code as
mstsc /v:xxx.xxx.xxx.xxx /admin
But it ask me to enter password. Can anyone help me to skip this step?
I went on to Google and found this site. But I am very new to this stuff (scripting) and could not understand what to do with given code. Is it a vbscript file? Can I do the same thing with a batch file. Please elaborate and I request you to spoon feed. This is not my arena but still I am pushed to fight without weapons.
My basic need is to kick off all users from a remote desktop except mine to perform some maintainable work. Thanks.
Re-posted as an answer:
Found an alternative (Tested in Win8):
cmdkey /generic:"<server>" /user:"<user>" /pass:"<pass>"
Run that and if you run:
mstsc /v:<server>
You should not get an authentication prompt.
the command posted by Milad and Sandy did not work for me with mstsc. i had to add TERMSRV to the /generic switch. i found this information here: https://gist.github.com/jdforsythe/48a022ee22c8ec912b7e
cmdkey /generic:TERMSRV/<server> /user:<username> /pass:<password>
i could then use mstsc /v:<server> without getting prompted for the login.
to be secured, you should execute 3 commands :
cmdkey /generic:"server-address" /user:"username" /pass:"password"
mstsc /v:server-address
cmdkey /delete:server-address
first command to save the credential
second command to open remote desktop
and the third command to delete the credential for security reason
all of these commands can be saved in a batch file(bat).
(if you save these command in a batch file, third command will not be executed until you close the remote desk)
Same problem but #Angelo answer didn't work for me, because I'm using same server with different credentials. I used the approach below and tested it on Windows 10.
cmdkey /add:server01 /user:<username> /pass:<password>
Then used mstsc /v:server01 to connect to the server.
The point is to use names instead of ip addresses to avoid conflict between credentials. If you don't have a DNS server locally accessible try c:\windows\system32\drivers\etc\hosts file.
It became a popular question and I got a notification. I am sorry, I forgot to answer before which I should have done. I solved it long back.
net use \\10.100.110.120\C$ MyPassword /user:domain\username /persistent:Yes
Run it in a batch file and you should get what you are looking for.
Save your username, password and sever name in an RDP file and run the RDP file from your script
The Command mentioned above didn't work for me (Windows 11)
cmdkey /generic:"server-address" /user:"username" /pass:"password"
When i listed the cmdkeys using the commad:
cmdkey /list
I saw, that a legacy target was added. Adding a specific TERMSRV-Target worked for me:
cmdkey /add:Domain:target=TERMSRV/<SERVER> /user:<DOMAIN>\<USER> /pass:<PASSWORD>

google app engine python uploading application first time

i'm trying to upload my app engine project for the very first time and i have no clue why it is not working. the error from my terminal is:
[me][~/Desktop]$ appcfg.py update ProjectDir/
Application: tacticalagentz; version: 1
Host: appengine.google.com
Starting update of app: tacticalagentz, version: 1
Scanning files on local disk.
Error 404: --- begin server output ---
This application does not exist (app_id=u'tacticalagentz').
--- end server output ---
i'm using python 2.6.5 and ubuntu 10.04.
not sure if this is relevant, but i just created a google app engine account today. and i also just created the application today (like a couple of hours ago). this is really frustrating because i just want to upload what i have so far (as a demo). in my app.yaml this is my first line:
application: tacticalagentz
Furthermore, i checked on my admin console, and i CLEARLY see the app id right there, and it matches letter for letter with the app id in my app.yaml
could someone please enlighten me and tell me what i am doing wrong? or is it something beyond my comprehension (like indexing issue with Google that they need time to index my app id) ?
thank you very much in advance
apparently adding the "--no_cookies" parameter will work
appcfg.py update --no_cookies ProjectDir/
the way i was able to find my answer was by uploading my app from my Mac OS X (thank god i have linux mac and windows). AppEngine on Mac OS X comes with a GUI interface, and it worked for uploading. so then i found the command they used in the console, which included "--no_cookies". perhaps if you run into similar issues in the future, this is one approach to getting the answer
App Engine for Java have the same problem. The problem is about account login.
If you are using Eclipse, use Sign In button.
If u are using command-line, use "-e" option, like this:
appcfg.sh -e your#email.com update yoursite/
I had the same problem. When I changed the name of the app I used in the launcher to match the one in the app engine, It worked without any problem. The way I figured out, it was the name mismatch which caused the problem. You can see the name of your registered app in the admin console of app engine.(https://appengine.google.com/)
Here's what fixed it for me:
i had an instance of dev_appserver.py myProjDirectory/ on a different terminal.
i guess the scripts are somehow linked and aren't thread safe
An alternate option that worked for me is to just "Clear Deployment Credential" from the Control option of the GUI. When the app was deployed after this, it opened a google page to allow GAE to access the user profile and then deployment was successful.
The key bit is
This application does not exist (app_id=u'tacticalagentz').
which is telling you that appspot.com doesn't know of an application by that name. The admin console (https://appengine.google.com/) shows your applications. Check there. You might have made an inadvertent typo when you registered the app.

Resources