Red Hat sucks!

5. August 2007

Diese verdammten Activation Codes soll sich Red Hat in den Arsch schieben. Auch wenn man dieser Firma 700$ pro Jahr und Server abdrückt, funktioniert’s mehr schlecht als recht.

Debian ist wenigsten gratis und Probleme hat man mit Lizenzen definitiv keine….

Fernsehen mit Apple TV

30. Juli 2007

Gerade eben bin ich über den Apple TV drübergestolpert und ich muss sagen, sieht ziemlich stylisch aus. Ich könnte mir gut vorstellen, so was in mein Wohnzimmer zu stellen, anstelle eines richtigen Fernsehers.

Hmm… Nur leider hilft auch Apple TV nichts gegen ein schlechtes Fernsehprogramm. Deshalb fällt es mir weiterhin leicht, darauf zu verzichten.

Apple TV

SSH Daemon aktivieren unter Mac OS X

29. Juli 2007

Du willst von einem entfernten Computer auf deinem Mac einloggen? Und du hast keine Probleme die Shell zu benutzen? (Wenn doch, schau mal in der Kategorie Shell Tutorial. Dort werden die Basics vermittelt).

Also, so gehts:

Unter Einstellungen muss Sharing geöffnet werden. Dort unter dem Reiter “Dienste” das Häkchen bei “Remote Login” setzen und schon kann man anschliessend mit ssh username@ip connecten.

Prozesse mit top anzeigen

27. Juli 2007

Wer immer eine aktualisierte Ausgabe von den laufenden Prozessen auf dem System anschauen möchte, kann top verwenden:

Processes:  60 total, 2 running, 58 sleeping… 190 threads            13:48:08
Load Avg:  0.16, 0.18, 0.20     CPU usage:  5.9% user, 5.0% sys, 89.0% idle
SharedLibs: num =  191, resident = 23.1M code, 4.10M data, 5.34M LinkEdit
MemRegions: num =  6998, resident =  119M + 8.44M private, 65.9M shared
PhysMem:   178M wired,  166M active,  110M inactive,  455M used, 56.2M free
VM: 7.88G +  129M   315027(0) pageins, 168555(0) pageouts
PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
983 top          8.6%  0:00.45   1    19    20   740K   376K  2.47M  27.0M
971 bash         0.0%  0:00.01   1    14    17   220K   776K   788K  27.1M
970 sshd         0.0%  0:00.04   1    11    43   136K   968K   916K  29.5M
963 sshd         0.0%  0:00.13   1    16    44   124K   968K  2.76M  29.6M
927 NetCfgTool   0.0%  0:00.02   1    21    25   248K   556K  3.24M  27.2M
926 writeconfi   0.0%  0:00.07   1    22    26   328K   612K  8.00M  27.8M
924 System Pre   0.0%  0:01.00   3   128   210  10.5M  8.79M  28.3M   345M
922 mdimport     0.0%  0:00.18   3    60    45   868K  2.02M  2.65M  38.8M
917 bash         0.0%  0:00.00   1    14    18   216K   776K   812K  27.1M
916 login        0.0%  0:00.01   1    16    41   144K   488K   612K  26.9M
885 firefox-bi   2.4% 39:04.94   6   100   434  59.0M  27.7M  93.1M   472M
857 Preview      0.0%  1:09.03   1    71   136  1.59M  5.00M  3.40M   333M
574 GimmeSomeT   0.0%  0:50.67   4   105   576  4.34M  10.1M  8.45M   354M
573 iTunes       5.4%  2:20:49   8   198  1031  13.8M  11.9M  19.6M   392M
558 VLC          0.4% 10:45.68   7   136   412  3.14M  6.45M  3.20M   374M
394 AppleSpell   0.0%  0:00.02   1    30    32  4.00K  1.12M  1.68M  37.2M
378 cupsd        0.0%  0:00.16   2    29    26   284K   704K   492K  27.9M
236 System Eve   0.0%  0:01.53   1    61    89   840K  1.48M  1.43M   318M
208 Terminal     0.0% 15:46.23  11   159   198  3.40M  9.00M  14.4M   349M
192 usbmuxd      0.0%  0:00.01   2    21    23  4.00K   292K   284K  27.0M
189 gstlaunche   0.0%  0:00.56   1    58   125   304K  2.80M  1.00M   324M
188 iCalAlarmS   0.0%  0:00.81   1    61    76   568K  2.27M  1.13M   319M
186 iTunesHelp   0.0%  0:00.41   2    61    90   252K  3.71M   800K   325M
185 UniversalA   0.0%  2:22.85   1    63    89   400K  2.99M  1020K   324M
181 Finder       0.0%  0:07.88   3   119   205  1.98M  8.46M  2.98M   353M

