Run the "nice" command on startup?

Hi all,
Since I've experienced overheating problems, I've dug a little and discovered this wonderful "nice" command, that's currently letting me install Windows 7 on a VM thanks to VirtualBox without turning my logic board into a critter. My question is, is there a way (and a good reason) to run this command right after booting up, say via AppleScript? I haven't noticed any sluggish behavior when running this command, but right now, VirtualBox is running, and my temp censor displays readings oscillating between 60°C and 70°C, far below the 120°C I've noted yesterday, right before my MBP shut down from exhaustion...
So, how-to...?
Message was edited by: Didier Caizergues

Get more memory. My system started paging like crazy when running Virtual PC.
The point of this topic was, how do I automatize this running "nice" in Terminal. I already added Terminal to my Startup Items, but it merely opens at the prompt, and I have to manually enter "nice", then return, to enter "nice mode". Haven't thought of typing "renice" since I started using this function...
You can invoke terminal ( unix ) commands from an applescript program. I am not familiar with nice, but the following applescript file did start up Windows. I could not figure out whether or not the nice command did anything.
The first thing that you need to do is to make the text into an AppleScript program.
Start the AppleScript Editor
/Applications/AppleScript/Script Editor.app
In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
Copy the script text to the Applescript editor.
Save the text to a file as an application and do not check any of the boxes below.
!http://farm4.static.flickr.com/3544/3390737677_645a847e28.jpg?v=0!
If you want access to the script from your Script Menu, move the script (the saved script application file) to your
~/Library/Scripts folder. You can also drag it to your Dock or make an alias for it on the Desktop.
-- Write a message into the event log.
-- To see this output, run from script editor after clicking on Event Log tab.
log "  --- Starting on " & ((current date) as string) & " --- "
set my text item delimiters to ", "
try
   set theFile to escapeString("/Users/mac/Documents/virtual pc version-7.0/Windows XP Professional.vpc7")
   log theFile
   set see to "nice -n 5 open " & theFile
   log "see= " & see
   set results to do shell script see
on error
   display dialog "error results for " & see
end try
on escapeString(thisString)
   set thisString to alterString(thisString, "\\", "\\\\")
   set thisString to alterString(thisString, " ", "\\ ")
   set thisString to alterString(thisString, quote, "\\" & quote)
end escapeString
on alterString(thisText, delim, replacement)
   set resultList to {}
   set {tid, my text item delimiters} to {my text item delimiters, delim}
   try
      set resultList to every text item of thisText
      set text item delimiters to replacement
      set resultString to resultList as string
      set my text item delimiters to tid
   on error
      set my text item delimiters to tid
   end try
   return resultString
end alterString

