How do I remove the restriction of 'Permission denied', when using the 'mkdir' command in Git Bash? - command-line

When inputting 'mkdir Thinkful' to the command-line, I get the following message:
mkdir: cannot create directory ‘Thinkful’: Permission denied
I recently downloaded git version 2.37.3.windows.1 and I am using Windows 10. I have Developer Mode 'ON' in my settings, as well as, all of the default options chosen for Git Bash upon install. I have looked through other similar problems on stackoverflow, but have not found a solution to my problem.
Help is greatly appreciated.

Your user need to have write permission on the current directory.
You can find more on linux administration here for example:
https://www.youtube.com/c/tutoriaLinux?app=desktop

Related

How does folks currently handle giving Emacs permissions to the ~/Downloads directory on osx Monterey 12.3

Currently I get this error
(file-error \"File cannot be opened\" \"Operation not permitted\" \"/Users/foo/Downloads\")")
In other answers I've seen we give ruby all the permissions as described here https://apple.stackexchange.com/questions/371888/restore-access-to-file-system-for-emacs-on-macos-catalina/371945#371945
but is this still the case? Is there an alternative? I am on Emacs 27.2
Since it's hard to control the app permissions for a specific directory on macOS (you can't add it in settings, and it only prompts on first access or something I'm not sure about), I recommend enabling Full Disk Access permissions for Emacs.
Another option to try is to reset the app Privacy and then confirm it the next time you are prompted (to access files in the Downloads folder).
# codesign --force --deep --sign - /Applications/Emacs.app
sudo tccutil reset All org.gnu.Emacs
Sounds like emacsformacos.
That is using a wrapper in ruby to decide which binary to run.
As nobody wants to give ruby full control I compiled it myself for some time.
With 28.1 I switched to
port install emacs-mac-app

Unable to add filesystem permission denied

Using node v 8.9.0 and this tutorial
When I try and debug my http google cloud function in dev tools:
C:_Users_Matt_AppData_Roaming_nvm_v8.9.0_node_modules_#google-cloud_functions-emulator_src_supervis
I get filesystem permission denied error, how can I debug my cloud functions:
I also got the filesystem permission denied error, and the issue was that you need to accept the premissions from chrome to be able to access that filesystem. initially I didn't see the premissions prompt, but then I found it on a different tab (which was kinda weird behavior). I guess just look for that permissions prompt, it should be right below your address bar.
I see that you are referring to a C directory, which means that you are trying this on Windows OS. I will put the steps below with documentation links on how to properly setup the configuration. Those steps worked for me well without giving me any issues, so I suggest you to follow them one by one and see if that helps you.
Run Google Cloud Functions Emulator on Windows OS:
Install and set up Google Cloud SDK for Windows. Link and documentation here
Install Node.js and npm for Windows. Tutorial here
Right click on Google Cloud SDK Shell and select Run as administrator.
Execute $ node --version you should get the version of Node.js without any additional errors
Execute $ npm --version you should get the version of npm without any additional errors
The tutorial that you are referring to is part of Google Cloud Functions Tutorial Series
First install and set up npm functions emulator by running $ npm install -g #google-cloud/functions-emulator as mentioned in Google Cloud Functions Tutorial : Setting up a Local Development Environment
Setup the project for the functions $ functions config set projectId PROJECT_ID as mentioned in Start and Stop the Emulator documentation.
Start the emulator by executing $ functions start. Same documentation as above.
Download the source code as mentioned in the documentation you are referring to. The GitHub repository is here.
Clone the project locally. $ git clone https://github.com/rominirani/googlecloudfunctions-training.git
Navigate to the folder $ cd googlecloudfunctions-training/helloworld-http
Follow the rest of the Google Cloud Functions Tutorial : Debugging Local Functions documentation.
NOTE: Whenever you run / execute / call the Cloud Function the Node.js
blank window will pop up. Keep it open as it is the executable that
executes your code.
I have tested the tutorial with the above set up that I described and it worked for me. You have to be the administrator of your account, since the Functions Emulator and the code is running locally, so you have to have all the permissions of the directories that are going to be used and execute all the software as administrator.

