Comments for David LeBer reBeLog http://davidleber.net I'm David LeBer. I'm Canadian, I'm pessimistic, I code. This is my blog reBeLog. WO, Cocoa, thoughts, you know, it's a blog. Tue, 31 Aug 2010 22:09:34 +0000 http://wordpress.org/?v=2.9.2 hourly 1 Comment on Time Machine and a new motherboard by Michael http://davidleber.net/?p=288&cpage=1#comment-50790 Michael Tue, 31 Aug 2010 22:09:34 +0000 http://davidleber.net/?p=288#comment-50790 Seems like 10.6.4, at least, has this problem nipped. Time Machine detected that the machine had the same name but that the back up was from a different computer. I could click "Reuse backup" and it carried on as usual... it only backed up a few gig not the whole hard drive. Seems like 10.6.4, at least, has this problem nipped. Time Machine detected that the machine had the same name but that the back up was from a different computer. I could click “Reuse backup” and it carried on as usual… it only backed up a few gig not the whole hard drive.

]]>
Comment on Using WebObjects DirectActions – pt. 3 by Ken http://davidleber.net/?p=77&cpage=1#comment-50766 Ken Thu, 12 Aug 2010 05:48:55 +0000 /?p=77#comment-50766 Sorry...obviously it translated my code. Let's try this again. Instead of: <code> </code> try: <code> </code> Sorry…obviously it translated my code. Let’s try this again.

Instead of:


try:

]]>
Comment on Using WebObjects DirectActions – pt. 3 by Ken http://davidleber.net/?p=77&cpage=1#comment-50765 Ken Thu, 12 Aug 2010 05:46:43 +0000 /?p=77#comment-50765 It seems that when you use WOTextField in your HTML file you still need to supply the key via a name attribute. Otherwise WO will generate it's own key and it won't always be the same. For example, instead of: try: That works for me every time, Ken It seems that when you use WOTextField in your HTML file you still need to supply the key via a name attribute. Otherwise WO will generate it’s own key and it won’t always be the same.

For example, instead of:

try:

That works for me every time,

Ken

]]>
Comment on Using WebObjects DirectActions – pt. 5 by Adam http://davidleber.net/?p=105&cpage=1#comment-50754 Adam Thu, 05 Aug 2010 18:37:36 +0000 /?p=105#comment-50754 For logout, you can terminate the session, and than redirect to a Direct Action logout page where there you may tell users like "you log out successfully blah blah blah and perhaps provide a link to the login page. ... session.terminate(); WORedirect page = new WORedirect( this.context() ); page.setUrl( context().directActionURLForActionNamed( "logout", new NSDictionary(Boolean.FALSE, "wosid"))); return page; For logout, you can terminate the session, and than redirect to a Direct Action logout page where there you may tell users like “you log out successfully blah blah blah and perhaps provide a link to the login page.


session.terminate();
WORedirect page = new WORedirect( this.context() );
page.setUrl(
context().directActionURLForActionNamed(
“logout”, new NSDictionary(Boolean.FALSE, “wosid”)));
return page;

]]>
Comment on Time Machine and a new motherboard by Nicola http://davidleber.net/?p=288&cpage=1#comment-50687 Nicola Fri, 02 Jul 2010 22:54:26 +0000 http://davidleber.net/?p=288#comment-50687 It worked!!! you guys just saved me!!!! It worked!!! you guys just saved me!!!!

]]>
Comment on Using WebObjects DirectActions – pt. 5 by MeIr http://davidleber.net/?p=105&cpage=1#comment-50669 MeIr Sat, 12 Jun 2010 01:22:20 +0000 /?p=105#comment-50669 Hello David LeBer, I watched your WO tutorials about login and done the way you told. However I have an issue with logout. I am not sure how to do it. Is it possible for you to make small tutorial as continuation to the previous one, which demonstrates the logout process. Thank you. P.S: Your tutorial was a life saver. Hello David LeBer, I watched your WO tutorials about login and done the way you told. However I have an issue with logout. I am not sure how to do it. Is it possible for you to make small tutorial as continuation to the previous one, which demonstrates the logout process.

