Software :: Use Php To Pass Commands Onto A Server?

Mar 4, 2009

hi all how do i use php to pass commands onto a server? like i want to be able to:

1. delete the content of a file (or just delete the file and make a new one if it's easier)

2. read the content from a file

3. write new data to a file via an input box

4. run a command on the server

View 7 Replies


ADVERTISEMENT

Ubuntu :: Need Grub To Pass On Some Commands To Secondary OS

Jul 29, 2011

So, I have a netbook with a 320GB harddrive and I'm testing all kinds of fun distros out. Right now I have 11.04, 11.10 daily, Jolicloud, Chromium OS, and MeeGo. Meego uses it's own weirdass boot loader, which sets things up a certain way. My computer has a touchscreen, and I had to modify some things to get it all working properly. Anyway, I reinstalled grub on my main partition (11.04), but now the command I need doesn't go through to meego.

The command is "usbhid.quirks=0x0eef:0x725e:0x40" For my other systems, I have it in /etc/default/grub in the "GRUB_CMDLINE_LINUX_DEFAULT=" line.

Obviously there is nothing like this in Meego, and a thread on their forum said I would have to configure it in whichever bootloader I'm using.

View 3 Replies View Related

Programming :: Pass Complicated Commands As Argument To Another Script?

Apr 21, 2010

I am attempting to script some tasks I have to do, but I have no control over one of the scripts I have to use... and they output all kinds of useless things on the screen. My goal is simple: Capture all output from their scripts, and create a progress line that only shows the most recent output from their stuff. So, here was my first solution; a file I called "spin":

Code:
#!/bin/bash
spinX(){
PROC=$1
STRT='date "+%s"'
while [ -d /proc/$PROC ];do
last3=" 'getLine $2' "

To use it, you pass it a process ID and a file that contains the output from that process. As the process continues, a kurby dances on the screen (To let you know that the process has not hanged), and the tail of the output is shown (To let you know what it is doing). When the process ends, the kurby stops dancing and the time it took is displayed.

And here is the file I call "noise":
Code:
#!/bin/bash
while [ i -lt 100 ];do
i=1
echo "Look at me count!$"
sleep 1
let "i=$i+1"
done

This does nothing but create random output, for testing. It counts from 1 to 99 on the screen. To run my test, I do the following:
Code:
(noise) &>tmp.txt & spin $! tmp.txt

It works relatively well, but it is messy. I don't like creating a temp file, and I don't like the messy syntax for calling my program. I decided that I would rather move everything into the spin program, to make using it less messy:
Code:
#Spin Psuedo code
#$1 = command I am about to run
(exec $1) &>tmp.txt & spinX $! tmp.txt

By executing the process inside of the spin code, I can get rid of the tmp file later on without changing a lot of scripts (Or move it, or whatever). I can also call it by passing the command to the script, which I find more elegant.

So here is what I would like to know:
1) If possible, I would love to get rid of the tmp file all together, and store the most recent line of output from script 1 into a variable that script 2 can print out instead... is it possible?
2) How can I run a random command that is passed as an argument? Basic ones work fine, but anything with a pipe fails me.

Example of a script:
Code:
#!/bin/bash
#myEcho.sh
echo;echo "Recieved command: ";echo $1;echo;
echo "Attempting to run command: ";echo
exec $1

Example code for passing commands to script:
> myEcho.sh "ls -al" #works
> myEcho.sh 'ls -al' #works
> myEcho.sh "ls -al|grep *.sh" #fail
# Output:
#ls: invalid option -- |
#Try 'ls --help' for more information.
> myEcho.sh "ls -al|grep "*.sh"" #fail
# Output:
#ls: invalid option -- |
#Try ls --help' for more information.
> myEcho.sh 'ls -al|grep *.sh' #fail
# Output:
#ls: invalid option -- |
#Try 'ls --help' for more information.

View 8 Replies View Related

Programming :: Python : Pass Output Of System Commands To Variable?

Jan 25, 2011

I'm trying to write a python script that will use the current user's name when interacting. Ex: when started, it should say "hello daweefolk" when I am logged in.
I've tried
Code:
username=os.system("echo $USER")
but the variable remains empty.
What is the correct code?

View 1 Replies View Related

Programming :: Open Gnome Terminal (pass Commands ) On Clicking Glade Button

Dec 18, 2010

I am working on a small project for making a small configuration tool for ubuntu 9.10 for new linux users, that make their system working easily without knowledge of the linux commands.I created a gui in glade and loaded the gui with my python program to show up, now i wish to have some python codes that can launch a gnome terminal (and also pass some linux commands to it) on the click of a button contained in the glade file.

