Trouble Generating MD5 Fingerprint for Google Maps API key - md5

I have a problem. When I open command prompt this is already entered C:\Documents and Settings\Chris>
In my Java program file, there are 3 java folders, i.e jdk1.6.0_13, jdk1.6.0_18 and jdk1.6.0_23...I figured the last two must be updates. this is what I entered on the Command Prompt.
C:\Program Files\Java\jdk1.6.0_13\bin>keytool.exe -list -alias androiddebugkey -keystore "C:\Documents and Settings\Chris.android\debug.keystore" -storepass android -keypass android
After hitting 'Enter', the awful message that says "....is not recognized an internal or external command, operable program or batch file' appeared. What did I do wrong?

Use this command to get your MD5 fingerprint.
C:\Program Files\Java\jdk1.6.0_16\bin>keytool -list -alias androiddebugkey
-keystore "Your debug key location" -storepass android -keypass android
You can also get a full tutorial at http://www.androidcookers.co.cc/2011/12/show-google-map-on-your-android-app.html

Related

keytool: command not found

I'm trying to generate an application to put in the play store when I do this command:
Keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
This message is appearing keytool: command not found
Has anyone had this problem?
Change directory to C:\Program Files\Java\jdk1.8.0_66\bin and then run your keytool command.
Or
Set the PATH variable permanently (Windows)
Click Start, then Control Panel, then System.
Click Advanced, then Environment Variables.
Add the location of the bin folder of the JDK installation for the
PATH variable in System Variables. The following is a typical value
for the PATH variable:
C:\Program Files\Java\jdk1.8.0_66\bin

Error using PSEXEC to start a file on a remote computer

I have created a small script that initiates PSEXEC to run a file (a registry key) on a remote computer that is in the domain; however, when I run the script I receive an error indicating that "the system cannot find the file specified."
Below is my script:
#echo off
psexec \\PRECDP19425 -u PRECDP19425\WAKE -p <password> -h -i -d C:\Users\WAKE\Documents\AllowNetwork.reg
pause
I have double-checked the location to make sure I wasn't losing my mind and typed something incorrectly, yet that doesn't seem to be the case. The path is correct, I'm just not sure what is causing the script to fail.
The exact error I receive is:
PsExec could not start C:\Users\etc on PRECDP19425
The system cannot find the file specified.
Any help would be much appreciated.
C:\Users\WAKE\Documents\AllowNetwork.reg is not a valid command line because a .reg file is not an executable, you need to pass it to reg.exe:
REG IMPORT C:\Users\WAKE\Documents\AllowNetwork.reg

Not able to start solr in windows

I have downloaded solr 6.4.0 version and tried starting using solr start from bin directory I end up with following error:
C:\solr-6.4.0\bin>solr start
'findstr' is not recognized as an internal or external command,
operable program or batch file.
C:\solr-6.4.0\bin>
Could you please advise me is there any configuration that i need to do/ how to start?
Thanks.
The program findstr.exe can be found in C:\Windows\system32.
Check if you can find it there.
If it is available, modify your "path" environment variable to include the path "C:\Windows\system32\".
If you have an open command prompt window, exit and re-open it, and check that the %PATH% variable contains the newly added path.
echo %PATH%
Now "findstr.exe" should be available for Solr scripts.
Download solr + copy downloaded folder to c: drive (solr7.2.1)
Download nssm installer + copy downloaded folder to c: drive (solr)
open nssm installer in cmd:
>> cd C:\solr\nssm2.24\win64
>> nssm install solr7
GUI service Installer opens (Enter solr path details)
- C:\solr-7.2.1\bin\solr.cmd
- C:\solr-7.2.1\bin
Install (solr as service gets installed)
Set Environment Variable -> System Variables (JRE Path):
JAVA_HOME: c:\ProgramFiles\java\jre1.8.0_212
Check if solr is running (from services)
Open Solr:
https://localhost:8983/solr/#/
Actually findstr.exe is missing.
So follow these steps:
1.go to C:\Windows\system32\ and copy findstr.exe file.
2. paste this file into the location C:\Program Files\Java\jdk{version}\bin
Then run the this command:
solr.cmd start
Hope this helps.

Add password to keytool command

