Software :: Scripting Commandline Args To Switches - Network Hardware
Jan 6, 2010
I have some network switches that I can login to via ssh and run commandline arguments (not a bash environment). Is there an way/app out there that would allow me to pass commandline arguments to the switch then wait and get the command output. ALl this over ssh?
On my opensuse 11.4 box (although I assume the version is irrelevant), I'm trying to figure out how to do something with the mail command. We have multiple smtp relay servers and sometimes I have to test to verify that mail is bouncing off of them successfully. On my laptop, in my main.cf file for postfix, I've got the relay server listed. But to test multiple servers, I have to change the main.cf, restart postfix, send message, and then repeat for each test.
I'm trying to figure out a way to specify the smtp relay on the command line. I've been playing with the -S option which is supposed to allow variables and one of the variables in the man page is 'smtp'. I've tried several different syntaxes but nothing seems to work.
The closest I've come is: mail -S smtp 10.1.0.63 -s "test" user@email.com < main.cf
That syntax doesn't give me an error but it still routes the message off the smtp server listed in main.cf which is not 10.1.0.63.
I use vncviewer (win32) to connect to my SuSE 11.3 box. The SuSE box has the "standard" xinetd started Xvnc server running (includes the -inetd switch).
My client (the vncviewer) has to go through a firewall with limited ports available and so I use the command line:
Code:
However, if there is a problem with the connection, such that the client disconnects, it seems that subsequent request to the Xvnc server create a new session/display. The text in the client window reports "nobody's x11 desktop (host:1)", then "...(host:2)", then "...(host:3)" etc.
I have tried combining the display and the port parameters, like this:
Code:
Can anyone suggest an alternative way of reconnecting to a broken vnc session?
In the man page for find there is an example for deleting core files from /tmp: find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f
which I am sure does what was intended. However, this very similar command does something quite different: find /tmp -print0 -name core -type f | xargs -0 /bin/rm -f
This actually removes all files in /tmp, ignoring the -name and -type arguments. I checked the man page to see if it detailed this behaviour, but the only reference to the order of the arguments was that -name should come before -type to prevent excessive calls to stat(2) on all files. This seems very risky behaviour on the part of find and I am concerned about whether this is a bug or not. I wasn't trying to remove core files from /tmp when I found this out, but deleting other files from another part of the filesystem .
I'm trying to ssh my ubuntu laptop with my android phone. But with the app I have (connectbot) I don't seem to be able to pass any args to the command. I want to pass the -Y command to allow my phone access to the screen on my laptop so i can use my laptop (somewhat) from my phone. Can you change the args passed to the command while it is running?
I had to reinstall 10.04 because I got an error, waiting for root device. And I figured I knew why I got this error: I changed my xconf.cfg (or whatever the file is in /etc/x11/) -- So this time I downloaded the 64 bit, because I have a 64 bit computer, so though, might as well get it! I've narrowed the problem down to this:
After I install nvidia settings (the x server or whatever?) And change my view to TwinView (I have my laptop monitor and an external monitor), and save the config file, this happens. I will do some more testing, but here is the whole error message: Gave up waiting for root device. Common problems:
- Boot args (cat /proc/cmdline) - Check rootdelay= (did the system not wait long enough?) - Check root= (did the system wait for the right device? - Missing modules (cat /proc/modules; ls /dev) ALERT! /dev/disk/by-uuid/bcb49367-8554-4116-8e4d2b39d92415cf does not exist. Dropping to a shell!
BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) built-in shell (ash) Enter 'help' for a list of built-in commands.
I have a PHP script which will show info from 5 lines in a MySQL database, with a "next" button to show the next 5 lines and so on. Initially it'll get called with a ?page=1 in the args in the URL, and then onward I want the "next" button to link to the same script , but with a ?page=2 in the args. First of all, how can I access the "page" variable inside the script to see what args it's been given? (sorry, extremely newbie question here )
And secondly, what will the code for the "next" button look like? If the script is called "seenames.php", I want this: print "A HREF="...cgi/seenames.php?page=$page+1">Next</A> , if you get my meaning. But what will the quoting for the above line be? I'm sure I've got it wrong.
I am writing a script in which I need to send a email to a @vtext.com address and was confused on how to go about this. (Its in a perl script so ideally it would be a one line command so I can just put in back ticks).
How would I clear my commandline history at logon/logoff/startup time? I tried this : editing my /etc/rc.d/rc.local file like this I know this is for system startup
Code: #!/bin/sh # /etc/rc.d/rc.local: Local system initialization script. # Put any local startup commands in here.
Also, if you have anything that needs to be run at shutdown time you can make an /etc/rc.d/rc.local_shutdown script and put those commands in there.
#clear user history ~/.bash_history echo "" > ~/.bash_history #clear root history /root/.bash_history echo "" > /root/.bash_history
I just upgraded to OpenSuse 1.4 from 1.1 and it boots straight to the command lines. After login I type startx and it still does not go to the KDE desktop or anywhere else fo that matter. how to get to a GUI desktop from the commandline screen?
I want to close an open port which is in listening mode between my client and server application. Is there any manual command line option in Linux to close a port ??NOTE: I came to know that "only the application which owns the connected socket should close it, which will happen when the application terminates."I dont understand why it is only possible by the application which opens it ... But still eager to know if there is any another way to do it ??
I m looking for a video cutter that cut a portion of video in the given format, i tried ffmpeg and avidemux but they touch( some modification) the original video so output doesn't remains same as the source is there any software for ubuntu 8.04 hardy which cuts the video portion as it is and have command line support
I use in Ubuntu proftpd to send files with a little script over the internet to my website. If I write all these scripts it's a lot of work and my first question is what is the best way to send files over.
For example do you need to type: put /directory/file.gz /www/file.gz ? or can it shorter? like put /directory/file.gz /www/ because then ftp complains it can't create file
I'm looking for commandline monitoring tool for mysql and only thing I can find is mtop. Unfortunately, mtop's development halted back in 2004. Can someone suggest an alternative? or is there such thing?
While the program runs fine, it does not select the database automatically (last argument). This used to work with KeePassX. Nor does KeePass2 remember the recently opened files (the menu remains empty).
My system: Ubuntu Natty 32bit, KeePass 2.15
PS: I have to use KeePass2 as I need to share the database with other OS where KeePass1 is not supported. And would love to see ported KeePass2 to linux without mono. Keepass2 also looks worse than KeePassX IMO.
I used imagemagick to convert the files to gif with the following command
Code:
for i in {100..131}; do convert CIMG0$i.jpg CIMG0$i.gif; done # works
This worked like expected, but when afterwards I wanted to scale the images
Code:
for i in {100..131}; do convert -scale 25% CIMG00$i.gif CIMG00$i_scaled.gif; done # works not it seems the system is working for about half a minute, but I get no output. The single command
Code:
convert -scale 25% CIMG100.gif CIMG100_scaled.gif # works
works as expected and gives me a scaled image. What does the convert command do in the second case? is the for-loop wrong?
I am using a script to start an application (with GUI, i.e. windows) in KDE. However, the window will always appear on the currently used desktop. I would like to define which desktop the application will appear to be able to just run in invisible in the background. How can I do this for KDE?