Unknown name in Terminal as username - macos

i bought a MacBook Pro with OSX version 10.9.2 (Mavericks)
since this, (about 2 month) i did not any attention to what happens in my Terminal when i start typing some code in it (java codes for compile or something) but now i got that when i just start my terminal, this totally unknown line will appeared:
dukhat:~ MacBookpro$
necessary to say, my basic mac user was macbookpro when i bought this mac
but what is this "dukhat"?!
i googled it but there is no related information about...
thanks for advances...

Reset it using:
sudo scutil --set HostName newhostname
or
sudo hostname -s newhostname.

For anyone else ending up here. Apple has a guide for this. Make sure to create a separate Administrator account before attempting.
http://support.apple.com/en-us/HT201548
You have to log on with a second admin account and manually change the user folder /Users/OldUserName to /Users/NewUserName.
Then you go to System Preferences > Users & Groups where you unhinge the Lock-icon in the bottom-left. Thereafter you can Ctrl-click on the User that you want to change and select Advanced Options...
Then you can change the Account name to NewUserName and the Home directory to /Users/NewUserName.
This requires administrator privileges, and you might want to back up your data first.

Related

Cygwin tftpd cannot drop privileges?

I am running Cygwin64 on two Win10 machines, one Home and one Pro. My software uses tftpd to receive a CSV from a network peer. tftpd is run from init (package sysvinit) with this line:
td:2345:respawn:/usr/sbin/tftpd -vvvvv -L -c -p -u Larry -U 000 -s /tmp
There is no xinetd running, no xinetd or tftp configuration file that I know of. On the Win10 Home system, which is my development system, this works. On the Win10 Pro system, it fails. The client times out. There is no entry in /var/log/messages (syslog-ng). Windows Application Log says "Cannot drop privileges: operation not permitted"
When I stop init and run that command line in a shell, it works and clients can transfer files in. But my system needs the respawn management of init. The pattern was set 12 years ago with Cygwin32 on Win7. My customer is now updating the PC and we have this glitch. If I were developing now, I would put the function on a raspi, but this is just a PC change.
Can anyone recommend a configuration to get the execution of tftpd under init under cygwin under Win10 Pro closer to that of the same command line in a user shell?
Edit 1: I also tried suid. tftpd.exe is owned by the user account, not SYSTEM or whatever cygwin has for root. Suid does not set permissions in a way that solves the problem.
Edit 2: adding cygdrop to the inittab line does not help.
Guess this one will be another tumbleweed. I found no good answers in 3 days of grinding. The problem seems to involve domain vs. local users in Windows, and how Cygwin interacts with the Windows user database, whatever that is. I ended up running the tftp server in an infinite-looping batch file that starts at user login, but is vulnerable to somebody killing the top level shell. Along the way, I recompiled tftpd-hpa for Cygwin and commented out the user ID change - that worked on my PC but not the customer's. If they have problems with the solution I may just retarget to raspi.

How do I force-delete a file on my computer?

I am using Mac OS X El Capitan Public Beta 2.
There is somehow a permission problem with my Desktop (and only this directory) because I can not delete any file.
The classic delete to bin does not work, even though I am prompted a window asking for my password and permission. (I am the administrator).
I also tried a few command lines like sudo rm - R *file* and it tells me that the operation is not permitted even after I enter my password.
Going without the rootless feature of El Capitan did not help either :
sudo nvram boot-args="rootless=0"
sudo reboot
Should I change the permissions of the Desktop directory? If so what are the original ones?
Thank you!
This could be caused by the "rootless" feature introduced in El Capitan... You can find more information about it here .
To disable "rootless", type this in the terminal (you'll have to reboot for the change to apply):
sudo nvram boot-args="rootless=0"
sudo reboot
After numerous try the answer was dead-easy : there is a "lock" option on files and directories in OS X and it was active for my desktop (right click -> information). Interesting is the fact that no command line could break it.

Issue with setting up Vagrant

I have just set up a new Linux box and trying to install vagrant on it. The issue is that when I am running vagrant up command, I am getting the following error:
Vagrant failed to initialize at a very early stage:
The directory Vagrant will use to store local environment-specific
state is not accessible. The directory specified as the local data
directory must be both readable and writable for the user that is
running Vagrant.
Any idea how to fix this?
I think a better way is to provide your user the required permission to the directory by making the user the owner - where you want the vagrant to be booted:
$ sudo chown -R <user> <directory>
and then you will be easily able to do:
$ vagrant up
Using sudo for vagrant up is unusual as why do you want to run your virtual machine as a root user.
I met the same problem and I solved it by run the terminal with"run as administrator". It's quite easy.
Hope this can help you.
I encountered the same issue four years later and could not fix it using chmod or even #Ziya's comment under the initial question (which brought me closer to the resolution though).
In my case, I use Vagrant 2.2.6 on Windows 10, and use Cygwin as a command line interface.
For the error to disappear, I had to :
open Windows Explorer
right-click .vagrant folder in the location where I typed vagrant up
access the "Properties" menu
then, in the "Security" tab, update the authorizations for my user, granting total control
Properties window screenshot
Hope this can help someone else.
Please follow these steps:
1) install vagrant 1.7.1
2) install virtual box 4.1, 4.2, or 4.3
3) use the administrator name in the custom directory (e.g., for windows users c:\users\AdminName\myvagrant or for Mac/Linux users /home/Admin/myvagrant)
For instance: c:\users\safwan\myvagrant where safwan is the user with administrator rights/privileges.
Copy the file name Vagrantfile in the myvagrant forlder.
4) Now open DOS window as shown in the picture and follow the steps in the DOS window changing the admin name

Enthought canopy won't install

I'm having some trouble installing Canopy on my Mac OS X (running 10.9.5) under my primary username. I get to the point where it asks for the location for the Canopy Environment Directory, but when I hit Continue, it crashes. I have been able to install it on the same computer, using my secondary username, but switching between the two usernames is less than ideal. Would love any suggestions. I already tried removing admin status from the secondary username to see if that changed anything, but it did not.
Thanks to anyone who has suggestions!
Any chance that this is relevant? https://support.enthought.com/entries/23707691-Canopy-GUI-requires-extra-setup-steps-when-user-s-home-path-contains-non-ASCII-characters
I actually had the same problem on my Mac. For me, I resolved it by changing the ownership of my home directory:
Open Terminal
Type in the following commands (hit enter after every line):
cd ~
cd ..
sudo chown <your_username> <your_directory>
replace <your_username> with your username, and <your_directory> with the directory in which all your personal files are stored
The last command may ask for a password. If it does, enter your password and hit Enter.

Postgres SQL Mac Uninstall

I've followed some questions for uninstalling postgres sql on mac and can't figure out how to deal with not being able to delete the data directory. My issue is I installed it a while back but don't remember the password and the thinking is to uninstall it unless someone can tell me how to reset the password. I see a mac user account for postgres was created and after resetting the password through mac preferences I sill cannot get access to the db or connect via JDBC. Please help!
You can't access your db as system user is not the same user as user in postgresql.
It is hard to tell where is data directory, while not knowing how you have installed it in first place. It is possible that you have PGDATA environment variable set. You can check it by running following command in the console:
echo $PGDATA
If it is empty you can check possible data directory locations i.e. with find command:
sudo find / -name PG_VERSION
It is file that should be in postgresql database directory according to postgres documentation:
http://www.postgresql.org/docs/8.4/static/storage-file-layout.html
You can also check this answer, if you don't want to uninstall and remove data directory: How do I reset the postgresql 9.2 default user (usually 'postgres') password on mac os x 10.8.2?

Resources