View 1 Replies View Related

General :: SSL Server Key W/O Pass Phrase?

Jul 16, 2010

I'm having trouble trying to generate an SSL server key WITHOUT a pass phrase.

Here's what I did. Wrong, obviously.

Code:

View 1 Replies View Related

Server :: Pass A Directive To All But One Or Two Locations

Jul 22, 2010

I want to pass a directive to all but one or two locations. How do I do that?

Like:

<Location /1>
xxx
</Location>
<Location /2>

[code]...

View 2 Replies View Related

Server :: Get Variable From Bash From Mysql Or Pass From Php?

Apr 26, 2010

I am not parsing on a webserver so is it possible to have both

#! /usr/bin/php &
#!/bin/bash

in the same script? Alternatively, I have a current bash script that I need to get some variables from mysql and not sure how to get mysql results in bash:

Quote:

mysql -h server.net -u username1 -paaa -e "USE squid; SELECT email, usern FROM TABLE WHERE blah blah;"
emailadd="resultfrom above"
usern="resultfromabove"

View 11 Replies View Related

Ubuntu Installation :: Kickstart Server Will Not Pass Ks.cfg To Client?

May 17, 2010

My Server is Ubuntu 9.10x64 running in a 64bit vmware on a Dell Optiplex 760. I have the Ubuntu amd64 mirror downloaded locally in /var/spool/apt-mirror/mirror/ubuntu.mirror.iweb.ca/

I am not working with any other **buntu flavours.

tftp and dhcp are all working from what i can tell. My client can boot from the PXE, get an IP address, and takes me into the Kickstart loader.

For some reason, it is not reading my ks.cfg. I get the blue screen that says the following: "The installer failed to download a file from the mirror. This may be a problem with the network or with the mirror. You can choose to retry the download, select a different mirror or cancel and choose another installation method.

Downloading a file failed:"

Below I have pasted whatever relevant information I can find pertaining to my issue.

+++++++++++++++++++++++++++++++
+ /var/www Directory Listing +
+++++++++++++++++++++++++++++++
drwxr-xr-x 2 root root 4096 2010-04-26 11:39 .
drwxr-xr-x 16 root root 4096 2010-04-21 13:08 ..
lrwxrwxrwx 1 root root 53 2010-04-26 11:38 boot-screens -> /var/lib/tftpboot

[Code].....

View 4 Replies View Related

Networking :: Make All The Port To Pass Through Squid Server?

Apr 7, 2011

I have been working in Linux for the past two years.And working in squid for the past 6 months.The following is my Setup

ETH1 - ISP1 (Active)
ETH2 - LAN (Active)
ETH3 - ISP2 (Inactive)

Using Iptables I forward 80 port through squid (3128).Other ports just get connected in the proxy machine itself since it has IP_FORWARD enabled. All my client machines browsers enabled with "Use proxy 3128". I just want to make all the port to pass through squid server.

View 1 Replies View Related

Server :: Squid - Create A Exception For An IP Address To Pass Direct?

Feb 1, 2010

I need your help for a problem that it's happening in my customer. What I need is to change the configuration of a proxy, configured on Linux Cent OS v 4.3( explanation - see below) .My squid configuration's file it's like this:

[Code]...

View 3 Replies View Related

Server :: General Authentication - Significant Delay After Pass Entered / PAM_unix

Feb 23, 2010

My first post here. I've been using Ubuntu Server edition (Hardy) happily for some time now. I use sudo regularly during configuration of new services. It always works/authorises within seconds, however, it recently became very slow, to the point of being nearly unusable. It turns out that ANY authentication request stalls in this way - in in a plain shell, X or Gnome, via VNC (and even FTP seems affected). In /var/log/auth.log I noticed a regular working pattern like this:

[Code].....

Unfortunately now, these records look the same, but the timestamps are much wider apart (minutes). The problem occured after running synaptic and dpkg-reconfigure obm-conf. I was trying to remove 'OBM' [URL] completely as I'd messed up (just OBM) while trying to fix a minor-looking misconfiguration.

I've carefully analysed which files were altered (modified) during my changes (as the problem survives a reboot), but there are no likely-looking candidates in the list (I deleted some blank lock files). I also did a wireshark capture during an authentication session and noticed that it doesn't appear to be looking off the server for information (I had likewise-open installed, but the problem exists whether that is running or not). Research in the forums hinted that this might just be as simple as a bad /etc/hosts file - but /etc/hosts has not been modified. I may have a flawed DNS, but I get fast enough responses to nslookup and can access Internet etc.

