Web browser not pulling up after "pressing any key" to login to heroku - heroku

I'm using Git Bash to login to heroku. I'm at the part where I press any key to open the web browser so I can login. I've logged in via the command prompt and it opened the browser just fine. I've tried the heroku login -i method but when I enter my email address it doesn't do anything (just like pressing any key after prompted to do so). I added System32 to my PATH environment variable and have logged in via the command prompt, both of which seem to be the common solutions I can find.
If it helps, I'm trying to push a Python script I've written. I followed Codemy for creating the virtual environment, procfile, requirements.txt, etc. I've used git to add and commit everything, but I get stuck when asked to login. I've successfully logged in via the command prompt.

I tried it right now and it worked as expected. There were the steps:
Download installer https://devcenter.heroku.com/articles/heroku-cli
Install it
Open the cmd and enter: heroku login
It printed this
then a new tab in my default browser was opened
I entered my credentials with success. It showed the following message:
I closed the browser tab and finally I returned to the cmd:
After these steps, you could use any other git tool to perform git operations. Heroku login is just to store a kind of long live token in some part of the o.s.

Related

Heroku cannot open browser to log in

I tried to log into Heroku via my command prompt by typing heroku login but this happened:
It says it cannot open my browser to log in. How should I proceed?
This just means that the Heroku CLI is having trouble opening the URL shown in your terminal for you.
Copy that URL and paste it into a browser of your choice, then log in.

Heroku CLI authentication issue

After a fresh install of Heroku on Windows 7, I can't seem to authenticate from the command-line.
Running the command: heroku login prompts me to enter my credentials. After doing so, I received an error:
heroku: Enter your login credentials
Email: my_email
Password: ************
Error: ENOENT: no such file or directory, open 'z:/_netrc'
I am using PowerShell, and when I run the command cat z:/_netrc, I get this error:
cat : Cannot find drive. A drive with the name 'z' does not exist.
Z: is a network drive, and it is accessible from the file explorer.
I already have a .netrc file in my %HOME% path, but it does not contain the heroku login credentials.
Looking at the official documentation and CLI help, I couldn't find anything useful to fix this. How can I login to my heroku account?
> heroku version
heroku/7.16.6 win32-x64 node-v10.11.0
So, the issue is arising from not finding _netrc file on your local computer that is required to complete login with Heroku. I have decided to create the file into following location of my windows 10 computer:
cmd>set HomeDrive=C:/Users/your Windows username/AppData/Local/heroku
In my case,
cmd>set HomeDrive=C:/Users/CrazyMoby/AppData/Local/heroku
Finally I ran heroku login
The above step resolved heroku login issue in my case.
Use setx HOME <netrc_default_location>
where <netrc_default_location> can be:
<%NETRC%>\_netrc
<%HOME%>\_netrc
<%HOMEDRIVE%%HOMEPATH%>\_netrc
<%USERPROFILE%>\_netrc
Some clarification can be found here and here.
Probably it's your user <%USERPROFILE%>.
But if you don't need it, just remove _netrc file, reboot and log in again.
Run the following command in powershell and the problem should be solved.
$Env:HOMEDRIVE = "C:"
If you need more information, check out the docs on windows environment variables.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7
This way work for me. Write in PowerShell next code , where "paulob" need change to your user, because folser "_netrc" exist in:
$Env:HOMEDRIVE = "C:\Users\paulob\"
Try running it from GIT BASH cmd instead of PowerShell if you can, I had the same problem and it worked in my case.

Can't log in to Github for Mac client after changing my computer's name

I changed my computer's name, and now I cannot log into the Github for Mac client. When I try to log in through the "preferences" section in Github for Mac, I get a "Login or password is incorrect" message. I am certain that they are in fact, correct.
I figured this had something to do with my SSH key being tied to my computer name, so I generated a new SSH key.
After changing my SSH key, and adding it through github.com, I ran:
ssh -T git#github.com
I get the success message:
Hi alexweissman! You've successfully authenticated, but GitHub does not provide shell access.
I also did
git config --global user.email <my-email-address>
Which seemed to work without any complaint.
Strangely, when I attempt to sync a commit, and it prompts me for my username and password, it accepts it without any complaint. I suspect that Github for Mac has cached my old SSH key somewhere and is somehow trying to use that in conjunction with the "remember me" feature.
I am running OSX 10.8.5.
Try this:
Go to https://github.com/settings/applications and revoke the access to GitHub For Mac. Then try the login

Pycharm GitHub 'Push failed: fatal: Authentication failed'

