About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Home » Learning Curve

New CLIX Stuff 2008-02-24

Time again.

24 February is a special day for many reasons. It's the one day of the year the world's perhaps finest beer is brewed and it's also time for a new batch of CLIX commands including some of those submitted with CLIX 1.8.1c.

1. Secure /Applications

Sent by 'Yan'. The reason for this should be obvious. 'Repair permissions' is known to screw up and SUID modules in this hive can be corrupted. When you use this method there's no risk for mishaps - this is Unix and Unix makes sure.

/usr/bin/sudo /usr/sbin/chown -R root:admin /Applications; /usr/bin/sudo /bin/chmod -R o+rX /Applications

2. Rebuild Launch Services DB

Catenate this as one line. You can always just zap the caches on a reboot but in session it's not such a good idea. In session this is better.

/LaunchServices.framework/Support/lsregister -kill -r -lint -domain local -domain system -domain user

3. Clean XAs

Sent by 'Salamander'. Assumes use of the ACP's xabatch. Recurses from the directory the CLIX command file is located in. Change the '.' to '~' to recurse through the entire home area. Especially Leopard goes absolutely bananas with metadata (which quickly became the latest rabid fetish). For example: do you really need an XA to tell you a text file is a text file?

find . -print0 | xargs -0 ~/Applications/etc/xabatch ~/Applications/etc/com.apple.xabatch {}

4. Toggling Leopard Web App Services

Sent by 'k0'. These should be used with extreme caution as the apps in question are 'signed' and any detected tampering will result in the keychain being blocked off. Why use them? Why to clean your junkyard 'Services' menu of course. The downside is all these apps are 'signed' and that means you can't even change a single byte on their Info.plist (where the services entries are located) without running into trouble.

4.A. Kill Mail & Safari Services

Put this all on one line by removing the newlines.

echo -n 'Disabling NSServices in /Applications/Mail.app... ';
/usr/bin/sudo /bin/mv /Applications/Mail.app/Contents/Info.plist /Applications/Mail.app;
/usr/bin/sudo /bin/cp /Applications/Mail.app/Info.plist /Applications/Mail.app/Contents/Info.plist;
/usr/bin/defaults rename /Applications/Mail.app/Contents/Info NSServices NoNSServices;
echo done.;

echo -n 'Disabling NSServices in /Applications/Safari.app... ';
/usr/bin/sudo /bin/mv /Applications/Safari.app/Contents/Info.plist /Applications/Safari.app;
/usr/bin/sudo /bin/cp /Applications/Safari.app/Info.plist /Applications/Safari.app/Contents/Info.plist;
/usr/bin/defaults rename /Applications/Safari.app/Contents/Info NSServices NoNSServices;
echo done.

4.B. Revive Mail & Safari Services

Don't try this at home if you don't understand how it works: note the inode of the original file is never interfered with. Mess this up or perform these commands in the wrong order and you can be toast.

echo -n 'Enabling NSServices in /Applications/Mail.app... ';
/usr/bin/sudo /bin/mv /Applications/Mail.app/Info.plist /Applications/Mail.app/Contents/Info.plist;
echo done.;

echo -n 'Enabling NSServices in /Applications/Safari.app... ';
/usr/bin/sudo /bin/mv /Applications/Safari.app/Info.plist /Applications/Safari.app/Contents/Info.plist;
echo done.

5. 'I Know Kung-Fu'

Sent by Dali. Very cool. See this link if you don't know what the fuss is all about.

5.A. トメャル ドヮ

echo -n 'Loading the Construct... ';
/usr/bin/defaults write com.rixstep.CLIX Construct -bool YES;
echo done.

5.B. ピヲメラヮラヮョ 1

ハヮュ レラヮュ。

echo '~ ! @ # $ % ^ & * ( ) _ +';
echo 'Q W E R T Y U I O P { } |';
echo 'A S D F G H J K L : "';
echo 'Z X C V B N M < > ?'

5.C. ピヲメラヮラヮョ 2

ハヮュ レラヮュ。

echo '` 1 2 3 4 5 6 7 8 9 0 - =';
echo 'q w e r t y u i o p [ ] \';
echo 'a s d f g h j k l ; '\';
echo 'z x c v b n m , . /'

5.D. フヮヰレヵョ

ピラロュ ユワヲ ンワロュ ピメンヴヹ プヨュメヴ。

echo -n 'Unplugging... ';
/usr/bin/defaults delete com.rixstep.CLIX Construct;
echo done.

6. Dump the Launch Services

Note this will result in a half megabyte file. But it's eminently interesting! Catenate to one line.

Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump

7. DTrace Commands

Not all DTrace commands can be run through CLIX because some of them assume a 'ctrl-C' interrupt they need to 'catch' to print results and exit. These commands however work.

7.A CPU Walk

Shows which CPUs processes run on. A five second walk is used.

/usr/bin/sudo /usr/bin/cpuwalk.d 5

7.B HTTP Stat

Shows realtime httpd stats per second.

/usr/bin/sudo /usr/bin/httpdstat.d

7.C Loads

Shows load averages.

/usr/bin/sudo /usr/bin/loads.d

7.D New Proc

Snoops new processes.

/usr/bin/sudo /usr/bin/newproc.d

7.E File By Proc

Snoops file opens by process name. Watch 'Dock' delve into '/.vol' in search of Cocoa application icons!

/usr/bin/sudo /usr/bin/filebyproc.d

7.F I/O Snoop

Shows I/O events in realtime. Very revealing about what's really going on under the bonnet!

/usr/bin/sudo /usr/bin/iosnoop -a

7.G Open Snoop

Snoops file opens in realtime. Another very revealing command.

/usr/bin/sudo /usr/bin/opensnoop -a

7.H PID / Sec

Shows new PIDs per second. Pretty boring actually.

/usr/bin/sudo /usr/bin/pidpersec.d

7.I Run OCC

Shows dispatcher run queue occupancy. Another pretty boring one.

/usr/bin/sudo /usr/bin/runocc.d

7.J Set UID Calls

Snoops set UID calls in realtime. This one can be really interesting to keep running.

/usr/bin/sudo /usr/bin/setuids.d

See Also
Industry Watch: CLIX 1.8.1c

About | ACP | Buy | Forum | Industry Watch | Learning Curve | Search | Twitter | Xnews
Copyright © Rixstep. All rights reserved.