View 1 Replies View Related

Server :: Unsure Of Exim Configuration - Accepts Mail From Users On Multiple Domains To Pass On To The Outside World

Dec 29, 2010

I'm in the process of starting a migration from an old postfix server to nice shiney new exim server however there are a few things i'm really not clear on and i'm hoping that some one here could point me in the correct direction. Okay the postfix server at the moment does the follwoing ( i'll try and keep this simple ):

* accepts incoming mail for users on multiple domains and puts the mail in the users mailbox ( external -> internal )

*accepts mail from users on multiple domains to pass on to the outside world ( internal -> external )

Obviously the POP and Imap functions are handled by other daemons.. I'd like to replicate this sort of setup on the new exim box, however the guides i can find only help with configuring the exim system for incoming mails ( external -> internal ) for multiple domains and i cant seem to find a guide that would indicate how to do both ( internal -> external and external -> internal ) on one box. I'm guessing i may have to do some sort of auth to get exim to accept and then handle the internal -> external side of things?

View 1 Replies View Related

CentOS 5 Server :: Server Update Using Shell Commands?

Feb 22, 2009

Is there a way to run CentOS 5.2 update system using the shell, avoiding the GUI (I want to do it remotely using SSH?

View 1 Replies View Related

Ubuntu :: Reverse Proxy Setup - Pass Multiple Domains Thruough One Server To Various Hosts On Local Network

Apr 13, 2011

I'm trying to pass multiple dpmains thru one ubuntu server to various hosts on my local network.

[url] should be sent to the /var/www folder on the local host.

[url] should be forwarded to an IIS box on my local network (owa.nunya.local)

[url] should be sent to another ubunto box on my local network (smtp.biznet.net)

I have tried placing VirtualHost entries in /etc/apache2/sites-available/default and [url]and [url] both work but [url] gets forwarded to the c:inetpub folder on the IIS box.

View 2 Replies View Related

Server :: Server Runs Commands Slowly / Root "sudo Mc" And Takes To Boot?

Sep 1, 2010

I have debian lenny, when I run an application is slow to load (example: iceweacel open and it takes, I can hold him iceweacel work normally), I tried to change from gnome to another and the same thing, went down some services (samba, squid) and nothing. I open a terminal and it takes, I want to duplicate it and do it fast. From a terminal without X (tty1) with root run mc and moves quickly, also run as root "sudo mc" and takes to boot.Any action done with sudo it takes to run.

Can not be what it takes to make starting the applications, not the PC because it is new, and from one moment to another I began to pass this

The sudoers file is fine, in the log's nothing unusual, since other PC take long to enter samba.

View 1 Replies View Related

Server :: Setup An MTA To Pass Mail Onto An External ISP/mail Provider?

Jul 1, 2009

I have a Fedora 10 machine that I want to setup to send email. However I don't want it to be a full blown SMTP setup.What I am looking to achieve is when something sends email from the local machine (e.g. from cron) to an address I want it to use an MTA on the local machine which will then connect to, and authenticate with, my e-mail providers SMTP server this will then take care of actually sending the e-mail.I don't want, or need, to setup a full blown SMTP service (i.e. only the local machine should be able to use it) so sendmail seems a bit over the top for my needs. Nor do I want to mess about with MX records (am I right in thinking this will mean I have to manage all mail for my domain?).

View 2 Replies View Related

Ubuntu Servers :: Commands Via Ssh On Server?

Aug 3, 2010

I have a server running. I administer this server via ssh and sftp. Commands that are executed on the ssh prompt are killed when I close the ssh connection. Is it not?If I put a '&' or '&&' after it, will this process keep running when I close the ssh connection?In what other way could I start 'applications'/processes in the background? like rtorrent for example.

View 5 Replies View Related

Server :: Get IP And Commands Executed By User

Jan 3, 2011

i have a linux server, the Operating system is SUZE 9 but i need to see all commands executed by any users connected on the server and the ip of the host in a log file.the history file does not contain all info that i need .please is there a way to write a script in order to save this problem .

View 2 Replies View Related

Server :: Migrate The Database With This Commands?

Feb 15, 2010

I'm migrating a mailserver from an old to a new mailserver. The new mailserver is based on ISPConfig 3.0.6.1.

I would like to migrate what spamassassin learnt in the past from the old mailserver to the new one. Now the question:

- The 2 spamassassin versions are different. Is it a problem?
- Can I just migrate the database with this commands???

Code:
sa-learn --backup > sadb.bkp
sa-learn --restore ./sadb.bkp

-how to migrate SpamAssasins Auto White List and all others SpamAssassins databases?

View 3 Replies View Related

CentOS 5 Server :: Can't Execute Some Commands?

May 22, 2009

I am trying to determine if I should upgrade PHP's PEAR on my server. I am trying to check the version of PEAR currently installed. I am getting the following error when I use the pear -V command:Warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)(/usr/share/pear:/usr/share/php) in System.php on line 459I tried adding /tmp to my php.ini file, but then when I use the pear -V command it doesn't do anything. I do not get any errors or anything.I am also trying to install symfony and have the same situation described above when I use the following command: pear cannel-discover pear.symfony-project.comDoes anyone have any thoughts? If not the solution, does anyone have any suggestions on how to begin troubleshooting this?

View 2 Replies View Related

CentOS 5 Server :: Can't Run Any Bash Commands

Dec 21, 2009

Our CentOS 5 server had a weird issue last Friday. We couldn't run any bash commands, such as ls, vi. It said that it could not find /bin/ls. The only commands we can run are internal commands, such as ps, cd. After we reboot the server, everything is back.

I don't know what's wrong with it. Does anyone give me a explanation?

View 2 Replies View Related

Debian :: Server Delay To Execute Commands?

Sep 1, 2010

I have debian lenny, when I run an application is slow to load (example: iceweacel open and it takes, I can hold him iceweacel work normally), I tried to change from gnome to another and the same thing, went down some services (samba, squid) and nothing. I open a terminal and it takes, I want to duplicate it and do it fast. From a terminal without X (tty1) with root run mc and moves quickly, also run as root "sudo mc" and takes to boot.Any action done with sudo it takes to run.Can not be what it takes to make starting the applications, not the PC because it is new, and from one moment to another I began to pass this

View 2 Replies View Related

General :: Server Commands To Clear Mail?

Mar 13, 2011

My var partition is full. The main culprit is NOW the mail file. What is the command to empty the mail files?The mqueue and clientmqueue files are now low on usage but the mail file is responsible for filling up the var partition.

View 1 Replies View Related

Server :: Learn System Commands / Want To Do A Certification

Sep 21, 2010

I want to learn Linux commands and want to do a certification.

PLEASE HELP with the key points and if you have anything important about it.

View 7 Replies View Related

Server :: SQL Commands Inside Bash Script?

May 5, 2011

I'm trying create script to manage one mysql database, including new db and user creation. But I'm not able get it working when I put SQL commands into function. So I create simple script for testing which is still not working

Code:

#!/bin/bash -x
MAIN_DIR="/admin/mysql"
MYSQL_CNF="$MAIN_DIR/auth.cnf"
MYSQL_CMD="mysql --defaults-file=$MYSQL_CNF"

[code]....

View 1 Replies View Related

Server :: Using Terminal Commands To Wipe Disks?

Dec 14, 2010

I'm attempting to do a low level wipe of a server in our office. I originally attempted to use DBAN but it wouldn't recognize the disks.

I've now moved on to attempting to use a Live Boot of Ubuntu 10.10 on a USB drive.

I'm using the following terminal command - sudo dd if=/dev/urandom of=/dev/sda bs=1M

When I did this the first time it simply wiped the USB drive that had Ubuntu on it.

What do I need to do in order to have it wipe all 4 disks on the server instead of the USB Drive?

View 4 Replies View Related

Server :: Difference Between VCS Commands In Solaris10 And Rhel5

Mar 3, 2011

I need to clarify a few things about Veritas Cluster Services Example There is a solaris10, 2node vcs cluster running. There is a Rhel5 2node vcs cluster running. Is ther any difference between VCS commands in solaris10 and rhel5. I heard that VCS commands are same for all the platforms, only configuration files location is differ. Is this correct.

View 6 Replies View Related

Ubuntu Servers :: Commands To Sysadmins Run When You Connect To A New Server?

Apr 22, 2010

What type of server am I on? code...

View 3 Replies View Related

Software :: Execute Script To Run Commands On Remote Server

Jan 1, 2010

I have an immutable script on server A, it executes a maintenance command on the remote servers where elevated privileges are needed. I want the developers on server A to execute the script and run it without being prompted for a password. The script contains scp root@serverB and ssh 'root@serverB', if run as root it runs great since I am using ssh keys. However, as regular users they are prompted for a password. If I do created their group on server B...etc and give the group sudo it would still ask for passwords right? Can I overcome this?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved