Adding binaries to the 'bin' catalog - linux

When I'm trying to add 'phantomjs' binary to the 'bin' folder (/usr/bin) on Mac OSX, the following error occurs:
Oskars-MacBook-Pro:bin oskarszura$ mv phantomjs ../../../../usr/local/bin/
mv: rename phantomjs to ../../../../usr/local/bin/phantomjs: Permission denied
i assume that I shouldn't change this catalog's permissions. How should I add binaries on Mac OSX ?

You need administrator (also called root) rights to fiddle with the system folders.
See the sudo command how gain those privileges for a single command.
Also, instead of using that relative path to /usr/local/bin, why not simple use the full path of just /usr/local/bin?

Related

Lack of permissions in Windows

I created C:/Users/homedir/Documents/Python. Windows automatically
puts that in OneDrive's path. Is this causing the permission errors?
d#LAPTOP-M0R87BQ6 MINGW64 ~/OneDrive/Documents/Python/twilio-python-main (main)
$ python3 setup.py install
running install
error: can't create or remove files in install directory
# The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\test-easy-install-9920.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\
Is the only problem I need to create the directory (or modify setup.py to install in Python's path elsewhere)?
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.
I am the Admin for this machine, I'm in the Group Administrators. There is no higher root on my machine. I opened a PowerShell as an Admin and ran the python interpreter. Still insufficient permissions. Looking at Windows Explorer I am Owner of all the files.
The error says: "If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHON PATH environment variable."
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/easy_install.html
Please make the appropriate changes for your system and try again.
in cmd windows try taking ownership of WindowsApps folder and ensure the properties are inherited by its subfolders
takeown /f \"C:\Program Files\WindowsApps" && icacls \"C:\Program Files\WindowsApps" /grant administrators:F

Workspace Settings permission denied

I'm running Ubuntu 12.04LTS.
Have unpacked Visual Studio Code in a folder owned by my user id. All vscode files are owned by my user id (user and group).
Have Node.js, npm, typescript installed via apt-get (and npm).
Visual Studio code runs fine, however File->Preferences->Workspace Settings gives this error:
Unable to create 'vscode/settings.json' (Error: EACCES: permission denied, mkdir '/.vscode').
Any ideas on how to resolve this? Where is it trying to do the mkdir?
Thanks,
Bob Wirka
UPDATE: Sudo'd mkdir "/.vscode" (literally at the root level), and chown'd it recursively to my user and group. Voila! Now I can edit the settings.
So, is there a way to tell Visual Studio Code that it shouldn't be trying to use the root folder?
Mentioned in the update by the OP but thought I'll mention it explicitly. You need to change the permissions for the folder. The following command will change the owner of the directory so that you can open it without needing root privileges.
$ sudo chown <user-name> -R <directory-name>
I had same issue on my osx. I was able to solve this issue by change the permission to read and write in project folder.
Simply type
sudo chmod 777 -R <your_app_name_directory>.
This will give all permissions to all users, groups and others for read, write, execute.
-R gives recursively permissions to all nested files folders inside your directory.
If -R is not given then it gives permissions to current directory only, not to other directories inside.
Change the permissions to your folder
sudo chmod ugo+rwx your_folder

Ubuntu 13.10 , Golang build and run, the terminal display error bash: ./filename : Permission denied

I am trying to run Go's executable file after using command go build instead of typing go run filename.go.
I typed go build in the directory where the Golang source file resides. After the executable file had been created, I typed ./filename to run it. Then the terminal displayed a line :
bash : ./filename : Permission denied
I had tried to change the permission of the filename by typing :
chmod u+x filename
But this action doesn't give any effects. The permission denied error still occurs whenever I type ./filename.
Is there another way to build a Golang applications from source code, and then run it from executable file?
All things done well if I do this task in Windows command prompt, after typing go build, the filename.exe is created and there is no any problem when I run it by typing ./filename.exe.
NTFS and FAT have different permission models than Unix. This especially means that there is no executable flag on such a file system. Calling chmod a+x FILE is a no-op. Linux emulates classical Unix permissions on NTFS file systems by setting a mask for each file that contains the would-be permissions.
To fix these problemss, either move executables to a different file system or change the mount flags to use a permission mask that enables the executable-flag (for all files).

Access root of drive with a Unix-like shell

I'm using Cygwin to compile a library. The library is not stored within the same directory as Cygwin. I need to navigate to this directory in order to compile the library. The Cygwin shell only allows me to go back as far as the Cygwin root directory using cd .. .
The command su returns the following:
su: user root does not exist
How do I navigate my hard drive using Cygwin if the su command doesn't work?
As suggested by Wooble, the solution is to use the command /cygdrive/ , followed by the drive letter. So, to access the root of the C: drive, type cd /cygdrive/c.

How to delete a folder or a file from usr/bin in linux/fedora

I am using fedora ,
Unfortunately i had downloaded a package(for example 'selenium' or 'chrome') in the bin folder.
But i don't want that package in the bin folder, i want to remove it from the folder, i am unable do it manually as well as from the the terminal, so can anyone let me know how to delete a package from bin folder.
Actually i am trying to download a package as below from terminal
svn checkout http://selenium.googlecode.com/svn/trunk/ selenium-
read-only
But i didn't see my path in terminal when i am downloading i.e., usr/bin , so the package has been downloaded in bin folder now.
Please help me out through this.
the /usr/bin folder is a protected folder which usually root user have full access to it
so if you want to make a change in it you should have a full access which can gain by "su" or "sudo" commands
try these commands on your terminal
su
<type your root password>
cd /usr/bin
rm <your special file names you want to remove>
you can do it by sudo too
cd /usr/bin
sudo rm <your special file names you want to remove>
<type your root password>
You don't have privileges of deleting a file or folder in the /usr/ directory unless you are the root user. Therefore you can do that by right-clicking on the /usr/ directory and Open as root. This gives you the rights of the root in that directory.

Resources