Similar Messages

  • Running the curl command on a WSA

    Has anybody tried running the curl command on a WSA? - we're running Async OS 7.1 on our S-660's and unable to run curl on it.
    Thanks.
    Greg                  

    HI Andy,
    Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Format-Table Name, DatabaseSize, AvailableNewMailboxSpace
    THis will give you the following info:
    Where availablenewmailboxspace (last collum) is white space.
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you. Thank you! Off2work
    Thats not the true amount:
    Since 2010:
    http://blogs.technet.com/b/exchange/archive/2011/12/14/database-maintenance-in-exchange-2010.aspx
    How can I check whitepace in a database?
    You will need to dismount the database and use ESEUTIL /MS to check the available whitespace in a database. For an example, see
    http://technet.microsoft.com/en-us/library/aa996139(v=EXCHG.65).aspx (note that you have to multiply the number of pages by 32K).
    Note that there is a status property available on databases within Exchange 2010, but it should not be used to determine the amount of total whitespace available within the database:
    Get-MailboxDatabase MDB1 -Status | FL AvailableNewMailboxSpace
    AvailableNewMailboxSpace tells you is how much space is available in the root tree of the database. It does not factor in the free pages within mailbox tables, index tables, etc.  It is not representative of the white space within the database
    Twitter!: Please Note: My Posts are provided “AS IS” without warranty of any kind, either expressed or implied.

  • Error Running the following command - "ipsadmin change component iwtUserInfoProvider iwtUserInfoProvider.xml". Please help?

    I am trying the run the ipsadmin command as follows:
    "ipsadmin change component iwtUserInfoProvider iwtUserInfoProvider.xml"
    And I am getting the following error:
    "Profile change failed. More info: com.iplanet.portalserver.ipsadmin.Component"
    I just added some more attributes to the xml file
    that look like these :
    <!- BEGIN NEW ATTRIBUTES -->
    <iwt:Att name="iwtUserInfoProvider-EntryDN"
         desc="Entry DN"
         type="string"
    idx="a204"
         userConfigurable="TRUE">
         <Val>New</Val>
         <Rperm>ADMIN</Rperm><Rperm>OWNER</Rperm>
         <Wperm>ADMIN</Wperm><Wperm>OWNER</Wperm>
    </iwt:Att>
    <!- END NEW ATTRIBUTES -->
    Question:
    1. What did I do wrong?
    2. Is there a log file that stores the ipsadmin
    errors?
    ./ipsadmin -chkxml iwtUserInfoProvider.xml
    returned "Operation completed successfully".
    So I know there is nothing wrong with the xml
    file.
    Any help in fixing this problem is gratefully appreciated.
    Thanks
    Sahadev

    Hi There,
    The ipsadmin tool does not seem to be able to dynamically add any new attributes to a component. the best would be to do a "ipsadmin delete component iwtUserInfoProver" and then "ipsadmin -import iwtUserInfoProvider.xml" this should "update" the component with the new attribute.
    HTH.

  • Use the nice command to set priorty

    hay everyone =)
    could someone please exspain to me how to use the nice/renice command in terminal to set the priority of a running app so it runs faster, i also noted that my cpu always has like 90% idle and i would like to be able to tap into that if at all possible

    Hello,
    http://www.ernieflores.net/osx-page-3/give-your-app-in-osx-more-power-sudo-renic e-20-processidhere/
    Note: typing in admin password won't be reflected for security reasons, just carefully type it & hit enter.

  • Cron job help- Need to run the Autobuddy command every night...

    I have not written anything in the form of a Unix script for YEARS and YEARS. Our XServe was built in Advanced mode, currently running 10.5.4 Server. On this box, we are running Wiki and iChat. Since we built this box as an Advanced box the "Autobuddy" option was not available.
    I have since enabled it at the command line, but I am told by Apple that there still needs to be a command run after every time a user logs in if you want others to Autobuddy. That command is this:
    "sudo /usr/bin/jabber_autobuddy -m"
    Now I think this would be pretty easy to setup as an automatic cron script, but like I said, I have not written something like this in forever. Not to mention, I am not 100% sure what needs to happen since running the script with an sudo command will prompt for the root password.
    I was wondering if anyone would be able to help me write the script up, and give me some instructions on how to install it. I just want it run everyday, midnight is fine, I don't really care. All I know is that we have a dept of 150 people, and it grows and shrinks all the time. They can deal with a new user not being seen for 24-48 hours, I just want to get this automated.
    Any helps would be GREATLY appreciated!
    Thanks
    Tom

    If you want to keep it simple try [CronniX|http://www.abstracture.de/projects-en/cronnix] a graphical tool for setting up CRON jobs on OSX. Whilst I have not actually done an autobuuddy in this way, I cannot see any reason why it will not run as a Cron Job.
    The proper way ideally would be to use the launchd service.
    Something like this should work:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.jabber.dailyautobuddy</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/jabber_autobuddy</string>
    <string>-m</string>
    </array>
    <key>LowPriorityIO</key>
    <true/>
    <key><UserName></key>
    <string>admin</string>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>0</integer>
    <key>Minute</key>
    <integer>05</integer>
    </dict>
    </dict>
    </plist>
    (not sure why, but tabs are not showing up, making this hard to read)
    Message was edited by: Tim Harris

  • #30 | can i run the Terminal Command to stop Snapshots with no problems?

    i am somewhat surprised to find out that the 75 GB of "Backups" that are taking up space on my MBP may be due to some "feature" in Mavericks or the new OS's or whatever and i have had to MOVE all my data off my laptop as a consequence of this over the last two months because i have no more space on my Hard Drive.
    is it legit and OK to follow the terminal commands in #30 without having any problems?
    i am on a mid 2009 MBP running Mavericks and i have a 2 TB Time Capsule that i am wirelessly backing up my data.
    as some kind of sadistic test in advance of running this terminal command - can i plug my laptop into the Time Capsule, unplug the laptop from the time capsule, restart and see how much space got recaptured on my HD for my data?
    i mean, well - i must be missing something but i mean i am hoping i can get this to stop so i can get my data back on my laptop. i'm walking around with an external HD of all my Mac Pro information just so i can get work done when i go to a coffee shop or something.

    for those suffering through this:
    https://discussions.apple.com/message/24878591#24878591
    In Terminal:
         sudo tmutil disablelocal
    Turn off local Time Machine snapshots and trigger automatic cleanup of accumulated local snapshot data. Requires root privileges.
    (use sudo tmutil enablelocal to turn back on)
    this got rid of my 75 GB backup file (!!) and now i am going to move my data back to my laptop...
    not sure if there is an apple tech article to link to regarding this issue but it would be good to post if there is one.

  • How do I run the namesctl command on linux? Where is it?

    I'm new on oracle , and I'm working on gentoo I installed oracle10g standar version, but I want to register an Oracle Names Server Entry, as far I kow, I have to use the namesctl command, but I don't know where is it? so the Oracle Net8 Assistant doesn't either,
    Thanks in advance

    Accxording to the 'What's New in Oracle Net Services?" chapter of "Oracle® Database Net Services Administrator's Guide - 10g Release 2 (10.2)" manual at http://docs.oracle.com,
    "De-support of Oracle Names"

  • Run the Task Manager on startup. How?

    Hi
    I installed the final windows 8 from dreamspark. Now i always started the task manager automatically at the start up. I tried to do the same with windows 8 by adding a taskmgr.exe shortcut (located at c:\windows\system32) at the startup folder (c:\users\"username"\appdata\roaming\microsoft\windows\start
    menu\programs\startup). Now the task manager can be seen in the startup tab in the taskmanager, but when i restart my computer, the task manager doesn't start.
    Does anybody here know the solution to this problem?

    Doesn't work me after these setting...............I don't know why? Can someone help me please?
    Running Windows 8.1 with 4go DDR2 ram.
    First, start Task Manager manually (Start,
    taskmgr, Enter) and enable
    Options->
    Hide when minimized.
    Then, in Windows Explorer, open following folder:
    C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
    If you want this to be active for all users, open this folder instead:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    Now, right click on empty space, select New->
    Shortcut. Type in
    taskmgr, click
    OKand Finish.
    You are not done yet! Right click on new taskmgrshortcut, select
    Properties. Now, in
    Shortcuttab, configure
    Run-> Minimized.
    Now, reboot. After you switch to desktop again, make sure you configure
    Control Panel->
    Notification Area Iconssuch that
    Windows Task Manageris set to
    Show icon and notifications(default setting is
    Only show notifications).
    Doesn't work me after these setting...............I don't know why? Can someone help me please?

  • Running the Eseutil command on each Exchange database to verify database whitespace

      could you offer guidance  on step by step  how to check the the whitespace on multipe database on  server  using  Eseutil command /MS for exchange 2013

    HI Andy,
    Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Format-Table Name, DatabaseSize, AvailableNewMailboxSpace
    THis will give you the following info:
    Where availablenewmailboxspace (last collum) is white space.
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you. Thank you! Off2work
    Thats not the true amount:
    Since 2010:
    http://blogs.technet.com/b/exchange/archive/2011/12/14/database-maintenance-in-exchange-2010.aspx
    How can I check whitepace in a database?
    You will need to dismount the database and use ESEUTIL /MS to check the available whitespace in a database. For an example, see
    http://technet.microsoft.com/en-us/library/aa996139(v=EXCHG.65).aspx (note that you have to multiply the number of pages by 32K).
    Note that there is a status property available on databases within Exchange 2010, but it should not be used to determine the amount of total whitespace available within the database:
    Get-MailboxDatabase MDB1 -Status | FL AvailableNewMailboxSpace
    AvailableNewMailboxSpace tells you is how much space is available in the root tree of the database. It does not factor in the free pages within mailbox tables, index tables, etc.  It is not representative of the white space within the database
    Twitter!: Please Note: My Posts are provided “AS IS” without warranty of any kind, either expressed or implied.

  • When running the netsat command as a non-root user

    I get the following error:
    test@testserver1# netstat -i
    ip open: Permission denied
    can't open mib stream: Bad file number
    test@testserver1# which netstat
    /bin/netstat
    test@testserver1# ls -al /bin/netstat
    -r-xr-sr-x 1 root sys 55180 Jan 6 2004 /bin/netstat
    test@testserver1#
    test@testserver1# ls -ald /bin
    lrwxrwxrwx 1 root root 9 Nov 9 2002 /bin -> ./usr/bin
    test@testserver1#
    test@testserver1# ls -ald /usr
    drwxr-xr-x 40 root sys 1024 Nov 21 09:45 /usr
    test@testserver1# ls -ald /usr/bin
    drwxr-xr-x 4 root bin 9216 Oct 2 23:53 /usr/bin
    test@testserver101#
    Support Team

    You don't say what OS, but in Solaris 8 make sure:
    ls -l /devices/pseudo/ip@0:ip
    crw-rw---- 1 root sys 3, 0 May 3 2006 /devices/pseudo/ip@0:ip
    And in 10:
    $ ls -l /devices/pseudo/ip@0:ip
    crw-rw-rw- 1 root sys 3, 0 Jan 10 14:31 /devices/pseudo/ip@0:ip
    It's worth learning truss or dtrace, you can debug file open failures like this quite easily and quickly.

  • HT201372 I hade to run the following command

    sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app

    and ?
    What is the question.
    the createinstallmedia is for creating a SD /USB Flash drive installer for Mavericks.
    http://support.apple.com/kb/HT5856

  • "nice" command denied in terminal even as root user

    Hello,
    I am trying to run the "nice" command in terminal as an admin (me):
    nice -n -19 /Users/Michael/Desktop/Minecraft.app
    It failed with this error:
    nice: /Users/Michael/Desktop/Minecraft.app: Permission denied
    So I logged in a the root user and tried again and it still had the same error.
    I have 2 main questions:
    1, Why couldn't I run this command as a root user?
    2. As an admin, shouldn't I have been able to run the command without logging in as the root user?

    I hope it's ok if I bump.
    bump

  • Having trouble in running a unix command and getting the output

    Hi,
    I am trying to run a unix command from within the java code. I am not able to make it work. I am enclosing the code and the error message that I am getting. Any help is highly appreciated.
    import java.io.*;
    public class RunCommand {
        public static void main(String args[]) {
            String s = null;
            try {
                Process p = Runtime.getRuntime().exec("cat UNIX_ASCII_TEXT_FILE | A_UNIX_PROGRAM -d");
                BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
                BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
                // read the output from the command
                System.out.println("Here is the standard output of the command:\n");
                while ((s = stdInput.readLine()) != null) {
                    System.out.println(s);
                // read any errors from the attempted command
                System.out.println("Here is the standard error of the command (if any):\n");
                while ((s = stdError.readLine()) != null) {
                    System.out.println(s);
                System.exit(0);
            catch (IOException e) {
                System.out.println("exception happened - here's what I know: ");
                e.printStackTrace();
                System.exit(-1);
    }The error message that I am getting is
    Here is the standard output of the command:
    SLu|%%$$=
    Here is the standard error of the command (if any):
    cat: cannot open |
    cat: cannot open A_UNIX_PROGRAM
    cat: cannot open -dLooks like the cat command is working and not the pipe command and the command after the pipe. But when I run the UNIX command from the command prompt I get the expected result.

    You might read this article and see if its approach works.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Set env using a script and run the command (dependency on the env)

    I need to set the env varaible by running a shell script with arguments as 'ksh setEnviron r6.1' and then run the command in the
    same process. the command has dependency on the previous script which sets the env variables.
    With Runtime.getRuntime().exec( cmd1); ,Runtime.getRuntime().exec( cmd2); I am not able to execute the Cmd2 as it is running in different process.
    How do solve this issue.
    Is there any other method to run the command to set env variables and run the second command.(dependent on the env) to get the output.
    Please help me out in this.

    ganesh_mak wrote:
    final String[] commands = {
                              ". setEnviron r6.1",
                                "/usr/add-on/test/Xbin/sql name from list where date.eq.05/22/08",
    Process penv = Runtime.getRuntime().exec("/bin/sh");
    BufferedReader br = new BufferedReader( new InputStreamReader( penv.getInputStream() ) );
    BufferedReader stdError = new BufferedReader(new InputStreamReader(penv.getErrorStream()));
    final OutputStream writer =  penv.getOutputStream();
    for (int i=0; i<commands.length;i++)
         writer.write(commands.getBytes("utf-8"));
         writer.write("\n".getBytes());
    String line;
    while((line = br.readLine())!=null){
    System.out.println(line);
    br.close();
    writer.close();
    I tried the above code but its not working...............
    please correct me.
    Do you think I used the '-i' argument just for fun? Did you do a 'man sh' and 'man bash' to see what the arguments do? If not then do it now.
    Do you think I used Theads to process stderr and stdout just for fun? I've shown you the basic approach. I have shown you how you need to create Threads to process stdout and stderr. If you have not understood and you have not studied http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html then do so now.
    Edited by: sabre150 on Jun 2, 2008 3:43 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sqlagent90.exe keeps running in a command window

    HELP!, This is annoying and beyond belief.  I installed SqlServer Developer edition without any problem than I installed SqlServer Express and now whenever I boot my PC, I have a command window that appear with nothing in it and the following title:
    "C:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Binn\SQLAGENT90.EXE"
    Now if I go to the Task Manager and kill the SQLAGENT90.EXE process, it goes away for a second than comeback with the nice command windows.
    Any idea what's wrong and how I can get rid of it?
    Bye the way, everything else seems to be working fine with the application.
    Thanks,
    Claude.

    Claude,
    Some how the service was marked as allowed to interact with the desktop. This is not the default configuration and there is no need for it, so I'm not sure how you ended up in this state. To clean this us launch the service control manager (Control Panel -> Administrative Tools -> Services), scroll down to the Agent service (SQL Server Agent (instance name)) and double click it to bring up the Properties page. On the Properties page select the Log On tab. The service is probably running as Local System, below this is a check box labeled "Allow service to interact with desktop", uncheck that box, press the Apply button, go to the General tab and stop and start the service. You should no longer see the cmd window pop up. Click OK to dismiss the Properties page.
    Cheers,
    Dan

Maybe you are looking for