Posts Tagged “cli”

I stumbled upon SystemStarter while searching a way how to restart a service in Mac OS X.

Quote from the man page:

The SystemStarter utility may be used to start, stop, and restart the system services which are described in the /Library/StartupItems/ and /System/Library/StartupItems/ paths

Example:

  1. Restart NetInfo: sudo SystemStarter restart NetInfo
  2. Restart Printing / CUPS: sudo SystemStarter restart PrintingServices

I guess the missing part now is a full listing of the Services…lets see if i can find the time to collect them later.

Links:

Comments No Comments »

Description:

iSSH is a front-end application to the command line application â ‚¬Å“sshâ ‚¬ . It provides a quick and easy way to start an SSH connection to a remote computer. You may be asking, â ‚¬Å“Whatâ ‚¬ „¢s the point of running SSH without an interactive command prompt (Terminal)?â ‚¬  Well, running SSH in the background will not supply a prompt, but, it will forward ports. This is the main purpose of iSSH. You can set two options with iSSH; which ports to forward to the remote computer, or, to start an SSH SOCKS proxy. The first could be used to forward a VNC connection over SSH and the latter could be used to bypass your workâ ‚¬ „¢s website filters! Either way, it provides a simple way to start an SSH connection for those who are afraid of the Terminal or just donâ ‚¬ „¢t need it.
Links:

Comments No Comments »

for sure its quite easy to get the Mac OS X Version string using the “About this Mac”-dialog. but what if you need to get the same result from command-line ?

Lets take a quick look:

  • Open terminal.app ( in /Applications/Utilities )
  • Enter: /usr/bin/sw_vers

This should end up in a similar output to my one:

MacPro:~ fidel$ /usr/bin/sw_vers
ProductName:  Ã‚  Ã‚   Mac OS X
ProductVersion:  Ã‚  Ã‚   10.5.2
BuildVersion:  Ã‚  Ã‚   9C7010
MacPro:~ fidel$

Comments No Comments »

Just in case you have deleted a pre-installed Apple application here some ideas how to get them back.

Idea 1:

  • Insert your Mac OS Install CD
  • Open Terminal.app and goto /Volumes/yourMacCD
  • Navigate to the /Applications folder of the CD and copy the file somewhere to your Desktop or similar

Idea 2 - for packages:

  • You can use Pacifist to extract a package from the Mac OS X install CD/DVD

Just keep in mind that if you get an Application from your Install-Cd it might be outdated. But well better then nothing.

Comments No Comments »

Raw copy/quote from macosxhints.com:

If you don’t want to manage server lists for tab completion with ssh, put the following line in your .bash_profile file in your home directory:

complete -W “$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ‘ ‘ | sed -e s/,.*//g | uniq | grep -v “\["`;)" ssh

This will allow you to tab complete any hostname you've previously ssh'd to.

[robg adds: This worked as described for me. The complete command is a built-in bash function that lets you specify lists of options to be used with tab completion on a given command. The version above parses your known_hosts to create the list of options. You can read more about the complete built-in function in the bash man pages -- man bash, then search for the section titled Programmable Completion.]

Comments No Comments »

This is a raw copy from macosxhints.com:

Assume you want to do some work on a remote Mac via 10.5’s Screen Sharing, but you forgot to enable Screen Sharing before you left the remote Mac. You’re now a good distance away, and apparently stuck. Fortunately, because the screen sharing system uses launchd to monitor its state, enabling and disabling is as simple as adding a file in the remote Mac’s /Libary/Preferences folder. (Note that you’ll need to be able to login to the remote Mac via ssh to run these commands on that Mac.)

$ cd /Library/Preferences
$ echo -n enabled > com.apple.ScreenSharing.launchd

To disable screen sharing:

$ cd /Library/Preferences
$ rm com.apple.ScreenSharing.launchd

If you have a Finder window open with the remote Mac selected in the Shared section, you’ll even note the icon for Screen Sharing coming and going as you do this.

Comments No Comments »

Found that hint on the great fsckblog.

Safari comes with a good defaults-command:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true/false

The defaults command is a toggle and defines it Safari 3.1 opens links in a new window or in a new Tab.

The long version howto change a default value:

  1. Open Terminal.app (in /Applications/Utilities/)
  2. Enter the command as posted above. Keep in mind that you have to use either true OR false. :D
  3. Press enter and done

If you are not used to command-line you could easily use Secrets to enable to change this setting.

But to be honest, i am really wondering why apple has to “hide” such features for usual mac-users. Shame on you Apple.

Comments No Comments »

The next stumble: Secrets

The project is hosted at Google Code

Secrets lets you customize many Mac OS settings that are hidden or incomplete.

Many of these values can harm your system if used improperly. Use it at your own risk.

Its a prefPane which allows access to many (hidden) system- and application settings. Usualy those settings can be accessed via command-line (defaults) but aren’t we mac-users ? aren’t we always looking for a gui-based solution ? for sure we are….so get it. The application is developed by the Quicksilver team and currently in beta-status.

Found that application via daringfireball.net

Comments No Comments »

I must admit, i really like the locate command.

Unfortunally the database is usually out of date if you need it…so here the easy way how to update it

  • Open Terminal.app
  • Enter: sudo /usr/libexec/locate.updatedb

Guess it would make sense to create a cron-job or similar for this update-procedure

Haven’t tested this on 10.4 but i bet its the same commands. Otherwise should the man-page in 10.4 solve this question (man locate)

About locate itself:

locate = find data files, programs, directories, & objects matching your search.

For example, let’s say I’m searching for a file with the word “license” in the filename:

locate license

Since you usually receive quite a long list when running locate, you’ll probably want to do this:

locate license | more

-or-

locate license | less

Note that locate searches by name only. To search by any other attribute, use find. To search only for commands, use whereis.

Comments No Comments »

If you want to manage Apple’s Quick Look in 10.5 the following MAN-Page could be interesting.

Related 3rd party links:

Comments No Comments »

«12345»