Die Ausgabe wird einmal pro Sekunde aktualisiert (wobei man dies mit -s einstellen kann). Mit top -o cpu wird nach CPU Benutzung sortiert, mit top -u rsize nach Memory Belegung.

Die Handhabung von top unter Debian ist meiner Meinung nach komfortabler, da sämtliche Einstellungen während top läuft angepasst werden können. Dies geht zwar unter Mac OS X auch, man muss aber top mit dem Parameter -L starten.

Apple Lisa

26. Juli 2007

1984 wurde der Apple Lisa vorgestellt. Was heute als selbstverständlich angesehen wird, war dazumals revolutionär. Hier ist ein Video, das die Features von Apple Lisa zeigt:

Prozesse von Mac OS X anzeigen

26. Juli 2007

Wer sich interessiert, was für Prozesse auf einem Mac OS X ausgeführt wird, kann im Terminal den Befehl ps nutzen.

Hier ein Auszug was auf apfelschwein so abgeht:

apfelschwein:~ andy$ ps auxwww
USER       PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
andy       573   4.6  3.8   401904  20020  ??  S    Tue11PM 139:58.02 /Applications/iTunes.app/Contents/MacOS/iTunes -psn_0_11141121
andy       885   2.1 18.2   483412  95288  ??  Ss   10:17AM  38:41.46 /Applications/Firefox.app/Contents/MacOS/firefox-bin -psn_0_19136513 -foreground
andy       558   0.1  0.6   383836   3280  ??  S    Tue10PM  10:41.76 /Applications/VLC.app/Contents/MacOS/VLC -psn_0_10878977
andy       971   0.1  0.2    27728    792  p2  Ss    1:32PM   0:00.02 -bash
root       974   0.1  0.1    27316    420  p2  R+    1:33PM   0:00.00 ps auxwww
root        31   0.0  0.1    28364    284  ??  Ss   Sun11PM   0:00.04 /usr/sbin/KernelEventAgent
root        32   0.0  0.1    28564    664  ??  Ss   Sun11PM   0:04.74 /usr/sbin/mDNSResponder -launchdaemon
root        33   0.0  0.2    27580    928  ??  Ss   Sun11PM   0:01.56 /usr/sbin/netinfod -s local
root        34   0.0  0.1    27288    308  ??  Ss   Sun11PM   0:00.36 /usr/sbin/syslogd
root        37   0.0  0.2    30032    856  ??  Ss   Sun11PM   0:03.35 /usr/sbin/configd
root        38   0.0  0.2    34516   1124  ??  Ss   Sun11PM   0:00.80 /usr/sbin/coreaudiod
root        39   0.0  0.1    27776    648  ??  Ss   Sun11PM   0:00.52 /usr/sbin/diskarbitrationd
root        40   0.0  0.1    28420    472  ??  Ss   Sun11PM   0:00.06 /usr/sbin/memberd -x
[..]

Die PID ist die Process ID. Jedem Prozess wird eine solche, eindeutige Nummer zugewiesen. Warum dies wichtig ist, wird in den nächsten Posts aufgelöst ;).

ps hat zahlreiche Optionen:

