I have two users on Ubuntu system. for 1 user ~./profile file wrong command How to change? - ubuntu-16.04

I have two users on Ubuntu system. By mistake i have changed for a user his ~./profile file. I kept wrong command in this file. As a result when I login to this user it is going for loop. How can I modify the content of this file?

The ~ refers to the home folder of the current user. You can access directly the file in the user home folder :
/home/user1/.profile
/home/user2/.profile

Related

conda init powershell - no action taken - operation failed

In both cmd and powershell, when I input conda init powershell, it always failed as follows:
(ifcmapping) C:\Windows\system32>conda init powershell
no change C:\Users\haoli\anaconda3\Scripts\conda.exe
no change C:\Users\haoli\anaconda3\Scripts\conda-env.exe
no change C:\Users\haoli\anaconda3\Scripts\conda-script.py
no change C:\Users\haoli\anaconda3\Scripts\conda-env-script.py
no change C:\Users\haoli\anaconda3\condabin\conda.bat
no change C:\Users\haoli\anaconda3\Library\bin\conda.bat
no change C:\Users\haoli\anaconda3\condabin\_conda_activate.bat
no change C:\Users\haoli\anaconda3\condabin\rename_tmp.bat
no change C:\Users\haoli\anaconda3\condabin\conda_auto_activate.bat
no change C:\Users\haoli\anaconda3\condabin\conda_hook.bat
no change C:\Users\haoli\anaconda3\Scripts\activate.bat
no change C:\Users\haoli\anaconda3\condabin\activate.bat
no change C:\Users\haoli\anaconda3\condabin\deactivate.bat
no change C:\Users\haoli\anaconda3\Scripts\activate
no change C:\Users\haoli\anaconda3\Scripts\deactivate
no change C:\Users\haoli\anaconda3\etc\profile.d\conda.sh
no change C:\Users\haoli\anaconda3\etc\fish\conf.d\conda.fish
no change C:\Users\haoli\anaconda3\shell\condabin\Conda.psm1
no change C:\Users\haoli\anaconda3\shell\condabin\conda-hook.ps1
no change C:\Users\haoli\anaconda3\Lib\site-packages\xontrib\conda.xsh
no change C:\Users\haoli\anaconda3\etc\profile.d\conda.csh
needs sudo C:\Users\haoli\OneDrive\??\WindowsPowerShell\profile.ps1
No action taken.
Operation failed.
I already run as Admin. How to solve it? Thanks!
In here
needs sudo C:\Users\haoli\OneDrive??\WindowsPowerShell\profile.ps1
I assume the ??\ are not English letters, you need to change it to English.
Check onedrive online, it is English on my local PC but not in English in the cloud. I changed the folder name to 'Documents'(where my PowerShell is at) in the cloud and synced the change to local. Worked for me.
On Windows when you let OneDrive back up your Documents folder, the folder points to the Documents folder on the cloud, and the actual name of it depends on the language of your system, which I assume it is "文档" in your case.
I just disabled the Documents backup in OneDrive settings, and re-run conda init, which gave me the result
modified C:\Users\username\Documents\WindowsPowerShell\profile.ps1
If you'd prefer not disabling the OneDrive backup, you can try Zixin's answer, I am just not sure if you should mess up with the default settings of the backup folder and if it will cause problem.

.pgpass file for more than one user

If I set PGPASSFILE to an explicit path like /home/user/.pgpass then it works fine and when logged in as the user that owns that file I can use psql for the entries in .pgpass.conf.
The problem I have is that I need to have multiple accounts use psql. If I change PGPASSFILE to user directory like ~/.pgpass.conf then it doesn't work and doesn't read the file so it gives a password error.
Because I can only specify one file it means only the owner of that file can run the commands I need to run.
I am running on Ubuntu 18.04 and I need root & www-data to have a .pgpass.conf file.
How do I do this?
If you have system users corresponding to your db users (root and www-data in your case), each has its own, separate .pgpass file in its respective home directory. Set each accordingly.
And simply do not set PGPASSFILE at all. The manual:
PGPASSFILE behaves the same as the passfile connection parameter.
And:
passfile
Specifies the name of the file used to store passwords (see Section 33.15). Defaults to ~/.pgpass, or
%APPDATA%\postgresql\pgpass.conf on Microsoft Windows. (No error is
reported if this file does not exist.)
Related:
Run batch file with psql command without password

File not found error when using cyberduck CLI for OneDrive

I want to upload encrypted backups on OneDrive using cyberduck to avoid local copys. Having a local file called file.txt I want to upload in folder Backups from OneDrive root, I used this command:
duck --username <myUser> --password <myPassword> --upload onedrive://Backups .\file.txt
Transfer incomplete…
File not found. /. Please contact your web hosting service provider for assistance.
It's not even possible to get the directory content using duck --username <myUser> --password <myPassword> --listonedrive://Backups command. This also cause a File not found error.
What I'm doing wrong?
I exactly followed the documentation and have no clue why this is not working. Cyberduck was installed by using chocolately, current version is Cyberduck 6.6.2 (28219)
Just testing this out, it looks like OneDrive sets a unique identifier for the root folder. You can find that by either inspecting the value of the cid parameter in the URL of your OneDrive site or I found it by using the following command
duck --list OneDrive:///
Note, having three slashes is important. It would appear the first two are part of the protocol name and the first specifies you want the root. The result should look like a unique id of some sort like this: 36d25d24238f8242, which you can then use to upload your files like:
duck --upload onedrive://36d25d24238f8242/Backups .\file.txt
Didn't see any of that in the docs... just tinkering with it. So I might recommend opening a bug with duck to update their docs if this works for you.
What happens if you use the full path to the file, it looks like it is just complaining about not finding the file to uploads so could be you are in a different directory or something so it needs the full path to the source file.

Need to copy a file into common folder location path for each user in one go

I have a file (named test.txt) that is currently only located on the Windows desktop for my user account. I need to copy this file to the same directory in each user account on this computer, such as:
C:\Users\MR.A\AppData\Roaming\Settings\test.txt
C:\Users\MR.B\AppData\Roaming\Settings\test.txt
C:\Users\MR.C\AppData\Roaming\Settings\test.txt
Within each user account, the path to the new location would be the same. How would I do this using the command line?

laravel - cannt open paths.php on server

this ones a weird one. For some reason, out of the blue, everytime I create a new project and upload to my server, it wont allow me to edit the paths.php file through FTP.
I accessed the server through command line earlier on today to install a bundle and noticed the paths.php file was green and has a star next to it. Does any one know what this means and is it affecting me from opening this file?
regards
The permission of the file is 755 which mean:
755 = rwx r-x r-x
Owner has Read, Write and Execute
Group has Read and Execute only
Other has Read and Execute only
Viewing the picture, qsradmin is the owner of the file, so he is the only one who can write or edit the file.
In order to change the owner of the file, use chown command like this:
chown NameOfTheUser path.php
For more information checkout Unix File permission