Command line method to obtain DNS and proxy info?

Hello All,
I have poked around the man pages but am not making any progress on this. I am looking for a command that would query the network to find a) whether there is a DNS server, and b) if there is, what the domain and IP address is. Similarly, if there is a proxy server being advertised, how would I get the IP address and port number info from the command line? The command cannot depend on the machine already being configured for DNS or running DHCP because in the majority of cases where I need it, the machine has been set to a fixed IP address and the customer may not know the DNS & proxy information. Right now I am relying on them going to a Windows system and running the ipconfig /all command.
Any help on this would be apreciated. Thanks,
Mausul.

Ok, I tried that, but it seems there is a catch -- I have to first configure the system for DHCP, then the dhcpinfo command will display these values that it obtained from the DHCP server. The problem with that approach is this -- if there is no DHCP server, it will sit there for a long time with the interface "pending command" while it searches. Can I test for the presence of a DHCP server without actually attempting to configure the interface? As I am typing this, I think one way to cheat might be to create a clone of the interface and try to configure the clone for DHCP...

Similar Messages

  • We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a

    We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a printer."C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /T "\\<Application Server>\Report\<TEST.PDF>" "<Printer Name>". Current Situation: The above command line parameter when executed is working as expected in a User's Workspace. When executed in a command line on the Application Server is working as expected. But, the same is not working while executing it from Deployed environment.Software being used: 1. Adobe 11.0 enterprise version. 2. Webshpere Application Server 8.5.5.2. Please let us know if there is a way to enable trace logs in Adobe Reader to further diagnose this issue.

    This is the Acrobat.com forum.  Your question will have a much better chance being addressed in the Acrobat SDK forum.

  • How can I use srvctl command line for change "Failover type" and "F method"

    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.

    user10674190 wrote:
    Hi all,
    I am using Oracle One Node (11.2.0.3), and I have a service:
    /u01/11.2.0/grid/bin/srvctl config service -d orcl
    Service name: orcldb
    Service is enabled
    Server pool: orcl
    Cardinality: 1
    Disconnect: false
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Failover type: NONE
    Failover method: NONE
    TAF failover retries: 0
    TAF failover delay: 0
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition:
    Preferred instances: orcl_1
    Available instances:
    I would like to change "Failover type" and "Failover method" to:
    Failover type: SELECT
    Failover method: BASIC
    How can I do that? Is there any graphical tool for it? Or, How can I use srvctl command line for change it?
    Thanks in advance.
    Leonardo.srvctl modify service -d database_name -s orcldb -q TRUE -m BASIC -P BASIC -e SELECT -z 180 -w 5 -j LONG
    Also see
    11gR2(11.2) RAC TAF Configuration for Admin and Policy Managed Databases [ID 1312749.1]

  • Is there a command line method for publishing/deploying reports?

    Is it possible to publish/deploy reports using the command line? 
    Also, it is possible to change the datasource for a report via some command line option?
    I am developing the reports locally (Win XP), and then checking them into source control.  They need to be deployed to a BO Server for Dev, Test and Prod.
    I would like to be able to create a script to deploy the reports into the different environments.
    In addition, the datasource needs to be changed before deploying to TEST (since it is on the same server as DEV, just a different port).  Having to manually open each report and change the datasource as the reports are migrated could get to be time consuming as the number of reports increases.
    Thanks for any suggestions.
    Paul

    Hi Paul,
    No, but you can do all of this using one of our SDK's. Look for samples above or from this WIKI:
    Root Page
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsHome
    Enterprise Samples (including managed and unmanaged ras)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsSDKSampleApplications
    Non-Enterprise Samples
    http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
    Exporting Samples (RAS)
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Thank you
    Don

  • From the command line, print only page 2 and 3?

    What is the syntax for the command line, for print ONLY page nr° 2 and nr°3 of a pdf file, skipping page nr°1?
    Thanks

    Not possible.

  • Trying SSH CLI ,  reading command line method is infinte loop problem!

    I am trying excute command and reading result. but reading result part has problem.
    below source is a part of my method.
    try{
                   SessionChannelClient sessionChannel = ssh.openSessionChannel();
                   sessionChannel.startShell();
                   OutputStream out = sessionChannel.getOutputStream();
                   String cmd = s + "\n";
                   out.write(cmd.getBytes());
                   out.flush();
                   InputStream in = sessionChannel.getInputStream();
                   BufferedReader br = new BufferedReader(new InputStreamReader(in));
                   byte buffer[] = new byte[255];
                   String read= "";
                   while (true) {
                        String line = br.readLine();
                        if (line == null)
                             break;
                        str += line;
                        str += "\n";
                   System.out.print(str); //print result
                   sessionChannel.close();
                   in.close();
                   out.close();
              }catch(IOException ee){
                   System.out.println(ee);
              }finally{
                   System.out.println("=============end cmd=============");
    while loop has problem. While statement has infinite loop problem.
    why has this problem?
    anybody, help me please. Thanks for reading .
    Edited by: BreathAir on Aug 5, 2008 12:16 AM

    That loop will loop until readLine() returns null, which will only happen when the other end closes its end of the connection, and it will block while no data is available.

  • Command Line/Console Mode Menu's and ASCII-Graphics

    Dear Sun java friends:
    Pardon me if this has been asked. I have used the search function but have been unable to find useful information.
    I am developing a series of programs to parse servers logs and compute certain statistics. There will also be a real-time monitor of active connections. This would be an extrodinarily simple task with swing and awt, but i am limited to the console mode only. In my quest for neatness (i do not want a continious screen scroll of active connets/disconnects with System.out), i am looking for a way to create simple ASCII-like graphics, not much unlike the TSR's from the old DOS days.
    Obviously, System.out.println() does not give me the power i need. I would like to be able to print text/characters at a certain x,y coordinate. Is it even possible with Java? Where can i look for tutorials or get more information?

    There is no standard package in Java for console graphics but a number of third party packages exist. For example the ncurses library has been ported to Java, do a web search on "java curses." IIRC it's open source but I've never used it..

  • Command line parameters and resuming

    Hi,
    I am researching for a client who wishes to have several students (K-12) using Adobe Captivate course on the same computer. Another constraint is that a course is run from DVD (1+ GB in size) so it's published as standalone application (.exe for Windows, .app for Mac). Quick questions:
    Can a course have an action to parse command line parameters? I haven't found that.
    Explanation: this would be used to simply parse a name and e-mail address (if possible) and last module passed to a course player. Resuming could be disabled (there is an answer how to do that in the forum) or overridden but the learner should be transferred to a slide to resume based on the calling parameter (and not the default resuming - there will be several users so each must resume from the last passed module slide).
    Can a progress of the current learner using the course be saved to a database (no LMS, e-mail, Acrobat.com etc)?
    Explanation: this is needed for the current learner and for each one separately. I guess I already have a solution in mind (custom application, having small internal web server like Mongoose, with a script that replaces internalServerReporting.php and saves the data to a internal database, SQLite). But for this to work spawning a course with command line parameters and course itself reading these parameters would need to work.
    If there is a (better) solution for the above, please reply. The goal is have minimal changes on the course e.g. if there are command line parameters, then parse them and do something (mark modules passed, open appropriate next slide). If parameters are not given/recognized, do nothing (so the course would still work on computers used by one learner only, including resuming etc).
    My opinion is that this should also be one-way as much as possible. E.g. additional application handles user name, e-mail and current progress and spawns Captivate course. The published course itself should not depend on the application like reading progress from a text file (though an URL call could return current progress from an application for the same user name). So ideally only changes to use internal server publishing to save current progress and adding a logic to check parameters at start would be applied to a course.
    Waiting for your smart answers.
    Matt

    DVDs, when finalized, are read-only... so unless you are considering to do an Install of the course from the DVD to the machine, you're not going to be able to write to a database.  A USB stick may be more suitable in this situation.
    Command line params are not possible with EXEs unless you create your own EXE wrapper.  If you're going to go through that trouble, you'd be better off creating an Adobe Air application that can run your local web content without security restrictions and use SQLite or some other backend to store the data.
    Can the progress be saved?  It depends what you mean by progress.  If you just want to allow the student to resume from the slide where they left off... you can do that with a bit of JavaScript.  However, if you want to ensure that any previous questions answered on a quiz were also resumed and intact from the previous session... not possible without an LMS.
    Why not run a Moodle installation via a USB stick and you can have a full featured LMS with a database and ability to resume a previous session?
    http://docs.moodle.org/19/en/Installation_guide_-_Moodle_for_Windows_on_a_USB_Memory_Stick
    Just some things to consider...

  • 'autorotate and center' command line option for acroread toPostscript

    Hello,
    Is there a command line option available for 'autorotate and center' (like in the graphical view of acroread) while you convert a pdf to postscript on command line?
    I must convert an A4 pdf to 'portrait' letter (fanfold). With the command below, everything is fine only the pdf is not rotated.
    My command looks like:
    acroread -toPostScript -size 792x612 -shrink -expand < pdffile.pdf
    Mvg,
    wim

    Hello,
    Our application generates A4 pdfs (reports) in portrait format. Now we have some matrix printers (Epson LQ680Pro) which are feeded with fanfold letter paper (11x8.5in - 792x612pix). The fanfold paper hangs on each other with the larges side (11in) - 90° rotated as by 'normal' paper.
    What we have to do, is rotate (90°) and scale (A4 to letter) our pdf before we can print it correclty.
    I've now fixed it with following commands (because acroread can't rotate, we use pdf90 to rotate our pdf first):
    pdf90 --outfile tmp.pdf report.pdf;
    acroread -toPostScript -size 792x612 -shrink -expand < tmp.pdf | lpr -P Epson_LQ680Pro -o Resolution=180dpi -o PageSize=FanLetter;
    note: the Fanletter papersize is a self-defined papersize in the pdd for the printer.
    Sincerely,
    Wim

  • JAVA command line options -cp and -jar don't work together?

    Running JSDK 1.4.2 under Windows. I have a Java application that tries to dynamically load a class name that the user enters as follows:
    try {
    classResult = java.lang.Class.forName(strFilterName);
    catch (ExceptionInInitializerError e) {
    strErrorMessage = "ExceptionInInitializerError loading class: " + strFilterName;
    catch (LinkageError e) {
    strErrorMessage = "LinkageError loading class: " + strFilterName;
    catch (ClassNotFoundException e) {
    strErrorMessage = "ClassNotFoundException loading class: " + strFilterName;
    This works fine if the classes that make up my application are left as class files in the classpath, but fails to work if they have been collected and run from a JAR file. Note: I can even dynamically load the class when running from the JAR file, if the class I'm trying to load is within that JAR file too. The problem really occurrs when the dynamically loaded class is located someplace else in my classpath. I've tried using various combinations of the "-cp" and "-jar" Java command line options - but when loading and running from a JAR file - the "-cp" parameters seem to be ignored. Is this a bug? Has anyone ever seen this before?
    I run my program from the JAR file using this command:
    java -cp .;e:\entmgr\filters -jar EntMgr.jar
    Where "e:\entmgr\filters" is where the class I'm trying to dynamically load is. (This class has no package name, but loads perfectly as long as I'm not running the application from the JAR file). The class name specified by the user has to be fully specified with a package name (if it has one).
    I have tried forcing the "java.lang.Class.forName(strFilterName);" call to use the system class loader, the parent of the system class loaded, and even the null bootstrap class loader - all with no success.
    I am suspecting that the class loader that is loading and running my main program from the JAR file, is just not paying any attention to the "-cp" parameter when the "-jar" parameter is present. Indeed, I have never seen any change in the failure, no matter what I put in the "-cp" parameter when using the JAR file.
    When I run this without using the JAR file, here is the command I execute:
    java -cp .;davidp\snmp;filters davidp.snmp.EntMgr
    Where this is executed in a directory that has a "filters" and "davidp\snmp" directory. In this case, because the "filters" directory is in my class path - I can dynamically load my class from it using just its simple name (i.e. "TestTrapFilter").
    So, is there some bug that precludes the "-cp" parameter from working correctly when the "-jar" parameter is used? Is there some other way to initialize or set up the classloader I'm using, so it can find things outside of the JAR file I'm running from? I would hope that it is possible to get the same behavior from my program, no matter if it is run from a JAR file or not.
    Thanks for any assistence!
    Dave

    These posts are pretty old, but this page came up in a google search while I was having the same problem, so I thought I would throw my own (Later found) solution in.
    The -cp and -jar options did not work together for me, but I later learned that they didn't really have to (and you don't have to mess with jar manifest files).
    While on the command line, if you want to set a specific class path and also run a jar, all you need to do is add the jar to whatever extra class path you need to use in the -cp <arg>, and then specify which class you want run from inside the jar.
    IE:
    java -cp <YourSpecialClasspath>: <PathToJar> <ClassToRunInsideOfJar>
    in my case it was like:
    java -cp /home/user/WebRCP.jar:./StandaloneInstaller.jar InstallLoader
    Remember to put a ":" in between the two arguments for the class path (-cp).
    Hope this helps someone in the future,
    -Josh

  • Problem with tokenized  input from command line

    I am trying to take an input from the command line, parse it to tokens and perform whatever operation is needed depending on the name of the token, on a binary tree of stacks for example, if i type 1 2 1 3 printLevelOrder, then the root of the tree should have 3, 2,1 in the stack, the left child should have 1 and the right child should be empty. and then a level order print of the tree should be performed.
    however what is happening when i run this code is the numbers are being put into the right stacks of the tree, but any commands such as printLevelOrder or PrintPopRoot are entering the code that is for placing numbers onto the stack instead of executing that command and skipping past this piece of code.
    so my question is, why is the if statement if (word =="printLevelOrder") not being executed when thats whats in the word ?
    example input and output shown below code fragment.
              try {
                  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                 String line = "";
                 while (line != "***") {
                      System.out.print("> prompt ");
                      line = in.readLine();
                      StringTokenizer tokenizer = new StringTokenizer(line," ");
                      String word = new String();
                      while (tokenizer.hasMoreTokens()) {
                             word = tokenizer.nextToken();
                             boolean notCommand = true;
                             if (word =="printLevelOrder") {
                                  theTree.printLevelOrder();
                                  System.out.println("(word ==printLevelOrder)");
                                  notCommand=false;
                             if (word == "printPopLevelOrder") {
                                  theTree.printPopLevelOrder();
                                  notCommand=false;
                             if (word == "printPopInorder") {
                                  theTree.printPopInorder();
                                  notCommand=false;
                             if (word == "printPopPreorder") {
                                  theTree.printPopPreorder();
                                  notCommand=false;
                             if (word == "printPopRoot") {
                                  theTree.printPopRoot();
                                  notCommand=false;
                             if (word == "***") {
                                  notCommand=false;
                             if (notCommand == true) {
                                  System.out.println("(notCommand == true)");
                                  boolean notPlaced = true;
                                  int v = 1;
                                  while ((notPlaced==true) && (v < theTree.size())) {
                                       if (theTree.element(v).isEmpty()) {
                                            theTree.element(v).push(Integer.valueOf(word));
                                            System.out.println("Inserting"+word);
                                            System.out.println("in empty stack at location: "+v);
                                            notPlaced=false;
                                       if (notPlaced==true) {
                                            if (  Integer.valueOf(word) >= Integer.valueOf( theTree.element(v).top().toString() )  ) {
                                                 theTree.element(v).push(Integer.valueOf(word));
                                                 System.out.println("Inserting"+word);
                                                 System.out.println("in stack at location: "+v);
                                                 notPlaced=false;
                                       v++;
              }valid inputs: int value, printLevelOrder, printPopLevelOrder, printPopInorder, p
    rintPopPreorder, printPopRoot, *** to quit
    prompt 1 3 2 4 2 printLevelOrder(notCommand == true)
    Inserting1
    in empty stack at location: 1
    (notCommand == true)
    Inserting3
    in stack at location: 1
    (notCommand == true)
    Inserting2
    in empty stack at location: 2
    (notCommand == true)
    Inserting4
    in stack at location: 1
    (notCommand == true)
    Inserting2
    in stack at location: 2
    (notCommand == true)
    Exception in thread "main" java.lang.NumberFormatException: For input string: "printLevelOrder"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:447)
    at java.lang.Integer.valueOf(Integer.java:553)
    at TreeStack.main(TreeStack.java:73)
    Press any key to continue . . .

    lol aww, shame that you forgot to do that. i had 10 / 10 for mine, and seing as the deadline is now well and trully over,
    here is the entire source for anybody who was following the discussion or whatever and wanted to experiment.
    additional files needed >
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/Stack.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/ArrayStack.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackEmptyException.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackFullException.java
    /*TreeStack.java - reads command line input of values and assigns them to stacks in a  binary tree and performs
    operations on the ADT. valid inputs: <int>,   printLevelOrder,   printPopLevelOrder,
    printPopInorder,   printPopPreOrder,   printPopRoot.         Terminates on invalid input.
    Written by George St. Clair.
    S/N:0208456         22/11/2005
    import java.util.Vector;
    import java.io.*;
    import java.util.StringTokenizer;
    public class TreeStack {
         private final int TREE_CAPACITY = 7 + 1;
         private final int STACK_CAPACITY = 10;
         Vector tree = new Vector(TREE_CAPACITY) ;
         //collect input from command line, add values to stacks at nodes of the teee
         //and perform required operations on the treestack
         public static void main (String [] args) {
              //create a tree of stacks
              TreeStack theTree = new TreeStack ();
              try {
                   //collect standard input
                  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                 String line = "";
                 while (line != null) {
                        System.out.print("");
                      line = in.readLine();
                      //tokenise input
                      StringTokenizer tokenizer = new StringTokenizer(line," ");
                      String word = new String();
                      while (tokenizer.hasMoreTokens()) {
                             //assign word to the token
                             word = tokenizer.nextToken();
                             boolean notCommand = true;
                             //perform operation on treestack depending on what word is
                             if (word.equals("printLevelOrder"))  {
                                  System.out.println("printLevelOrder");
                                  theTree.printLevelOrder();
                                  notCommand=false;
                             if (word.equals("printPopLevelOrder"))  {
                                  System.out.println("printPopLevelOrder");
                                  theTree.printPopLevelOrder();
                                  notCommand=false;
                             if (word.equals("printPopInorder"))  {
                                  System.out.println("printPopInorder");
                                  theTree.printPopInorder();
                                  notCommand=false;
                             if (word.equals("printPopPreorder"))  {
                                  System.out.println("printPopPreorder");
                                  theTree.printPopPreorder();
                                  notCommand=false;
                             if (word.equals("printPopRoot"))  {
                                  System.out.println("printPopRoot");
                                  theTree.printPopRoot();
                                  notCommand=false;
                             //if word was not a command it must be a number
                             if (notCommand == true) {
                                  boolean notPlaced = true;
                                  int v = 1;
                                  //starting at the root, find suitable place for number
                                  while ((notPlaced==true) && (v < theTree.size())) {
                                       //if the stack at v is empty, number goes here
                                       if (theTree.element(v).isEmpty()) {
                                            theTree.element(v).push(Integer.valueOf(word));
                                            System.out.println("inserting: "+word);
                                            System.out.println("in empty stack at location: "+(v-1));
                                            notPlaced=false;
                                       //if the stack is not empty
                                       if (notPlaced==true) {
                                            //if the value on the top of the stack is smaller than number, number goes onto the stack
                                            if (  Integer.valueOf(word) > Integer.valueOf( theTree.element(v).top().toString() )  ) {
                                                 theTree.element(v).push(Integer.valueOf(word));
                                                 System.out.println("inserting: "+word);
                                                 System.out.println("in stack at location: "+(v-1));
                                                 notPlaced=false;
                                       //if that node was no good, check the next one for suitability
                                       v++;
              catch (Exception e) {
                   //occurs when user inputs something that is neither a command, or a number, or upon EOF, or stack is full
         public TreeStack () {
              //create the TreeStack ADT by adding stacks in the vector, note vector 0 is instantiated but not used.
              for (int i = 1;i<=TREE_CAPACITY;i++)
                   tree.add(new ArrayStack(STACK_CAPACITY));
         public int size() {
              //return the size of the tree +1 (as 0 is not used)
              return tree.size();
         public ArrayStack element (int v) {
              //return the ArrayStack at v
              return (ArrayStack)tree.get(v);
         public int leftChild (int v ) {
              //return left child of v
              return v*2;
         public int rightChild (int v ) {
              //return the right child of v
              return v*2+1;
         public boolean children (int v ) {
              //search for children of v and return true if one exists
              for (int i =v;i<size();i++) {
                   if (i/2==v ) {
                         //left child found at i
                         return true;
                   if ((i-1)/2==v ) {
                        //right child found at i
                        return true;
              //no children found
              return false;
         public boolean isInternal (int v ) {
              //test whether node v is internal (has children)
              if (children (v)== true) {
                   //has children
                   return true;
              return false;
         //print the top value in each stack encountered on a level-order traversal of tree
         public void printLevelOrder() {
              //for every node of tree v
              for (int v = 1;v<size();v++) {
                   if (!element(v).isEmpty() ) {
                        //print the top value in stack v
                        System.out.println(" "+element(v).top());
                   else {
                        //stack at v is empty
                        System.out.println(" -");
         //pop off and print the top value in each stack encountered on a level-order traversal of tree
         public void printPopLevelOrder () {
              //pop off and print the top value in stack v
              for (int v = 1;v<size();v++) {
              //for each node of tree v
                   if (!element(v).isEmpty() ) {
                        //if v isnt empty print the top value in stack v
                        System.out.println(" "+element(v).top());
                        //pop the top value in the stack at v
                        element(v).pop();
                   else {
                        //stack at v is empty
                        System.out.println(" -");
         //pop off and print the top value in each stack encountered on an in-order traversal of tree
         public void printPopInorder () {
              printPopInorder (1);
         public void printPopInorder (int v) {
              boolean isInternal = false;
              if (isInternal (v)) {
                   //use a boolean for isInternal to save on running the method twice
                   isInternal = true;
                   //recursively search left subtree
                   printPopInorder (leftChild(v));
              //pop off and print the top value at v
              if (element(v).isEmpty() ) {
                   //stack at v is empty
                   System.out.println(" -");
              else {
                   //if v isnt empty print the top value in stack v then pop
                   System.out.println(" "+element(v).top());
                   element(v).pop();
              if (isInternal ) {
                   //recursively search right subtree
                   printPopInorder (rightChild(v));
         //pop off and print the top value in each stack encountered on an pre-order traversal of tree
         public void printPopPreorder() {
              printPopPreorder(1);
         public void printPopPreorder(int v) {
              //pop off and print the top value at v
              if (!element(v).isEmpty() ) {
                   //if v isnt empty print the top value in stack v then pop
                   System.out.println(" "+element(v).top());
                   element(v).pop();
              else {
                   //stack at v is empty
                   System.out.println(" -");
              if (isInternal (v)) {
                   //recursively search left and right subtrees
                   printPopPreorder (leftChild(v));
                   printPopPreorder (rightChild(v));
         //pop off and print all values from the stack at the root
         public void printPopRoot (){
              //while the root stack has values left
              while (!element(1).isEmpty()) {
                   //print, then pop
                   System.out.println(" "+element(1).top());
                   element(1).pop();
    }

  • Setting audio output levels automatically at login (even with command-line)

    When I log in, the audio level seems to be at the level set by the last user. Is there a way to get this to automatically set to my preferred level when I log in?
    A related question: Is there a command-line method of setting the audio level?
    Thanks in advance,
    Paul
    Power Mac G5 Quad   Mac OS X (10.4.8)   2GB ECC Memory

    u could use scripting...
    sudo osascript -e "set Volume 20"
    using that at the command line will change the volume level to 20.
    you could put that in a script or something and have it launch at login.
    Beavis2084

  • Command Line configuration of Replication

    I've recently installed iDS 5.0, on Solaris 8.
    I've discovered the reponse files have been scaled down from iDS 4.12.
    We had utilized the SIR entries in iDS4.12 response files to automate
    Supplier/Consumer installation. This feature appears to have been
    removed in iDS5.0. I have identified various entries that are stored in
    the dse.ldif file, when using the console to configure for multi-master
    replication, but for some of the entries, such as nsDS5ReplicaName,
    nsState, I don't have a clue what to assign.
    I'm looking for a procedure, to configure consumers & multi-masters,
    from the command-line.
    I can "guess" that ldapmodify is essentially what would be used.
    Trying to configure hundreds of machines for multi-master replication is
    impractical via the console (GUI) interface. We need a command line
    method.
    Any help would be greatly appreciated.
    Regards
    Tom Sandholm
    Sr. Unix Architect
    Genuity
    eBusiness Application Engineering

    Tom,
    Please find below 2 examples of ldapmodify commands to create replica and
    replication agreements.
    Regards,
    Ludovic.
    SUPHOST=elk
    SUPPORT=389
    CONS1HOST=norge
    CONS1PORT=7389
    MGRDN="cn=Directory Manager"
    MGRPW=MySecret
    BASE="ou=a"
    SUPREPLICAID=2
    CONS1REPLICAID=1
    ldapmodify -c -b -h ${SUPHOST} -p ${SUPPORT} -D "${MGRDN}" \
    -w ${MGRPW} << EOM
    dn: cn=replica, cn="${BASE}", cn=mapping tree, cn=config
    changetype: add
    objectclass: top
    objectclass: nsds5replica
    objectclass: extensibleObject
    cn: replica
    nsds5replicaroot: ${BASE}
    nsds5replicaid: ${SUPREPLICAID}
    nsds5replicatype: 3
    nsds5flags: 1
    nsds5replicabinddn: cn=Replication Manager, cn=config
    EOM
    Use nsds5ReplicaType: 2 for a readonly replica.
    Use nsds5ReplicaType: 3 for a master replica.
    The nsds5flags: 1 means to log the changes (must be set on master or hub
    replica).
    You don't need to set state and name since they are generated by the
    replication code.
    Make sure nsds5replicaId are different for master replicas. You can use the
    same replica id for all read-only consumers (but a different one from the
    masters).
    ldapmodify -c -b -h ${SUPHOST} -p ${SUPPORT} -D "${MGRDN}" \
    -w ${MGRPW} << EOM
    dn: cn=agmt${AgmtNum}, cn=replica, cn="${BASE}", cn=mapping tree, cn=config
    changetype: add
    objectclass: top
    objectclass: nsDS5ReplicationAgreement
    cn: agmt${AgmtNum}
    nsDS5ReplicaHost: ${CONS1HOST}
    nsDS5ReplicaPort: ${CONS1PORT}
    nsDS5ReplicaBindDN: cn=Replication Manager, cn=config
    nsDS5ReplicaCredentials: secret12
    nsDS5ReplicaBindMethod: SIMPLE
    nsDS5ReplicaRoot: ${BASE}
    description: A sample replication agreement.
    EOM
    Tom Sandholm wrote:
    I've recently installed iDS 5.0, on Solaris 8.
    I've discovered the reponse files have been scaled down from iDS 4.12.
    We had utilized the SIR entries in iDS4.12 response files to automate
    Supplier/Consumer installation. This feature appears to have been
    removed in iDS5.0. I have identified various entries that are stored in
    the dse.ldif file, when using the console to configure for multi-master
    replication, but for some of the entries, such as nsDS5ReplicaName,
    nsState, I don't have a clue what to assign.
    I'm looking for a procedure, to configure consumers & multi-masters,
    from the command-line.
    I can "guess" that ldapmodify is essentially what would be used.
    Trying to configure hundreds of machines for multi-master replication is
    impractical via the console (GUI) interface. We need a command line
    method.
    Any help would be greatly appreciated.
    Regards
    Tom Sandholm
    Sr. Unix Architect
    Genuity
    eBusiness Application Engineering--
    Ludovic Poitou
    Sun Microsystems Inc.
    iPlanet E-Commerce Solutions - Directory Group - Grenoble - France

  • Where is the command line interface in DW CS3 on a Mac?

    I have seen other forums where they instruct you to use the command bar or command line interface to set permissions and what not, but I do not see where that might be in Dreamweaver CS3 on a Mac. Can someone assist me in locating this feature?
    Thanks in advance,
    Todd Temple > T2 Design

    There is no command line interface in Dreamweaver. It's a tool for editing web pages.
    However, you can use Dreamweaver to set the permissions on web pages on your remote server like this:
    In the Files panel, select Remote view from the drop-down menu at the top right.
    Select the file(s)/folder(s) for which you want to change the permissions.
    Right-click and select Set Permissions from the context menu.
    Set the permissions in the dialog box that opens.
    As the dialog box warns you, this command does not work on all servers. If your remote server won't allow you to change permissions through Dreamweaver, you need to log into your hosting company's control panel, and change the permissions there. If you don't know how to do it through the control panel, ask your hosting company for help, as the method depends on the control panel used.

  • Change Application-Based firewall via command line

    I'm looking for the command line method of changing the application-based firewall. I am not referring to ipfw, which I already have configured. Basically, all I want to do is change "Set access for specific services and applications" to "Allow all incoming connections" under Security > Firewall. However, I need to do this via ssh, so I need the command line method.

    sysadmin wrote:
    It has been included in several Apple packages dating back to Tiger. However, you have to dig it out of one of the packages in /Library/Receipts. Use the "locate" command and you'll find it in a few packages. Apparently they were using it internally long before they included it in the OS.
    Interesting. The same thing was true for SetFile, which was/is present in Developer Tools. If you hadn't installed the latter, you could still find it in some of the system update for Tiger.
    Using 'defaults' for nested values can be downright painful,
    Yes

Maybe you are looking for