mtrog007 Posted July 3, 2008 Share Posted July 3, 2008 I made a post in mac osx installation about me having a problem with my usb drive not properly loading and I had found a terminal script to make it work. Problem was that I didn't feel like typing it in every time I booted up. This is what you have to do per ~pcwiz :: Gather your code (my code for fixing my usb for instance is this) rm -R /System/Library/Extensions/Caches/ Simply open up Applications >> AppleScript >> Script Editor Type in :: do shell script "insert code here" with administrator privileges Note :: If the command does not need to be run as a root (with sudo superuser privileges), DO NOT put in "with administrator privileges" In my case, I would put in :: do shell script "rm -R /System/Library/Extensions/Caches/" with administrator privileges Note :: If you have multiple commands you would like to use in your script, you can put in multiple "do shell script" lines (one for each command) Now go to File >> Save As. Save it as an Application Bundle and in your whichever specified folder you want (mine will be in my applications folder). Double click it and it will ask you for your user password, then it will delete the caches directory (all as in my case). To have this run at startup, go to System Preferences >> Accounts >> Login Items and add it to the login items. 101% credit goes to ~pcwiz Link to comment Share on other sites More sharing options...
BuXb Posted July 3, 2008 Share Posted July 3, 2008 great - so now you can change your sig .. Link to comment Share on other sites More sharing options...
mtrog007 Posted July 3, 2008 Author Share Posted July 3, 2008 There we go, just did. Thanks for that reminder... Link to comment Share on other sites More sharing options...
~pcwiz Posted July 3, 2008 Share Posted July 3, 2008 Lol 101% credit Thanks for posting this mtrog007, will help many, I think this should be stickied Link to comment Share on other sites More sharing options...
mtrog007 Posted July 3, 2008 Author Share Posted July 3, 2008 I would have to agree with that one, however... you did have the knowledge of it ~pcwiz... just my Link to comment Share on other sites More sharing options...
thelogic Posted July 4, 2008 Share Posted July 4, 2008 mucho thx! finally can have synergy script running at start up... Link to comment Share on other sites More sharing options...
TheGreatDeceiver Posted July 4, 2008 Share Posted July 4, 2008 Lol 101% credit Thanks for posting this mtrog007, will help many, I think this should be stickied wonderful! is there a topic somewhere with useful scripts to run? e.g. I'd like to know the script to wake the display from sleep. Right now I have a corner of the display set to activate wake/sleep via mouse over. How would I make a script for that? thanks again Link to comment Share on other sites More sharing options...
mtrog007 Posted July 4, 2008 Author Share Posted July 4, 2008 Now all I need is some way to double click the fix only once, enter my pw only once, and instead of every time on startup it asks me my pw, it just runs the script Link to comment Share on other sites More sharing options...
macgirl Posted July 4, 2008 Share Posted July 4, 2008 even an easier solution: put this in /etc/rc.local #!/bin/sh rm -R /System/Library/Extensions/Caches/ make it executable (chmod 755) No need of writing passwords also Some say /etc/rc.local and /etc/rc.shutdown.local on Leopard are deprecated but still works (I tested it). great - so now you can change your sig .. Already edited. btw: Please read and follow the Signature and Avatar Rules Lol 101% credit Thanks for posting this mtrog007, will help many, I think this should be stickied Yes, but fisrt make it easy to read, everything centered is very "fancy" but hard to read. Link to comment Share on other sites More sharing options...
mtrog007 Posted July 5, 2008 Author Share Posted July 5, 2008 @macgirl I want to try your solution to not keep typing in password. However, /etc/rc.local? I can't even navigate to this on my computer. Little more detailed? Oh, and to tidy up my post I need some help. Is there any way I can make the "code" boxes smaller, or do I need to use "quote" boxes? Would you like it to not be centered? Edit: Also, thanks for tidying up my signature Link to comment Share on other sites More sharing options...
shimq1 Posted July 5, 2008 Share Posted July 5, 2008 I got to /etc by using "Go to Folder..." from Finder, but I can't seem to find a "rc.local" file. Is it okay if I made my own with TextEdit? Link to comment Share on other sites More sharing options...
mtrog007 Posted July 5, 2008 Author Share Posted July 5, 2008 I couldn't even get to /etc... I would really like to have this setup so I don't have to use my password everytime I log in Link to comment Share on other sites More sharing options...
~pcwiz Posted July 6, 2008 Share Posted July 6, 2008 mtrog007, You'll have to use some Terminal to edit it. Open Terminal, get into superuser mode (sudo -s or sudo su) and enter this: nano /etc/rc.local Edit it as you want and save it Link to comment Share on other sites More sharing options...
mtrog007 Posted July 6, 2008 Author Share Posted July 6, 2008 I typed it in, and I understand how to make it executable (chmod 755), but exactly how is my question. I'm supposed to make it "chmod 755 filename.sh" but someone's gonna have to walk me through this. Terminal = not my thing. Link to comment Share on other sites More sharing options...
~pcwiz Posted July 7, 2008 Share Posted July 7, 2008 chmod -R 755 <script path>/<script name>.sh Link to comment Share on other sites More sharing options...
mtrog007 Posted July 7, 2008 Author Share Posted July 7, 2008 I hate to keep asking, but how the hell am I getting bus error? all I'm doing is navigating to /etc/rc.local writing: #!/bin/sh rm -R /System/Library/Extensions/Caches/ write out chmod -R 755 /etc/rc.local/usbfix.sh === Bus error ??? Link to comment Share on other sites More sharing options...
~pcwiz Posted July 7, 2008 Share Posted July 7, 2008 Are you doing this with superuser privileges? Link to comment Share on other sites More sharing options...
mtrog007 Posted July 7, 2008 Author Share Posted July 7, 2008 Sure am. First thing I do is sudo -s, password Edit: oh, and I press enter after I put in the name of the script, if that means anything Link to comment Share on other sites More sharing options...
xtraa Posted July 7, 2008 Share Posted July 7, 2008 Add a sudo and try skipping the -R option, it is just necessary for folders aka kexsts. Link to comment Share on other sites More sharing options...
mtrog007 Posted July 7, 2008 Author Share Posted July 7, 2008 Does it matter where the sudo goes in the file name? I'm thinking it should go in the very front... Link to comment Share on other sites More sharing options...
~pcwiz Posted July 7, 2008 Share Posted July 7, 2008 Yeah, like: sudo Link to comment Share on other sites More sharing options...
mtrog007 Posted July 7, 2008 Author Share Posted July 7, 2008 I give up. Fu you bus error. I really do give up! *** sudo -s password nano /etc/rc.local #!/bin/sh [sudo] rm -R /System/Library/Extensions/Caches/ control o (write out) chmod [-R] 755 /etc/rc.local/usbfix.sh enter === bus error [] is for possible combinations. I have tried everything I can think of! Link to comment Share on other sites More sharing options...
~pcwiz Posted July 8, 2008 Share Posted July 8, 2008 Instead of "chmod -R 755" try doing "chmod +x". AFAIK chmod -R 755 sets permissions, I always use chmod +x to make my scripts executable. Link to comment Share on other sites More sharing options...
mtrog007 Posted July 9, 2008 Author Share Posted July 9, 2008 How about that sticky? I think this is crucial to some folks who don't have an answer to their problems except through terminal... Link to comment Share on other sites More sharing options...
Recommended Posts