terminal displays localhost before username osx - macos

I'm working on getting GIT installed so starting to use my terminal more.
Noticed something odd though. The word localhost:~ before my username
so localhost:~ username$
Is this something I need to be worried about? Just I'm following some tutorials and all of them so far just have the user name like
username$
Done a bit of searching and found nothing on this so far and just wanted to check before I move on any further.
Thanks
using osx 10.8.5

Nothing to worry about. localhost is the name of your machine, followed by :, followed by the directory you're in, in this case ~, which is your home directory.

Related

OS X - Make returning "Nothing to be done for <filename>"

First of all, I would like to apologize if I'm on the wrong stackexchange network, and secondly, sorry if I'm overlooking something simple.
I was moving files from my old hard drive from an old PC when I came across several password protected ZIP Files. However, since those files were a bit old, I forgot the passwords already. I tried every password I could come up with but I still came up empty. After several google searches, I found this tool/utility for Mac OS X that could help me. So I go to the downloads page and download the Mac OSX utility tool and the source code.
However, I am having problems executing the make command for the file. It says on the downloads page:
If you are using linux or another unix, you need to download the source code, uncompress it and type "make" to compile the utility.
So far, what I've tried is
$make /Users/myname/Downloads/aapr-0.01-source/Makefile
I have also tried the other files in the source folder but nothing worked. After that, I'm pretty much blank. I tried double clicking the aapr file in the utility download for Mac (which is a Unix Executable) and it opens a new terminal window displaying the commands and such. Also, doing $aapr [options] [filename] only shows me -bash: aapr: command not found. I also updated XCodes command line tools.
Sorry if I'm missing out on something very basic, I don't usually use the terminal on the OS X.
Try running
cd /Users/myname/Downloads/aapr-0.01-source
make
A Makefile contains rules for building files from other files but it is based on paths and contents, etc. which depend on your current location. So generally you need to be in the directory of the project for it to work.
Edit (copied from my comment):
To execute a command from a specific location (that isn't in the normal $PATH) you need to specify a path for it. So something like /bin/bash or ./aapr (where ./ means the current directory).

Mount command failing on 10.7.5

I have a shell script that mounts an smb share. It works perfectly on all macs with every OS revision except 10.7.5
The offending command is simply:
mount -t smbfs -o nobrowse //test:test#servername/sharename /my/mnt/point
When I attempt this command on a 10.7.5 mac, it fails either with a "broken pipe" or "authentication failed" error. However, it works fine on macs running 10.7.4, 10.6, 10.8 etc.
Can anyone successfully use this command on 10.7.5?
Is there any alternative way of achieving this, or troubleshooting exactly why this error is happening? I'm running out of ideas!
Since feature requests to mark a comment as an answer remain declined, I copy the above solution here.
Thanks for the replies. The problem was two fold: firstly, for some reason you cannot run this command as root in 10.7.5, and secondly you cannot mount outisde of /Volumes. Strangely this seems to work in all other OS revisions. I have worked around this problem by mounting my share in /Volumes and then creating a sym link to the desired mount point:
mkdir -p /Volumes/share
sudo -u localadminuser mount -t smbfs -o nobrowse //user:pass#server/share /Volumes/share
ln -s /Volumes/share /location/that/I/prefer/to/mnt
I hope this helps someone out. No idea why 10.7.5 changes this. – BSUK
There are many reasons why the mount will not work. Some of the reasons include:
Time between server and client being too different
Workgroup name not specified on the mac
Local hostname uses non-latin characters
Encryption is too strict between the mac and the server
To solve the time; set the time.
I've seen broken pipe/authentication errors most often when you don't use a workgroup name for the connection. A connection string looking like generally works better than one without any workgroup:
//WORKGROUP;user:50000#192.168.2.1/Share
... assuming that the 50000 is the password for the user user should allow the connection. Generally, you just need to have a string before the semi-colon, it can read anything; it just needs to be there.
To solve the local hostname issue click on an interface, choose advanced go to the WINS tab and make sure that the name doesn't have any foreign characters there.
If the encryption is too strict, you will need to edit the nsmb.conf. I have a set of lines looking like:
[server1]
minauth=none
for an ancient BSD server which cannot deal with encrypted passwords. You can have this in either an /etc/nsmb.conf or ~/Library/Preferences/nsmb.conf file.
This may not address your issue, but it may help you in trying to proceed.
Unfortunately, saying it works on box x and not on box y doesn't really help, as there could be any arbitrary configuration difference between them.

Can't create a symbolic link with Textmate in Terminal. (mate: command not found)

I'm currently going through http://ruby.railstutorial.org/ and it uses the command "mate" to access Textmate through the terminal. I have had Textmate on my Macbook Air (Lion OS) since I first bought it, but when I try to use a command like "mate .gitignore" the terminal gives me "mate: command not found".
I've looked through all other StackOverflow questions regarding this topic and have done the following:
Attempted to create a symbolic link through the terminal with this code.
$ sudo ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/bin
This code lets me enter my password and tells me the file exists, but still does not allow me to use the "mate" command.
Accessed Textmate/Help/Terminal Usage and tried to create a link for /usr/bin only for it to say operation not permitted.
Used alias mate='open -a textmate'. This works; however, I have to do it every time I open Terminal.
So, my question is can anyone tell me what is wrong? Love to figure this out!
Thank you!
First, you should not add anything to /usr/bin. You should add it into /usr/local/bin. Further, getting the message "file already exists" from ln means that it did not create the link. Try this:
ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/local/bin/mate
Depending on your current setup, this may have to be run with sudo. In general, if you don't know whether to run something with sudo or not, try without first and see if you get a permissions error, then use sudo.
The best way to do it is from TextMate -> preferences -> Terminal and then check install
all the previous methods didn't work for me.

mac osx 10.7 install script error: "~/Library/" not found

I use a bash script to install an app on Mac OS X "Lion". First I copy the app bundle into place, then attempt to install postgres into the app bundle. The data path for the postgres db needs to be in "~/Library/Application Support/myappfolder/data/".
Now the problem (appears to be) that the script stumbles because the OS says the path is not found. Backing up the path names I get to "~/Library/" and it still fails. The script is run with admin privileges.
To put this another way, from the terminal, this works:
me: cd ~/Library
but this does not:
me: mydir="~/Library/"
me: cd $mydir
I know things have changed in 10.7, but I haven't found the answer at the dev center yet.
I don't think this is Lion-specific. When you use quote marks, you are causing the ~ character to be treated literally, instead of as an alias for $HOME. So it's looking for an actual directory with a tilde in the name, which doesn't exist.
Try using mydir="$HOME/Library" instead to see if that fixes the problem.
This actually doesn't work in 10.5, either, so I don't think it's a Lion specific problem. Something like this will always work, though:
eval "cd $mydir"

How can I fix permissions for bundles or Subversion in TextMate?

When I try to use GetBundles to update my TextMate bundles, "Parsing Local Bundles" appears and the progress wheel spins endlessly (e.g. >20 minutes). Reading the Help manual for GetBundles suggests that this might be a permissions error.
In line with this, typing at the command line the commands from this question ( How to update GetBundles in TextMate? ),
cd ~/Library/Application Support/TextMate/Bundles/
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
produces this response:
Can't make directory 'GetBundles.tmbundle': Permission denied
Can I fix permissions somehow, to make GetBundles work properly, if that's my problem? Thanks!
update: I seem to have TextMate/Bundles/ in both my user user Library and the higher level Library. Could that be my problem? And if so, how should I fix it?
ORIGINAL RESPONSE:
You need to remove the trailing slash from GetBundles.tmbundle/ so it reads like a file and not a directory: GetBundles.tmbundle <- incorrect (I misunderstood the question - apologies)
UPDATE:
I think the mistake (in your command as typed above anyway) is that spaces need escaping or the path needs quoting in your 'cd' command. So, from a fresh Terminal session (i.e. from your user Home directory) try quoting the path:
cd "Library/Application Support/TextMate/Bundles/"
then
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
Try that, and post the exact terminal readout here...

Resources