-a      Display information about other users' processes as well as your
own.
-A      Display information about other users' processes including those
without controlling terminals.
-c      Change the ``command'' column output to just contain the exe-
cutable name, rather than the full command line.
-C      Change the way the cpu percentage is calculated by using a
``raw'' cpu calculation that ignores ``resident'' time (this normally has no effect).
-e      Display the environment as well.
-h      Repeat the information header as often as necessary to guarantee
one header per page of information.
-j      Print information associated with the following keywords: user,
pid, ppid, pgid, sess, jobc, state, tt, time and command.
-L      List the set of available keywords.
-l      Display information associated with the following keywords: uid,
pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time and
command.
-M      Print the threads corresponding to each task.
-m      Sort by memory usage, instead of by process ID.
-O      Add the information associated with the space or comma separated
list of keywords specified, after the process ID, in the default
information display.  Keywords may be appended with an equals
(``='') sign and a string.  This causes the printed header to use
the specified string instead of the standard header.
-o      Display information associated with the space or comma separated
list of keywords specified.  Keywords may be appended with an
equals (``='') sign and a string.  This causes the printed header
to use the specified string instead of the standard header.
-p      Display information associated with the specified process ID.
-r      Sort by current cpu usage, instead of by process ID.
-S      Change the way the process time is calculated by summing all
exited children to their parent process.
-T      Display information about processes attached to the device asso-
ciated with the standard input.
-t      Display information about processes attached to the specified
terminal device.
-U      Display the processes belonging to the specified username.
-u      Display information associated with the following keywords: user,
pid, %cpu, %mem, vsz, rss, tt, state, start, time and command.
The -u option implies the -r option.
-v      Display information associated with the following keywords: pid,
state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem and
command.  The -v option implies the -m option.
-w      Use 132 columns to display information, instead of the default
which is your window size.  If the -w option is specified more
than once, ps will use as many columns as necessary without
regard for your window size.
-x      Display information about processes without controlling termi-
nals.

Maximale Anzahl Unterordner bei ext3

24. Juli 2007

Das man früher sich öfters mal geärgert hat, dass Dateien > 2GB (unter FAT) nicht möglich sind, ist öfters mal vorgekommen, aber das man auf die maximale Anzahl Unterordner stösst, kommt doch etwas seltener vor.

Nun ja, das es irgendwo Grenzen gibt, scheint logisch. Aber wo liegt sie denn nun bei der maximalen Anzahl Unterordner?

Genau das habe ich (nicht ganz freiwillig) herausfinden müssen, weil eine Website eines Kunden nicht mehr richtig funktionierte. Diese Website legt für jedes Objekt einen eigenen Ordner an in dem es die zugehörigen Bilder speichert.

Die Fehlermeldung war folgende:

mkdir: cannot create directory `xyz': Too many links

Wenn du so eine Fehlermeldung siehst, hast du die magische Grenze von 32000 Unterordnern in einem Ordner erreicht! Glückwunsch! :mrgreen_wp:

Wer das bei sich ausprobieren möchte, kann dieses Shellscript verwenden:

#!/bin/sh
mkdir -p /tmp/test && cd /tmp/test
LIMIT=32000
a=0
while [ $a -le "$LIMIT" ]
do
a=$(($a+1))
mkdir $a
done

Viel Spass!

Diebstahlsicherung für MacBooks

23. Juli 2007

Vor ein paar Tagen bin ich über eine voll coole Diebstahlsicherung für MacBooks gestolpert. Mit iAlertU kann man seinen MacBook wie ein Auto schützen.
Ein Video, dass das ganze demonstriert:

Die Software kann man hier gratis herunterladen.

Wer ist eingeloggt?

22. Juli 2007

Wer wissen möchte, wer denn auf seinem Unix-basierten OS eingeloggt ist, kann im Terminal w ausführen. Und so sieht dass aus:

apfelschwein:~ andy$ w
11:15 up 5 days, 11:50, 2 users, load averages: 0.34 0.28 0.19
USER TTY FROM LOGIN@ IDLE WHAT
andy console - Sun23 5days -
andy p1 - 11:15 - w

Wie lange läuft dein Mac schon?

21. Juli 2007

Das Uptime eines Unix-basierten OS dient immer wieder zu Schwanz-Vergleichen unter den Besitzern. Eine hohe Uptime heisst aber unter Umständen auch, dass das System nicht mehr auf dem neuesten Softwarestand ist und deshalb Sicherheitslücken enthält. Lieber eine kleinere Uptime als ein gehacktes System. Der Ärger wäre definitiv grösser.

Deine Uptime (resp. diejenige deines Öpfels, Linux, etc.) findest du heraus in dem du im Terminal den Befehl uptime eintippst. Dann sieht dass dann so aus:

apfelschwein:~ andy$ uptime
11:00 up 5 days, 11:36, 2 users, load averages: 0.27 0.20 0.12

Wie lange läuft dein Mac schon?