Archive of articles classified as' "terminal"

Back home

Unsichtbare Dateien im Finder zeigen

17/09/2009
Als kleines Tool:
Code zum markieren einmal anklicken oder Code im Skript-Editor öffnen

set h to button returned of (display dialog "Make Finder show all files" buttons {"Yes", "nope, default"} default button {"YES"}) as text

if h = "Yes" then

do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder"

else

do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder"

end if

No Comments

OSX-Terminal: Liste bestehender Netzwerkverbindungen

5/09/2009
Code zum markieren einmal anklicken
lsof -i -n | grep ESTABLISHED
No Comments

Bildschirmauflösung via Terminal ändern…

26/06/2009
Das macht ein Tool mit dem Namen cscreen möglich , hier eine Kopie davon: cscreen Dabei bitte beachten, dass man auch nicht unterstützte Auflösungen damit einstellen kann, wer also nicht weiß was er tut, FINGER WEG!
No Comments

Zeitersparnis beim Dialogaufbau

19/06/2009
Damit klappen die Dialog etwas schneller auf... quasi sofort =)
defaults write NSGlobalDomain NSWindowResizeTime .001
No Comments

PDF mit transparentem Hintergrund erstellen

4/02/2009
Wenn man über den OSX Druckdialog PDFs erstellt, sind diese nicht transparent, d.h. eine weiße Seite ist deckend weiß. Exportiert man im Druckdialog den Druck aber nicht als PDF sondern als PostScript und macht dann über ps2pdf im Terminal ps2pdf <<pfad der PostScript Datei>> <<SpeicherPfad des PDFs (output)>> daraus ein PDF, so ist dieses PDF auch transparent an den Stellen, wo auch in Pages, oder Word eben nix steht =)!
No Comments

Rsync mit AppleScript, Ordner Synchronisieren bzw. Backup erstellen

1/02/2009
Die Idee ist eigentlich voll simpel uns sicher schon irgendwie mal programmiert worden. Das nette an dieser Lösung ist, dass die Ziel und Quell-Ordner über Aliase gekennzeichnet werden.Man zieht einmal den zu sichernden Ordner als
Alias in den Skript-Ordner, dann den ZielOrdner und bennent diese entsprechen in um (SOURCE und DESTINATION). Beim nächsten Start, synchronisiert das Skript mit rsync und schreibt alles in ein Log, das 2000 Zeilen nie übersteigt...
Code zum markieren einmal anklicken

try

set sourcepath to ""

set destipath to ""

set h to path to me

tell application "Finder"

set h to container of h

if (count of every alias file of h) = 2 then

set thealiases to every alias file of h

repeat with thealias in thealiases

if name of thealias = "SOURCE" then

set sourcepath to characters 1 through -2 of (POSIX path of (original item of thealias as alias)) as text

else if name of thealias = "DESTINATION" then

set destipath to POSIX path of (original item of thealias as alias)

end if

end repeat

if destipath "" and sourcepath "" then

do shell script "rsync -avE --delete-after " & quoted form of sourcepath & " " & quoted form of destipath & " >> " & quoted form of POSIX path of (h as alias) & "rsync_log.txt || echo -n"

do shell script "tail -n 2000 " & quoted form of POSIX path of (h as alias) & "rsync_log.txt | cat> " & quoted form of POSIX path of (h as alias) & "rsync_log.txt2; mv " & quoted form of POSIX path of (h as alias) & "rsync_log.txt2 " & quoted form of POSIX path of (h as alias) & "rsync_log.txt"

else

error "irgendwas ist da falsch gelaufen"

end if

end if

end tell

on error msg

error "irgendwas ist da falsch gelaufen" & msg

end try

No Comments

FrontRow per default auf einem anderen Bildschirm

11/12/2008
defaults write com.apple.frontrow FrontRowUsePreferredDisplayID <<displayID>> Die Display ID bekommt man soweit ich es bisher weiss recht schnell durch Ausprobieren der Display IDs aus (~/Library/Preferences/com.apple.preference.displays....plist) heraus. Bei sah es dann am Ende so aus: defaults write com.apple.frontrow FrontRowUsePreferredDisplayID 69673024 (danach nur noch FronRow neustarten)
No Comments

Passwort zurücksetzen 10.5 und 10.4

26/09/2008

Unter 10.4

Boot into single user mode (press Command-S at power on) /sbin/fsck -y [Enter] /sbin/mount -uaw [Enter] rm /var/db/.applesetupdone [Enter] reboot [Enter] oderpasswd ->It will prompt for your new password twice.

Unter 10.5

Boot into single user mode (press Command-S at power on) Type fsck -fy Type mount -uw / Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist Type dscl . -passwd /Users/username password, replacing username with the targeted user and password with the desired password. Reboot
No Comments

Bildschirmschoner als Schreibtisch-Hintergrund

27/08/2008
Finde ich wirklich nett... /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background
No Comments

Killall on Idle

27/08/2008
Diese Terminal-Kommando checkt, ob und wie lange der Rechner inaktiv ist (keine Maus oder Tatstatur-Eingabe) und führt ggf. dann einen Befehl aus... ist recht praktisch, wenn es im Crontab läuft =) idletime=`ioreg -c IOHIDSystem | perl -ane 'if (/Idle/) {$idle=(pop @F)/1000000000; print $idle,"";last}'|awk '{split ($0,a,".");print a[1]}'`;if [ $idletime -ge 4 ]; then killall VLC; fi &>/dev/null
No Comments