Every time I try to push a repository in GitHub with Pycharm the it fails.
Push failed: fatal: Authentication failed for 'https://github.com/(my github repository)/'
In Settings->Version Control->GitHub, I filled the fields Host, Loging and Password (Auth Type: Password). Testing it: "Connection successful"
In Settings->Version Control->Git, Path to Git executable is seted with the full path, SSH executable: Buil-in
Pycharm version 3.1.1
Git version 1.8.4.msysgit.0
On Win 7.
I tried all but it worked me charm :
The problem I had : Every thing was working from terminal and from Github desktop as well.
But when I tried to PUSH/PULL from pycharm it wasn't working.
Reason : It happens because by-default pycharm save password locally in DB.
Work around: Go to File > Settings > Appearance & Behavior > System Settings> Passwords, clicked on 'Do not save..", restarted IntelliJ and VCS asked for password again.
It seems there is some issue (if using https) if username or password contains "some" special characters.
So, I've generated a secondary password ("personal access token") in GitHub's application settings page (using the "Create new token" button), I did copy this token. Then I've selected Auth Type: Token in Settings->Version Control->GitHub, and pasted the token.
Testing it: Connection successful for user . Now the git push works perfectly.
I struggled with this problem for half a day using Git in PyCharm.
Solution: Settings => Version Control => Git => ticked "Use credential helper" and then it worked perfect.
If your username or password has special characters, you can replace it with the Percent-encoding for theses characters.
for example, if your password is "test#2010", you will write it as "test%402010" and the config command will be like this
git config remote.origin.url https://{username}:test%402010#github.com/{repo_username}/{repo_name}.git
So I found the solution to my problem, and I hope this helps:
If you are using KDE, or Gnome, your "KDE Wallet", or "Gnome Keyring" manager will save your password when you push for the first time. However, if you enter the password wrong, these managers (ksshaskpass for KDE) will store the wrong password and will send the wrong password every time.
To fix this, open the appropriate manager and change the password. With KDE, it is in: Kick-off-menu > System Settings > Account Details > KDE Wallet, then click "Launch Wallet Manager", and find "ksshaskpass", expand it, and then expand "Passwords", then find your github registered email address there, click it, and on the right, click on "Show Contents". Now change that value (in case wrong password), then hit save. and you're done!
Now that means you don't have to type in your password each time for https push, and you don't have to use SSH keys either ;)
I came across this once. Turned out that the Web Credentials in the Credentials Manager stored an incorrect password for github.com and gitlab.com.
I removed that and it gave me the option to log in when I added a new repository.
Ok guys, I tried all suggested solutions and they did not worked for me.
I use git bash and bitbucket.
Finally I turned it upsidedown, and it worked - at least that way. I know this is difficult and foolish solution, but it worked.
So the steps:
you have your code on your local machine.
you have your repo /on bitbucket/
Delete your repo or make a new one with new name
Make a readme.md with the help of the /bitbucket's/ dashbord
clone the new repo
copy your files into this new folder which you want to push
do the git bash work (add,commit) and push it to the repo.
In PyCharm go to:
Settings > Version Control > Github > +
add credentials
AND:
Check your open browsers, when logging in from pycharm into GitHub a tab is opened to authorize Jetbrains the access to your Github account.
I am using High Sierra on an old iMac and originally tried to push a new local project to a new remote.
Unable to get authentication working on Terminal I then tried to use PyCharm as a vehicle to save the authentication token from Github.
In the past I was accustomed to the IDE prompting for the use of a token and even suggesting me to open Github.com to generate the appropriate one.
PyCharm was not able to push a new branch but it did not give any such hints for a solution in the error message
12:56 Push failed
git#github.com: Permission denied (publickey).
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Show details in console
My solution was to go into the settings and there I found the connection to Github unset - and I was able to link a token.
But I also had to set the remote with the HTTPS link. When I tried with the SSH URI it did not work.

Automating deployment of PHP source from Mercurial Repos to Apache server in CentOS using .sh file

I have a basic deployment procedure in place and I want to automate it. I need help with creating an sh file that I can call which will take care of all the steps.
Notes about my setup:
root does not have FTP access.
Another user 'senthil' has FTP access to its own folder only /home/senthil
Deployment procedure
After I checkin code to bitbucket.org...
Open putty, login as senthil (type username + password).
navigate to repo clone folder /home/senthil/repos/mysite.
Do hg pull.
Type password when requested.
Do hg update.
logout of senthil (putty is closed!).
Open putty, login as root (type username + password).
navigate to repo clone folder /home/senthil/repos/mysite.
type hg archive /path/to/website/root.
run a chmod command so that apache user has appropriate access
When I tried to make one sh file that will take care of this, I couldn't. I could just make 2 or 3 steps and then I would encounter problems like this:
How to enter a password at a prompt through sh for hg pull
How to logout and login as another user in putty
How can I automate the whole process in one sh file, that I can run?
You can use single session (I can't see any FTP in process, only local FS)
You have to login on host with Plink, which can perform non-interactive logins and run command on server-side after login (command will be tour shell-script with all deploy tasks): plink HOST COMMAND
In order to avoid password-prompt on pull (but fetch will be better, one command instead of pull+update) you can read about [auth] section in .hgrc (global or repo-specific)
You should make use of ssh for connecting to machines without password.
Google for "ssh for beginners" or checkout this link to learn to do it.
http://inside.mines.edu/~gmurray/HowTo/sshNotes.html
To answer your second question, for logging out a user, just type the command exit in the command prompt and it should work.

Resources