Posts Tagged “terminal”

If you are a Terminal lover you might try mounting .dmg files from commandline.

Basicly thats pretty easy, so just continue reading

Read the rest of this entry »

Tags: , , , , , , , , ,

Comments No Comments »

Ausgangssituation:

Ich verwende @work zwei Rechner als Hauptarbeitsplatz

  • PC-Tower - OS: Windows Vista - Display: 2 x 22″ Samsung
  • MacBookPro - OS: 10.5.x - Display: Inbuild + 19″ BenQ

Nun ist es ziemlich lässtig immer zwischen 2 Mäusen und 2 Keyboard hin und her zu springen. Die Verwendung von VNC oder Konsorten um einen der beiden Rechner vom anderen zu steuern wäre zwar ein möglicher Weg, jedoch verliere ich dann wieder gefühlt Arbeitsfläche, da ich Teile meiner Monitore dann nicht verwende und auf anderen Teilen meiner Monitore mehrere Betriebssysteme gleichzeitig anzeigen muss.

Read the rest of this entry »

Tags: , , , , , , , , , , , ,

Comments No Comments »

Über Geektool bin ich schon vor langer Zeit mal gestolpert, dachte klingt interessant das ganze und dann lief es wie es so oft läuft …. man vergisst es wieder.

Neulich bin ich durch Zufall mal wieder darauf gestoßen habe den ersten Praxistest gemacht. Ersteindruck ist schlichtweg perfekt.

Im Kern handelt es sich bei Geektool um ein kleines PrefPane welches es dem User ermöglicht bestimme Informationen direkt auf dem Desktop anzeigen zu lassen. Geektool unterscheidet hier 3 Kategorien:

  • File
  • Shell
  • Picture

Die Kategorie Picture macht dann Sinn, wenn man sich regelmässig ein Bild einer Web-Cam o.ä anzeigen lassen will. Das gleiche würde natürlich auch mit automatisch generierten Server-Log Grafiken funktionieren. Daher sowohl für Heim wie auch Firmen-Anwender interessant.

Die Kategorie File habe ich bis dato nicht wirklich gross getestet, aus dem einfachen Grund dass mir noch kein brauchbares Beispiel eingefallen ist, welches ich permanent auf dem Desktop sehen will. Könnte man aber z.b. für ToDo Listen o.ä verwenden.

Die Kategorie Shell hat sich als meine Spielweise herausgestellt. Ich kann mir damit relativ zyklisch aktualisierende Systeminformationen auf meinem Desktop anzeigen lassen, ohne das diese an sich anklickbar sind, d.h. das ganze ist letzlich wirklich wie ein Teil des Wallpapers… nur eben ein lebender Teil =)

Die Hauptübersicht in GeekTool:

Beispiele:

1. df - Anzeigen bzgl der Laufwerksbelegung:

df -h

2. top - Anzeigen der Resourcenfresser

top -orsize -FR -l1 | grep % | grep -v Load | grep -v COMMAND | cut -c 7-19,64-69

3. Uptime

uptime | awk ‘{print “Uptime : ” $3 ” ” $4 ” ” $5 }’ | sed -e ’s/.$//g’

4. Netzwerk

echo Internal IP: `ifconfig | grep “inet [0-9]“|grep -v 127.0.0.1 | awk ‘{ print $2 }’`;echo External IP: `curl -s http://checkip.dyndns.org/ | sed ’s/[a-zA-Z<>/ :]//g’`;echo “”;echo “Ethernet (en0):”;ifconfig en0|grep “active”;echo “Ethernet  (en1):”;ifconfig en1|grep “active”

Und so in etwa sieht mein linker Monitor nun aus (klick zwecks Vergrößerung):

Fazit:

Auf der Projektseite gibt es keine Angabe zur Kompatibilität mit 10.5, nur 10.4 & 10.3 sind erwähnt. Geektool läuft auf den ersten Eindruck fehlerfrei unter 10.5.4 (auf 2 Rechnern getestet) und hat sich für mich innerhalb von 2 Tagen als absolutes Muss auf meinen Macs rausgestellt.

Wer gerne mit dem Terminal rumspielt und etwas minimales Monitoring mag, sollte sich das Programm auf jeden Fall ansehen.

Mich würde eigentlich noch interessieren wer das Tool im Alltag noch so verwendet und ggf. für was. Denke mir sind bis dato viele gute Anwendungsideen noch gar nicht in den Sinn gekommen, daher hier der Aufruf :)

Links:

Tags: , , , , , , , , , , , , ,

Comments 3 Comments »

If you want to have more control over your powermanagement-settings in Mac OS X you might take a look at the command pmset.