I've made a .bat file to get the SHA1 of my Android app so I don't need to type the command each time
keytool -list -v -keystore "Path/To/My/Key.jks"
When I run the bat file I get asked for the password. Is it possible to either put the password in the command e.g. something like --password MyPassword, or in the .bat file wait for the Enter your password line, and then send the password? I don't have any experience really with .bat files so I don't know if that's possible to do or not.
I looked at the --help for keytool and the only password flags I could see were for changing the password, not specifying it.
The keytool that ships with the Oracle JDK allows you to specify it on the command line with -storepass, you were doing keytool -help instead of keytool -list -help. (I suppose the Android version is the same.)
C:\>keytool.exe -list -help
keytool -list [OPTION]...
Lists entries in a keystore
Options:
-rfc output in RFC style
-alias <alias> alias name of the entry to process
-keystore <keystore> keystore name
-storepass <arg> keystore password
-storetype <storetype> keystore type
-providername <providername> provider name
-providerclass <providerclass> provider class name
-providerarg <arg> provider argument
-providerpath <pathlist> provider classpath
-v verbose output
-protected password through protected mechanism
Use "keytool -help" for all available commands
Specify the keystore password using the -storepass option:
keytool <commands and options> -storepass changeit
changeit being the default keystore password, but use whatever.
For example, to add a certificate using the default password:
keytool -importcert -trustcacerts -alias mycert -file mycert.cer -keystore .../lib/security/cacerts -storepass changeit
As #sastorsl said, if you are worried about putting your password in clear text in your command or script (and you should), you should put your password in a secure file (with 0400 permissions, in Linux) or in an environment variable.
Now keytool does have a similar construct to openssl's file:<filename>, if your password is in a file:
keytool <commands and options> -storepass:file <pass_file>
If your password is in an environment variable:
keytool <commands and options> -storepass:env <pass_var>
Disclaimer: I have tested the -storepass:file option in Bash (not in Windows), but the documentation does not seem to have any difference according to the OS.
From the Oracle keytool doc:
-storepass [:env | :file ] argument
The password that is used to protect the integrity of the keystore.
If the modifier env or file isn’t specified, then the password has the value argument, which must contain at least six characters. Otherwise, the password is retrieved as follows:
env: Retrieve the password from the environment variable named argument.
file: Retrieve the password from the file named argument.
Note: All other options that require passwords, such as -keypass, -srckeypass, -destkeypass, -srcstorepass, and -deststorepass, accept the env and file modifiers. Remember to separate the password option and the modifier with a colon (:).
If you are worried about storing your password in a script, and for it to turn up in your command line history - which you should be, store the password in a separate file instead, secure it, and reference it.
NB! This is Linux / bash specific, and OP seems to be on windows, but I hope this can help somebody else.
keytool -list -v -keystore "Path/To/My/Key.jks" -storepass $(cat < <(cat bin/.pw))
If only keytool would have the file:<filename> construct which the openssl client has.

Encountering erros when trying to automate PSFTP command using a .bat file

In looking at other posts, "Batch file for PuTTY/PSFTP file transfer automation", regarding automating the PSFTP command in a .bat file so that I can setup a Windows Scheduled Task, I tried the following but got the error below:
In the .bat file that I'm executing I have the following lines:
#echo off
cd "c:\PuTTY"
psftp 999.99.999.999 -l XXXXXIO -i testGSX.ppk -b DownloadDiscoverReports.txt
In the DownloadDiscoverReports.txt file I have the following lines:
lcd c:\Reports\GSXDLFILES\ALLRPTS
cd /DSCVROUT/ALLRPTS/
mget *ALLRPTS%POLLABLE*
lcd c:\Reports\GSXDLFILES\XMIT81
cd /DSCVROUT/XMIT81/
mget *XMIT81%POLLABLE*
The error I'm getting when I execute the .bat file from my C:\ is:
C:\>gsx_dl.bat
psftp: no hostname specified; use "open host.name" to connect
New local directory is c:\Reports\GSXDLFILES\ALLRPTS
psftp: not connected to a host; use "open host.name"
C:\PuTTY>
Any suggestions/direction on how to fix this issue would be appreciated. Thank you.
This issue has been resolved. PuTTY support responded to my issue and I entered a -v switch to my command and found that my KEY had expired and that was the issue.
Thanks anyway.

Resources