Linking postgresql in homebrew

I already installed postgresql, but it says I did not link to it.
I am running this in the command line and getting the following error:
myname#MacBook-Pro-8 ~> brew install postgresql
Warning: postgresql 10.4 is already installed, it's just not linked
You can use `brew link postgresql` to link this version.
myname#MacBook-Pro-8 ~> brew link postgresql
Linking /usr/local/Cellar/postgresql/10.4...
Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.
myname#MacBook-Pro-8 ~> sudo brew link postgresql
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
I also tried:
brew prune; brew link postgresql
which gave me the same error:
Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.
Why is that folder not writable and what can I do to change that?
It was really painful solving this problem, so I figured I would leave it here for others to see.
Issue:
Homebrew install of Postgresql will not execute successfully. $ brew link postgresql results in failure due to directory not writable. New version of Homebrew will not allow sudo commands and System Integrity Protection prevents changing permissions.
Details:
I tried to use homebrew to install postgres and kept running into issues with syslink. When I ran $ brew link postgresql as homebrew suggested, I kept running into an error that it couldn't be completed because certain folders were not writable. I thought this would be easily remedied by running sudo but unfortunately the most current version of homebrew no longer allows the use of sudo commands due to security risks. My next thought was to my root user and use the macOS GUI interface to change the permissions on this folder because I am not sure how to do this on the terminal. Regardless of being logged in as 'root,' the OS would not let me change the permissions of the folder. I also attempted to use sudo and change the permissions in terminal and it did not work either. After several days of banging my head against the wall try all kinds of things to find a solution, I discovered that since El Capitan, macOS introduced System Integrity Protection aka 'SIP' or 'rootless.' As it turned out, once I disabled SIP, logged back into 'root' and changed my regular accounts permissions to Read/Write on the problem directories, I was able to go back to my regular account and successfully execute $ brew install postgresql.
(Assuming you currently have postgresql installed through homebrew but unable to link due a scenario like the one mentioned above, here is what I suggest to resolve your issue...)
Run $ brew link postgresql
Write down the directory path that the error says it is not able to write to. (e.g. usr/local/share/man/man7) NOTE: you'll want to actually write this down on paper or take a picture of the screen on your phone because you will not be able to use copy and paste)
Enable your 'root' user account if you have not already done so.
(instructions here) NOTE: make sure to make a really good password for this account and write it down somewhere safe. This is a powerful account and there's no way to recover the password.
Disable System Integrity Protection.
(instructions here)
Log into 'root' user account
In Finder menu bar select GO > GO TO FOLDER... (CMND + SHFT + G) and type in the path from Step 2.
Right-Click/ Cntrl-Click the folder and select Get Info
Click the plus sign at the bottom of Sharing & Permissions
Add your regular account to the list and change the permission to Read & Write
Go back to your regular account, run $ brew uninstall postgresql, then $ brew update and $ brew doctor . If those are all set run $ brew install postgresql.
You should be able to install without any problems now. However, if you run into a linking and permissions problem again, run $ brew link postgresql to figure out the problematic directory and repeat Steps 5 - 10 with whatever other directories are giving you trouble.
If everything is up and running properly. It is probably best to at least enable SIP again (instruction in the article linked in Step 4).
(To check that everything is working. I recommend running $ brew services start postgresql then $ createdb 'test' . In my case, it was when I originally tried to run createdb and got "command not found" that I realized something was wrong.)
Running this solves it. This gets around SIP.
sudo chown -R $(whoami) $(brew --prefix)/*
brew link postgresql

pgadmin4 : postgresql application server could not be contacted.

I have installed PostgreSQL 9.6.2 on my Windows 8.1. But the pgadmin4 is not able to contact the local server. I have tried several solutions suggested here in stackoverflow, tried to uninstall and reinstall PostgreSQL 9.6.2 , tried to modify the config.py, config_distro.py, and delete the files in Roaming folder,i tried standalone pgadmin4 installation, but no success.However, in my local machine i am able to access the server using psql.exe and log as as superuser (postgres user). Can you please suggest any possible solutions to starting/running pgadmin4 ? Thank you.
I found the same issue when upgrading to pgAdmin 4 (v1.6). On Windows I found that clearing out the content inside C:\Users\%USERNAME%\AppData\Roaming\pgAdmin\sessions folder fixed the issue for me. I believe it was attempting to use the sessions from the prior version and was failing. I know the question was marked as answered, but downgrading may not always be an option.
Note: AppData\Roaming\pgAdmin is a hidden folder.
Start pgAdmin 4 as administrator.
Do the following steps:
Right click pgAdmin 4 icon
Select "Run As Administrator"
I had the same issue on Windows 10, with a new installation of PostgreSQL 10.
I solved it by including the path C:\PostgreSQL\10\bin ({your path to postgresql}\bin) to system environment variables.
To access environment variables: Control Panel > System and security > System or right click on PC, then > Advance system settings > Environment variables > System variables > Path > Edit.
I've been dealing with this for awhile (frustrating). So much that I have instructions on my desktop consolidating all of these ideas. Here is my magic combination to the solution:
Delete from App Data C:\Users\%USERNAME%\AppData\Roaming\pgAdmin
Add to Path Variables C:\Program Files\PostgreSQL\9.6\bin (I actually added it to both user and system)
Right click and start as admin.
You don't have to do this every time but when it gets out of wack try these steps.
What finally worked was downgrading to pgadminIII-v.1.22:
It seems in most of the cases Postgres trying to use information from previous sessions to find/connect the server and failing. Clearing out the previous session info helped me, it is a combination of 2 already mentioned answers above:
Navigate to Postgres session's folder
C:\Users\YourUsernameOrAdmin\AppData\Roaming\pgAdmin\sessions
Delete all the data from this folder.
Start PgAdmin in administrator mode.
Cheers!
if you are using Mac OS X here is a fix:
Open terminal and run this command
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log restart
and for other OS just restart your Postgresql server, it will solve
Then start pgAdmin4, it will start as normal
Share or comment if saved someone
Deleting the contents of C:\Users\%USERNAME%\AppData\Roaming\pgAdmin directory worked for me!
I had same issue on windows. I had v1.6 installed as well as v2.0. Uninstalling v1.6 allowed me to login.
I had the same problem, but running it as an admin worked.
Have you recently installed a new version of pgAdmin ?
This issue (and the misleading message) is simply due to the fact that old versions of pgAdmin are unable to read the settings saved by a newer version of pgAdmin !
Make sure you're starting the right version of pgAdmin (your shortcuts are likely to point to the old version !) and/or uninstall the old version: the upgrade wizard doesn't do it for you !
Deleting contents of folder C:\Users\User_Name\AppData\Roaming\pgAdmin\sessions helped me, I was able to start and load the pgAdmin server
I had the same issue on the macosx and I renamed .pgadmin (in /users/costa) to .pgadminx and I was able to start pgAdmin4.
In Windows Just go to this path and clear it
,that works !!
C:\Users\%USERNAME%\AppData\Roaming\pgAdmin
I was able to solve the problem by changing the pgAdmin web interface port.
I believe this problem occurred on my computer because I have several other services consuming webs ports like qBittorrent, IDEJetbrains, etc.
Right-clicking on the pgAdmin logo near the clock is possible to configure it.
I Fixed it in windows 10 just running pgAdmin 4 as Run as Administrator .
If you use older postgresql version like 9.x and its services is running,PgAdmin 4 confused which server is base database.
So stop the service older version or new one.Run PgAdmin 4 as Administrator
Its worked for me
This is often a firewall problem. The firewall log then shows dropped packets between 127.0.0.1: and 127.0.0.1:, where the latter is the port shown in the Browser to get no connection with. This means, that the connection between pgAdmin client (high_port_1) and pgAdmin server (high_port_2) is blocked. Check your firewall log and if you find dropped packets like described, adapt your firewall settings accordingly.
If none of the methods help try checking your system and user environments PATH and PYTHONPATH variables.
I was getting this error due to my PATH variable was pointing to different Python installation (which comes from ArcGIS Desktop).
After removing path to my Python installation from PATH variable and completely removing PYTHONPATH variable, I got it working!
Keep in mind that python command will not be available from command line if you remove it from PATH.
I use the cmd prompt on Windows 10 with psql postgres postgres.
Then I launch pgAdmin4 and it works.
I had this problem with pgadmin4 v2.1 on linux fedora 27
Solved by installing a missing dependency:
python3-flask-babelex
Just click on that pgadmin 4 icon and run as administrator. Allow the access permissions. It will start locally.
I need to add this here because I've had several issues with this message. If you have recently upgraded to High Sierra you will find the latest (pgadmin 4.20) will keep appearing with the message "Application Server Could Not be Contacted". What this actually means on Macs is that python was unable to configure your environment in ~/.pgadmin
This directory stores all the things you setup and configure and even logs of what was ran on your user copy usage of pgadmin.
The way to fix this issue on High Sierra is down to sqlite3. If you look in that directory you'll see everything is stored in sqlite3 files.
When version 4.20 of pgadmin was released it was shipped with a version later than sqlite3.19 and the problem arises because High Sierra is shipped with sqlite3.19, so to fix this issue, you need to replace the old version of sqlite3 with the latest on your packager.
Now be aware, MacosX+ all use sqlite to store details for the majority of apps on your mac, so you'll need to make sure you do not just wipe the old version but you'll have to have both versions co-existing together in harmony to avoid anything major occurring on your mac.
1) download brew https://brew.sh/
2) update brew and upgrade brew to make sure it's up-to-date
3) brew install sqlite3
4) mv /usr/bin/sqlite3 /usr/bin/sqlite3.os
5) ln -s /usr/local/Cellar/sqlite/3.21.0/bin/sqlite3 /usr/bin/sqlite3
6) /usr/bin/sqlite3 -version (check version is later than 3.19)
You can now proceed to open up pgadmin as normal
Got this issue after I upgraded PostgreSQL 9.4 to 9.6. The 9.4 binary package had PgAdmin 3 while 9.6 came with PgAdmin 4. I resolved it after a clean installation (I completely uninstalled and reinstalled) of PostgreSQL.
However, under different circumstances, you could try running the pgAdmin 4 application as an Administrator. This should fix the error.
downloaded pgadmin 4 v2.0 and install it no problem atm on force installation. try it. that was solution for me.
For my case in Windows 10 for postgresql 10 version, it worked by changing SERVER_MODE to False in config_distro.py placed in web folder, as per these configuration settings: https://www.pgadmin.org/docs/pgadmin4/dev/desktop_deployment.html.
There are other settings mentioned in this answer (https://superuser.com/a/1131964) regarding python but I just changed SERVER_MODE and it worked.
Kill it in Windows Task Manager and then try again. It seems that there is some sort of a problem when accessing the server from different applications.
As for me on windows 2012r2 it's start to work only after I reinstall pgAdmin 4 to folder c:\pgAdmin4. With out spaces and any special chars.
And all so I give full permission to this folder in NTFS.
It worked for me after installing python2.7 for pgAdmin 4 v2
Happens mostly when you have multiple versions of pgadmin installed or while trying to upgrade. Even I tried everything from killing the "running PID on port 5432" to "changing the server mode". In my case I uninstall postgres and re-install it again on different port(5433).
Later, I opened it through cmd(right click on cmd and select "run cmd as an Administrator").

how to change command line to point to Desktop

i have to install Xgboost and i have done few steps and one last step is to wrap around the package xgboost .
now i want to get cd desktop working but it showing an error as
C:\Windows\system32>cd Desktop
The system cannot find the path specified.
please help to resolve this issue thanks
cd means 'Change Dir'. And I do not think that you have a 'Desktop' dir in C:\Windows\system32. To go to Desktop, use:
cd C:\Users\<username>\Desktop
and change <username> by your name.