Thank you.
P.S: Your tutorial was a life saver.

]]>
Comment on One step forward… by Jon http://davidleber.net/?p=216&cpage=1#comment-50646 Jon Wed, 26 May 2010 20:17:12 +0000 http://david.codeferous.com/?p=216#comment-50646 I also wrote a script that monitors the CPU usage of the DirectoryService process, and kills it (using the script above) if DS is hogging the CPU for several minutes straight. This has proven to be fairly effective at straightening out DS before it runs out of resources. Tweak it for your installation. ———————– <code> #!/bin/sh log=/var/log/checkDScpu.log cnt=0 while : do sum=0 # calculate the ten-second average CPU usage for DS for pct in `/usr/bin/top -l11 | /usr/bin/grep DirectoryS | /usr/bin/cut -c18-25 | /usr/bin/cut -f1 -d'%' | /usr/bin/cut -f1 -d'.' | /usr/bin/tail -10` do sum=`/bin/expr $sum + $pct` done sum=`/bin/expr $sum / 10` # log it (handy for making graphs) echo `/bin/date +%Y-%m-%d-%H%M%S` $sum% >> $log # if DS is using more than 95% CPU, remember it if [ $sum -gt 95 ] then cnt=`/bin/expr $cnt + 1` else cnt=0 fi # if DS uses more than 95% CPU for four minutes, kill it if [ $cnt -gt 3 ] then cnt=0 /usr/bin/mail -s 'DirectoryService CPU is running away; killing it' root /usr/bin/logger -p local7.notice -t "checkDScpu" "DirectoryService is running away with the server, killing it..." /usr/local/admin/killds.sh fi sleep 50 done </code> ———————– I also wrote a script that monitors the CPU usage of the DirectoryService process, and kills it (using the script above) if DS is hogging the CPU for several minutes straight. This has proven to be fairly effective at straightening out DS before it runs out of resources. Tweak it for your installation.

———————–

#!/bin/sh
log=/var/log/checkDScpu.log
cnt=0
while :
do
sum=0
# calculate the ten-second average CPU usage for DS
for pct in `/usr/bin/top -l11 | /usr/bin/grep DirectoryS | /usr/bin/cut -c18-25 | /usr/bin/cut -f1 -d'%' | /usr/bin/cut -f1 -d'.' | /usr/bin/tail -10`
do
sum=`/bin/expr $sum + $pct`
done
sum=`/bin/expr $sum / 10`
# log it (handy for making graphs)
echo `/bin/date +%Y-%m-%d-%H%M%S` $sum% >> $log
# if DS is using more than 95% CPU, remember it
if [ $sum -gt 95 ]
then
cnt=`/bin/expr $cnt + 1`
else
cnt=0
fi
# if DS uses more than 95% CPU for four minutes, kill it
if [ $cnt -gt 3 ]
then
cnt=0
/usr/bin/mail -s 'DirectoryService CPU is running away; killing it' root
/usr/bin/logger -p local7.notice -t "checkDScpu" "DirectoryService is running away with the server, killing it..."
/usr/local/admin/killds.sh
fi
sleep 50
done

———————–

]]>
Comment on One step forward… by david http://davidleber.net/?p=216&cpage=1#comment-50645 david Wed, 26 May 2010 20:15:41 +0000 http://david.codeferous.com/?p=216#comment-50645 Wow, I can't believe that this is still an ongoing issue. I've not needed to deal with it in years, but thanks for the script. ;david Wow, I can’t believe that this is still an ongoing issue.

I’ve not needed to deal with it in years, but thanks for the script.

;david

]]>
Comment on One step forward… by Jon http://davidleber.net/?p=216&cpage=1#comment-50644 Jon Wed, 26 May 2010 20:10:17 +0000 http://david.codeferous.com/?p=216#comment-50644 One helpful mod...it's a good idea to try killing the DirectoryService process more gently before using the -9 flag. I wrote a script that tries a "gentle" kill and resorts to the -9 if that doesn't work. It also restarts servermgrd and AppleFileServer, both of which are negatively affected by restarting DirectoryService. ----------------------- <code> #!/bin/sh dspo=`/bin/cat /var/run/DirectoryService.pid` /usr/bin/killall -HUP servermgrd /usr/bin/killall DirectoryService /bin/sleep 10 dspn=`/bin/cat /var/run/DirectoryService.pid` # if DS didn't stop gracefully, kill it harder if [ $dspo = $dspn ] then /usr/bin/killall -9 DirectoryService /bin/sleep 10 fi /usr/bin/killall AppleFileServer </code> ----------------------- One helpful mod…it’s a good idea to try killing the DirectoryService process more gently before using the -9 flag. I wrote a script that tries a “gentle” kill and resorts to the -9 if that doesn’t work. It also restarts servermgrd and AppleFileServer, both of which are negatively affected by restarting DirectoryService.

———————–

#!/bin/sh
dspo=`/bin/cat /var/run/DirectoryService.pid`
/usr/bin/killall -HUP servermgrd
/usr/bin/killall DirectoryService
/bin/sleep 10
dspn=`/bin/cat /var/run/DirectoryService.pid`
# if DS didn't stop gracefully, kill it harder
if [ $dspo = $dspn ]
then
/usr/bin/killall -9 DirectoryService
/bin/sleep 10
fi
/usr/bin/killall AppleFileServer

———————–

]]>
Comment on ERModernLook by Andrew http://davidleber.net/?p=402&cpage=1#comment-50638 Andrew Tue, 25 May 2010 01:09:31 +0000 http://davidleber.net/?p=402#comment-50638 Thanks, I saw that after I posted the message. I'll look at the screencast again too. Thanks, I saw that after I posted the message. I’ll look at the screencast again too.

]]>