Server :: Which Php Command For Shell Interaction Shall Use?
Dec 26, 2010
As homework for my study I have to do some kind of browser GUI to send commands to mysql command line tool and to show the output in the browser. I already set up sudo to have the right permissions for the www-data user. In the php documentation I found that one of the following four commands are probably for tasks like mine.
exec
passthru
shell exec
system
Can anyone tell me which one is the best for my requirements? The idea is to use php from the browser to connect to mysql like on the command line with: "mysql �user=username �password" And then give back the output of the command line to the browser. If the above is working then the next step would be to put a link in order to execute the command �show database;� again through php by clicking that link. After clicking this link it would give back to the browser what the command line would display.
This has been raised as redhat bugzilla bug 583054 - seeI am posting here in case anyone else has dealt with a similar problem. In brief, I have a print server running Fedora 12/CUPS dual boot WinXP. The attached printer is a Canon BJC-4100. When the server is booted in F12, it takes over a minute for a networked Fedora 12 box to bring up a print dialog, or for the printer to start after a page has been submitted. When the print server is booted in WinXP, printing is immediate.
Tim Waugh identified the problem in the CUPS Troubleshooter output: 'D [10/Apr/2010:09:00:20 +1000] cupsdNetIFUpdate: "lo" = localhost:631', 'D [10/Apr/2010:09:00:37 +1000] cupsdNetIFUpdate: "eth0" = 192.168.0.199:631',
I have 2 servers, let say server1 and server2. I have create ssh-keygen from server1 to server2, I can ssh from server1 to server2 without typing a password. My question is: How can I use command from server1 to server2? for example I want to list file in server2 /home directory from server1.
I want to create for my private use, a simple web interface to manage some easy task (useradd, userdel, passwd, etc...).I have some basic knowledge of PHP; how can I realize this? PHP as module or CGI? Which is better in this case?
I am very new to shell scripting.How does one pass a command-line parameter to a shell script?for the below program #/bin/bash mount -t cifs -o user=ramkannan,password=Linux123@ //10.200.1.125/ramkannan /MT cd /MT/test date=`/bin/date "+\%Y-\%m-\%d-\%H-\%M-\%S"` mysqldump -uroot -pram2@ employeedb > $date.sql gzip $date.sql
I want to pass parameter for everything,i tried in google and did but iam getting error while passing parameter to all
#/bin/bash mount -t cifs -o user=$1,password=$2 //10.200.1.125/ramkannan /MT cd /MT/test date=`/bin/date "+\%Y-\%m-\%d-\%H-\%M-\%S"` mysqldump -uroot -pram2@ employeedb > $date.sql gzip $date.sql
i was getting error while passing parameter to all.
I have a big list of packages to install on a lot of ubuntu servers. Initial testing shows that the script doing this hangs because some packages are trying to do "human interaction" to configure the packages.I don't need, or want, this configuration to take place. Configuration files will be added later for what needs to be configured to my needs. I'm using apt-get, with the --assume-yes option, giving it the full list of all packages all at once (including some to be removed).
What I'm looking for is a way to get these packages to just install without the interaction. Whatever configuring it can do w/o interaction is fine; I work from that. But this all definitely needs to run headless (the script logs output to a file in /tmp so if there are problems that can be examined later).
I am using ubuntu10.04-server 64bit AMD with fluxbox. After I ran Matlab in a shell (without GUI) the shell does not display characters anymore, but will execute any command, I just can't see the characters that I'm typing.. I use aterm and xterm, does anybody know why that is, am I missing a package?
I had to get a new workstation and its Win7-64. I found out that my Palm TX will not work on their or is supported by the manufacturer (unless u have bluetooth, I dont). So I have been trying to get it to work on my Debian. Using "Palm Devices" "Gnome-Pilot" connects fine and backs up but I dont see any kind of GUI like Palm Desktop. So I still cant work with my palm or install software etc.
I have installed Red Hat Eterprise Linux as a Guest OS using VirtualBox on the Host OS Windows XP SP 2 on my PC. I want to access my local / intranet web site from this Guest OS which is running on the top of on Windows XP, the Host OS. I am not sure as to what IP Settings I need to do. Though I am able to access Internet from both the OSes. The IP of this Guest OS is:
I have installed Microsoft Self Loop Adapter (Autoconfiguration IP Address: 169.254.25.129) on the Host OS Windows XP. There is another adapter: VirtualBox Host-Only Network whose IP Address is: 192.168.56.1. So, how can we access intranet web site from the Host OS to Guest OS and vice versa. I also want to access this virtual Red Hat machine /console from within windows XP using PUTTY application. From Windows XP the Red Hat machine is pinging. But when I use the IP to access the machine through PUTTY it doesn't work.
slow interaction between Ubuntu samba and xp.I have a and Ubuntu server with samba and many xp clients, they complain because the time to open a file is to long, even to open a directori to see wich files are on it
Is it somehow possible to boot a Linux operating system from an encrypted filesystem/disk without having uesr interaction? Background: I am preparing a VmWare Image for shipment to a customer. This image contains sensible data. The only access granted shall be via an apache server running from inside in the image.
Here is what I have. Everyday I go to 8 websites that require entry of a username and password. When I've logged in, I select exactly the same info using the sites navigation and specify a report generated by the site. I then tell the site to save as an excel file and save it as an existing spreadsheet, 8 times for eight different files
How can I make this more direct? Can a script be written that provides username and password, selects the parameters I want, saves the spreadsheet and goes to the next site to repeat the process and save under a different name?
This would be used in a Windows XP/IE 7/corporate environment.
I have several linux laptops and a desktop-server running Ubuntu Lucid. I also have Android(tm) and iPhone(tm) devices. All of these connect to my at-home LAN using wireless or wired ethernet through my home-LAN router+gateway and on through the cable modem. In addition, printers are network capable and deployed on the same at-home LAN. All of that works.
Now I want these various and several computers to share files and services (web, print, media) with each other and interact with each other on this same at-home LAN. Can someone point me to a HOWTO or similar application notes that discuss what I need to do? Since all of the at-home LAN devices use DHCP and get dynamic IP addresses, any /etc/hosts files that I create stop working when leases renew. I can configure "fixed IP address" settings, but then wifi roaming is a royal pain in the anatomy -- at least the ways I know how to do this.
I can use the router+gateway to give a specific IP address to each hardware (MAC) address, but then when folks visit it is irksome to setup so that we might give or get the odd file or they might print the odd document. I vaguely remember that there was a way to generate dynamic "local network" host names or similar attached to dynamic "local network" IP addresses all under the control of DHCP-server and supporting utilities. I'm dashed if I can find anything about that other than really antique details. Once folks stop laughing at what I'm certain is a totally noob question, I hope that there is a solid HOWTO that just works out there and that some kind soul will tell me where to find it. I apologize in advance if this question has been asked and answered in the past. One must know enough to know what to search for and get meaningful results. ~~~0;-/
Is it possible to get user interaction in these scripts? They are for batch processing is my belief so perhaps not, but I would like to make a function whereby I can click it, a selection box of an exact size appears, I then place the selection box and press something, a new file is born. Is this possible?
I'm attempting to replace gnome-panel with cairo (also called glx dock), but I'm noticing some strange interaction between cairo and compiz. I have the Window Previews compiz plugin enabled, but the cairo dock only previews the window when the window is already visible on the desktop. If the window is minimized, the plugin doesn't seem to work. Have I missed a crucial configuration option somewhere? I'll attach some screenshots to try to clarify the problem. Notice the placement of the mouse over the left-most icon on my dock in both screenshots.
I have snipped part of my log i captured on the my honey pot need recommendation on what is going o? The infected computers is located at address ${ADDRESS}. A quick check of my low interaction Honeypot (based on nepenthes) gives the following data: i know its a worm but what is going on thanks in advance
linux-sqos:/opt/nepenthes/var/log # cat nepenthes.log <snip> [18032007 02:26:03 info module] 76 4 [18032007 02:26:03 info module] SMB Session Request 76 H CKFDENECFDEFFCFGEFFCCACACACACACA code....
I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the purpose of them? Are they always used together with nohup?
Code: Select allapt-get install icedove-l10n-hu apt-get install rar apt-get install ... ... y press key or other language is other key. hungarian key is: i
english after apt-get install in gnome-terminal: (y)es or (n)o hungarian after apt-get install in gnome-terminal: (i)gen or (n)em
How to yes or no automatically in all languages? Not manual, not 'Y'/'I' or 'N'/'N' keydown.
I would like use this script my fresh installed Debian 7.1. I would like run this install.sh when Debian is installed for my all softwares when i would like use.
command1: ssh pt@192.168.1.101 ls command2: ssh pt@192.168.1.101 totem ~/t1
Cannot open display: Run 'totem --help' to see a full list of available command line options. command1 can run, command2 can not run,would you mind to tell me why?
I'm looking for a specific command,if it exist... i want to login from my server to another Linux server,but the question is: can i do it in a one line command for ex: usually you type: ssh "user"@10.1.1.1 and then the password,but I'm looking for a command in one line a fake ex: ssh user@10.1.1.1 -p "password" something like that. I don't know if anyone of you understand what do i want to say .
what we are trying to do is, to let the customer click a button in the web browser, and then the web server to call a shell script to do the work. The output from the stdout && stderr of the script should be displayed in the web browser once finished or timeout, along with the exit code of the script.
The shell script is however not on the web server, but on another app server. So to call this script from the web server as the identity 'tomcat':
Code: $ sh appuser@app-server:$appbin/app-script
The .ssh/id_rsa.pub thing is done, and we have no problem doing this in the command line so far.
Our loaded ex-colleage has left us the webpages (jsp) with code like these:
Code: <%@ include file="jsp_functions.jsp" %> <% String cmd = "sh $appbin/app-script"; ExecResult r = new ExecResult();
I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, I didn't find a answer yet. Is there a shell script command to put a Linux box to sleep?