Get first informations like that:

  • Open Terminal.app in /Applications/Utilities/
  • Enter: man pmset to check the man page or: pmset –help for basic help

This should give you a first impression.

Its really offering more then Apple offers in the System Preferences in Mac OS X

Links:

Tags: , , , , , , ,

Comments No Comments »

Denke viele Leuten kennen das Problem das sie Dateien löschen / umbewegen oder ähnliches wollen, jedoch Mac OS X einem mitteilt dass dies nicht geht, da das File in Verwendung ist.

Ich habe mich in solchen Fällen bisher immer eines Terminals bedient und das Problem mit lsof etc versucht zu lokalisieren. Letztlich bin aber auch ich als Terminal-Liebhaber faul und ziehe im Alltag grafische Lösungen vor sofern diese sich als brauchbar erweisen.

Meine Freundin hatte heute wieder genau so einen Fall und naja, die gute alte Methode musste es lösen. Minuten danach stopler ich über eine nette Freeware die einem genau in solche einem Fall helfen will:

What’s keeping me ?

Den ersten künstlich produzierten Test hat das Programm bestanden, jetzt mal sehen wann ich es wieder brauche.

About:

Did you ever have the problem where you can’t empty the Trash or eject a disk because something is preventing you? Usually the reason is because some application has a file open, and thus you can’t get rid of the disk or trash the file. That’s why we made What’s Keeping Me! What’s Keeping Me will identify the application that is preventing you from accomplishing your task. You can then use What’s Keeping Me to quit, relaunch, or kill the problem application so you can get on with your business.

Denke für Leute die weniger Terminal fokusiert sind sicher ein nettes Programm.

Links:

Tags: , , , , ,

Comments No Comments »

Mac OS X comes with an update service called Software Update.

Basicly its a nice feature which keep tracks on all Updates released by Apple Inc. for its software. This means it will cover the Operating System itself and the software shipped or offered by Apple.

Unfortunaly there is no real paket management like linux users love to have, but thats another story and this should not end in a rant

In some cases you want to ignore a specific update or an application from being updated so lets take a look how we can handle that with Mac OS X.

How to define an update to be ignored using Software Update:

You have to start Software Update and if the result list shows up, select the item you want to ignore. Navigate to Update in your menubar and select Ignore Update.

Well this is pretty easy, but maybe you selected the wrong update or just want to reset your ignore list whyever. It’s possible but not really good implemented from feature aspect … why ? Because you can only reset all Ignored Updates, not a specific one. Again a whyever….

How to reset Ignored Updates:

Start Software Update, navigate to Software Update in your menubar and select Reset Ignored Updates.

I would like to have a real paket management but that’s far away from reality, so we have to live with SoftwareUpdate how it is right now.

Personaly i would not work with ignoring updates in general as i prefer keeping my applications and operating system in touch with latest releases (which takes long enough with Mac OS X), but well if you need it ….do it =)

A final note for the command line lovers: Software Update is available as cli command too. You should start with a quick:

man softwareupdate

in Terminal.app, which will output something like that (10.5.4 here)

NAME
softwareupdate — system software update tool

SYNOPSIS
softwareupdate command [args ...]

DESCRIPTION
Software Update checks for new and updated versions of your software based on information about your
computer and current software.

Invoke softwareupdate by specifying a command followed by zero or more args.

The following modes are available:

-l | –list
List all available updates.

-d | –download

-i | –install
Each update specified by args is downloaded and unarchived, and also installed.  The
install flag requires root.  args can be one of the following:

item …    One or more update names.

-a | –all  All appropriate updates.

-r | –req  All required updates.

–ignore …
Manages the per-user list of ignored updates.

–reset-ignored
Clears the list of all ignored updates.

–schedule  Manages the per-user scheduler preferences.  args should be one of the following words:

on | off    Enable or disable automatic checking.

-h | –help
Print command usage.

I hope this short article helped.

Links:

Tags: , , , , , , , ,

Comments No Comments »

If you do use Terminal.app more then once a week it makes sense to customize your Terminal to your needs.

Personaly i prefer bash so the next steps are focused on the bash shell.

1. Creating a .bashrc:

  • Open Terminal.app
  • Open Terminal Preference Dialog
  • Navigate to the Startup section
  • Make sure you seleted “command (complete path)” under “Shell open with” section. The Full path should be “/bin/bash” in our example
  • Close the Preference dialog
  • Navigate to your users home folder if you arent there already.
  • Enter: “touch .bashrc” to create a new empoty file called .bashrc

Now we have done the first steps. We are sure we do use bash and we have an empty .bashrc ….so no function till now

2. Creating a .bash_profile:

Now we have to create a .bash_profile in our Users home directory too.

  • Open Terminal.app (be sure that you are in your users home directory)
  • Enter the following to create a bash profile: touch .bashprofile
  • Open the new bash profile. Enter: vi .bash_profile
  • Fill the new bash profile with the following:

if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

3. Forcing Terminal.app to load our bashrc at start:

Now we have to make sure Terminal.app uses our new .bashrc while starting.

  • Open Terminal.app
  • Open Terminal Preference Dialog
  • Navigate to the Startup section
  • Change “/bin/bash” to “/bin/bash –rcfile /Users/yourusername/.bashrc

On the next start of Terminal.app it should use our empoty .bashrc file. So now lets fill it a bit

4. Define  an example alias:

  • Open Terminal.app
  • Open your .bashrc with a texteditor (ie: vi .bashrc)
  • Insert the following example alias to check if our .bashrc works: alias  ls=”ls -la”
  • Save and close the file
  • Restart Terminal.app

After relauching Terminal.app the “ls” command should output the same in terminal then “ls -la” does

5. Tweak the history of your shell:

I love my bash history, but why not tweaking its default behaviour ?

  • Open Terminal.app
  • Open your .bashrc with a texteditor (ie: vi .bashrc)
  • Enter the following lines to your .bashrc:

# history handling
#
# Erase duplicates
export HISTCONTROL=erasedups
# resize history size
export HISTSIZE=5000
# append to bash_history if Terminal.app quits
shopt -s histappend

After restarting your Terminal your history should we teaked as follows.

  • The first command deletes duplicate-commands out of your .bash_history file which contains your bash history.
  • The second command defined the size of your history
  • The third line appends the history to your .bash_history to make sure you have all sessions saved.

Well that was the basic first step. You could now continue adding colors to your .bashrc, configuring how the prompt will look like and many other nice things.

Here my final example .bashrc

# Define how Bash prompt looks like:
#
# User @ Host - working dir
#export PS1=”\u@\h\w$ ”
export PS1=”\u@\h\w: ”

# Cli Colors
export CLICOLOR=1
# use yellow for dir’s
export LSCOLORS=dxfxcxdxbxegedabagacad

# Alias
#
#
alias ls=’ls -la’

# history handling
#
# Erase duplicates
export HISTCONTROL=erasedups
# resize history size
export HISTSIZE=10000
# append to bash_history if Terminal.app quits
shopt -s histappend

Tags: , , , , , , , , , ,

Comments 3 Comments »

I have to cleanup my mails so here the link to the Apple Command-line backup documentation

Quote:

Backing up your hard drive is like going to the dentist: important, but unpleasant enough that it is easy to put off or forget. Because of that, the best way to keep your data safe is to schedule regular backups. While there are numerous commercial applications that address this need (including Apple’s .mac Backup), they tend to either require the user to be logged in, or be connected to an enterprise data center.

The traditional UNIX alternative is to run a command-line backup tool as part of a ‘cron’ script, but many system administrators are unaware of the variety of options available for unattended backups under Mac OS X.

This article discusses some of the issues faced in making backups, the special considerations of Mac OS X systems, a number of options which allow the creation of viable backups, and a few potential pitfalls of developing a backup system. This article does not cover BSD flags, or systems prior to Mac OS v10.4 Tiger. And for simplicity, this article assumes that you have not turned on ACLs (using Mac OS X Server or fsaclctl) on the filesystem you are wanting to back up. There are some subtleties in how these tools interact with ACLs that are beyond the scope of this article. Please consult the latest documentation for each tool for more details.

Links:

Tags: , , , , ,

Comments No Comments »

I really like the say command on my Mac’s. Great fun letting another mac in your building say something while someone else is using it.

I stumbled upon some nice tricks regarding the say command.

Examples:

ie you could play a simple melody like that:

say -v Good oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooo

Where “-v Good” defines the voice. You could use “-v Bad” too, or any other system voice. if you dont define a voice yourself, say will use the default voice defined in System Preferences

Check the apple link at the end of this post for more details on the say command.

You could  try something more creative like that:

osascript -e ’say “Dum dum dee dum dum dum dum dee Dum dum dee dum dum dum dum dee dum dee dum dum dum de dum dum dum dee dum dee dum dum dee dummmmmmmmmmmmmmmmm” using “Pipe Organ”‘

Best snippet i found so far:

osascript -e ’say “oh This is a silly song silly song silly song this is the silliest song ive ever ever heard So why keep you listening listening listening while you are supposed to work to work to work to work its because i hate my job hate my job hate my job its because i hate my job more than anything else No its because youve no life youve no life youve no life and you better go get one after forwarding this crap” using “cellos”‘

Great =)

Links:

Tags: , , , , , , , ,

Comments 1 Comment »

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:

Tags: , , , , , , , ,

Comments No Comments »

1234»