Programming :: Make Script That Runs Program As Another User With Pass?
Jun 7, 2010
I'm trying to do a shell script which are suppose to run a program as a specific user at system boot up. The problem is that I don't know for sure how to make the script add the users password to the prompt when it's necessary.
Basically the program would be run like this:
sudo -u extrema program_name -r /srv/program_name -d
and in this example the password is, "hidden".
How would I make this script run this program as user extrema with the password "hidden" at boot-up? I know how to put the script in the rc.X directory and so on, its more the syntax of the code.
View 4 Replies
ADVERTISEMENT
Mar 5, 2010
My hosting server does not allow exec() or system() calls, for security reasons. I can call a cgi process in two ways. From a .shtml page, i can issue a directive like code...
View 11 Replies
View Related
Dec 7, 2010
I used wait4 to time a child process. but the results differ each other dramatically. why?my core source code lists as below.to the point: in linux 2.6 kernel, how to time a process with a high precision. and, only its user-time rather than the elapsed time???
static struct rusage ruse;
static pid_t u_pid;
int main(int argc, char *argv[])
{
int i;
code....
View 14 Replies
View Related
Dec 30, 2010
Trying to do a simple bash script, and having some issues. I am relatively new to bash, and did my best to search, but idk what exactly to search for.
Doesn't work code...
View 6 Replies
View Related
Feb 8, 2011
I'm playing around with a bash script to pass files to a program (such as VLC). I thought something like this would work:
vlc $( ls | sed 's/ /\ /g' | tr '
' ' ' )
ls shows the files in the current directory, then sed changes spaces to " " (to escape them) and finally tr removes the line breaks. I end up changing:
01 - Music Track.mp3
02 - Another Track.mp3
to
01 - Music Track.mp3 02 - Another Track.mp3
"vlc 01 - Music Track.mp3 02 - Another Track.mp3" works if I type it manually but my script reports a problem with `-'
It seems it's not escaping the spaces.
View 4 Replies
View Related
Dec 28, 2008
I wanna that the pc starts (on/off), the pc arrives to gdm. It waits for an user to log.But but at the boot of this machine, I would like that an user has a script started in the processes (NO X cuz bash script).How can an user runs a script at boot of the PC ? (once only and no one loged)
View 4 Replies
View Related
Feb 9, 2010
I currently doing a network emulator program and the features must includes the web-based interface for user configuration. I able to run my program through command line. But I would like to ask how to associate my program to web-based interface for user configuration?
View 8 Replies
View Related
Jun 30, 2010
I want to know how can I make a GUI program from a shell program I coded in C a long time ago. Can anybody point me to good tutorials?
View 4 Replies
View Related
Sep 6, 2010
We are trying to create a message forwarder program that receive a message on Port A and pass it on t Port B. Also receive a message from Port C and Pass it on to Port D as follows.
[Code]...
View 4 Replies
View Related
Jul 16, 2009
I am trying to compile systemc. Configuration is done OK and Makefiles are created. As soon as the "make" command i issue, recursively reaches the "utils" directory, errors are produced -declaration and include errors.
The files referenced by the errors DO exist and i hava managed to give g++ "-I ${LD_INCLUDE_PATH}, ie the variable, where all header dirs are listed. Libraries and compilers for gcc3.3 and g++3.3, i believe, are installed OK. code...
View 4 Replies
View Related
Aug 18, 2010
Using PyQt4, is it possible to make a program where you can separately write custom QWidget subclasses and let the user add/remove them to your main app?
View 7 Replies
View Related
Feb 21, 2010
First off, I'm completely new to bash scripting so forgive me if I make any egregious errors. I'm trying to make pop-up reminders for the simple calendar program when. This is what I have so far:
Code:
#!/bin/bash
# set the time format for when
#current="$(date +%I:%M %p)"
current="$(date +%-l%p)"
today=~/.when/today
[Code]....
When I run the script, gxmessage pops up and displays the correct information, but it does so for each line in "~/.when/today" that contains a time that matches the current system time (which would be three pop-ups at 10PM, according to the example). I want it to display the information only once. How can this be accomplished? Is a while loop even the right job for this?
View 8 Replies
View Related
Jun 27, 2010
I need to make some C program under linux to make some scripts that can talk to my Server's Parallel port by sending some quare signal as high or low, so what i can do ?
View 4 Replies
View Related
Jan 11, 2010
Title : Author : Price
France : Mark : 40
Persia : John : 50
how i arranged my database. I am trying to write aprogram which does a search either using Title, Author or both.
[Code]....
but i am still unclear on how i am able to make the program check if either on of the input(either $Title or $Author) is not filled up, and if one of it is not filled up, use the other one which is filled to do a search.
View 6 Replies
View Related
Jul 28, 2010
I want to make a program that maintains a list of tags that can be attached to a set of files. Store the tags in the files. The main problem is that there is no way to get a list of all the tags without reading each and every file. And also what if you have an unused tag? Have a file that contains tag "keys" and file list "values". This seems like it would be fast and effective, but what if one of the files gets renamed?
View 12 Replies
View Related
Sep 2, 2010
Any pointers to make a shell script in cronjob or using at to be user interactive. We have a requirement to script a program where it prompts the users in CUI for feedback and capture the output in a text file and act based on the feedback.For eg: At pre-defined time i should prompt the acitve users whether it is ok to shutdown, whose feedback would be captured in a text file. Post which act on the updates in the text file
View 4 Replies
View Related
May 1, 2011
Is there a diary program for Linux that runs in the terminal?
View 1 Replies
View Related
Dec 10, 2008
I am writing a program which i dont want the kernel scheduler to preempt before certain time duration. I am using the system call sched_get_priority_max to set the maximum priority. However it is not producing results.
View 3 Replies
View Related
Jul 28, 2010
I want to simulate a serial protocol in user space program to test reception algorithm. The protocol is similar to UART protocol but frame format is different. The duration of 1 bit is 114,46 us. In my main function I'm creating two threads. Tx for simulating transmitting data and Rx for reception data. For measure time I use create_timer() function and signals. Each thread has its own timer and signal handler. Tx timer uses SIGUSR1 and Rx timer uses SIGUSR2. Tx thread sets the global variable and Rx reads it.
The timers are set to sample with 114,46 us period. When they reach this value signal handler should set the flag. Flag is check in thread and some operation are made. When I set the timers period for longer time (100 ms) everything works fine but when I change it to default value (114,46 us) the Rx thread doesn't receive the proper data. I am wondering if the 114,46 timer period is possible to simulate in user space? Whether the time will give me the proper resolution ? Theoretically it should provide 1 ns resolution.
View 3 Replies
View Related
Oct 20, 2010
A bash script that runs a program N times, takes the numbers program produces (each time different) and calculates the average of those numbers.
View 2 Replies
View Related
Apr 6, 2011
basically i have to create a simple program with will continually read input from the user until they enter a blank linei know how to read in certain input but not sure how to get it continually in a loop
View 2 Replies
View Related
Aug 27, 2010
I migrated joomla to my new server and noticed that the script doesn't have the permission to edit it's own configuration file and write to the cache folder. All my files are owned by root, which I guess isn't a good idea.
As what user do the PHP scripts run? Or is this system specific? I don't want to chmod all files to 777 so I'd just like to change file and folder ownerships to the user that is executing that script.
View 1 Replies
View Related
Jun 21, 2010
I have big folder I want to send it to my friend because it is over 20MB I can't send it by email so I want to put it on my website in a folder any time he wants to access it he should put uer name and passwod.I am completly new in that kind of stuff please let me know if any one know how to do it.
View 3 Replies
View Related
Dec 13, 2010
I know, running a script is pretty easy itself, but some people (family, gf) just hate using the terminal and assisting them remotely, you have no idea what they are really doing on the other side of the screen. This way, they can essentially just double click and enter their password. I was curious. How can I easily create a .deb package for this script:
Code:
#!/bin/bash
sudo apt-get install -y libnotify-bin
sudo apt-get purge -y firefox
sudo apt-get purge -y flashplugin-*
sudo apt-get purge -y adobe-flashplugin
[Code].....
View 2 Replies
View Related
Jul 27, 2011
what program runs the Session lock and the screen saver for gnome and KDE on centos 5.5. But most importantly id like to know what the config file for the screensaver/session lock is called and where its most likely located.
View 4 Replies
View Related
Feb 22, 2011
I've a strange situation in my network: pcs gatewayed to another network, then a proxy, then a firewall.pcs --> router --> cloud --> router --> proxy --> switch <-- fw --> Internet(router, proxy and fw are alla connected by the switch)Some months ago the situation was: pcs --> router --> cloud --> router --> switch <-- fw --> Internet.There was a static route in the router that gatewayed the packets to the firewall, but that route has been deleted, and I cannot reinsert it because I've not access to the routers, so we have to use a proxy to go to Internet, and we have the configuration of all pcs (Windows XP) with the fields "proxy" filled.The proxy ha only one NIC gatewayed to the firewall, and Ubuntu and squid installed, but we have some problems:
1. we cannot use email, so how can we make port 110 and 25 packets pass?
2. squid seems to slow down, so can we uninstall it and route all the traffic directly to the firewall to speed up?
View 2 Replies
View Related
May 7, 2010
1. What file do i have to edit in order to include /usr/local/bin in the class path (ie. I put an executable in /usr/local/bin and when I try to execute it, it says the command cannot be found, etc.) EDIT: Solved, just didn't set PATH correctly. EDIT: New problem. When I try to execute a program in /usr/local/bin, it says "fopen: john.ini: File not found" Yet when i cd to /usr/local/bin, it doesn't say that. What would cause this?
2. Once I get my system setup the way i like it, how would i go about making it into a bootable CD/DVD?
3. How would I pass arguments from a shell script to a program?
View 4 Replies
View Related
Mar 31, 2010
I have been put on the task of changing the passwords of two user accounts on one of our debian boxes at work. The problem is that the current passwords are unknown, and I only have SSH access to the machine.
Is there anything I can do?
I thought about simply creating two new users and removing the old, but that may not be an option.
View 1 Replies
View Related
Dec 4, 2010
i want to pass variable in mysql qyery in c programming
View 1 Replies
View Related
Oct 1, 2010
I have a 2-year old DELL XPS M1330. I used to have Windows Vista on it, but over time, I believe it became clogged with too many programs and so I wiped the hard drive and installed ubuntu 10.04 LTS about 2 weeks ago. However, ubuntu many times seems to run slower than vista did. I have 4 GB of RAM, an Intel Core 2 Duo T8100 (2.1 GHz, 3MB Cache, 800MHz FSB), 320GB HDD, 128MB nVIDIA GeForce 8400M. Ubuntu recognizes me as having dual processors at 2.1 GHz and 3.4GB RAM, but when I'm watching a simple video, whether online or locally on the computer, my CPU usage invariably jumps to 100% and it lags. Sometimes, even simple word processing makes it slow significantly.
View 4 Replies
View Related