There is a perl script that needs to run as root but the we must make sure the user who runs the script did not log-in originally as user foo as it will be removed during the script.
So how can I find out if the user, who might have su-ed several times since she logged in has not impersonated 'foo' at any time in that chain?
I found an…
I'm trying to implement my own version of the 'cd' command that presents the user with a list of hard-coded directories to choose from, and the user has to enter a number corresponding to an entry in the list. The program, named my_cd.py for now, should then effectively 'cd' the user to the chosen directory. Example of how this should…
On a Solaris box in a "mysterious production system" I'm running a perl script that references an environment variable. No big deal.
The contents of that variable from the shell both pre and post execution are what I expect.
However, when reported by the script, it appears as though it's running in some other sub-shell which is…
I have an Ubuntu 9.10 desktop machine which I use locally. I am setting up a server on a hosting provider. The server will run a very minimal version of Ubuntu server LTS (only LAMP and email server no GUI).
I want to write a script (scheduled as a cron job) that will allow me to upload local files onto the server. I want to use…
I have a file say "file.txt" with following contents:
Capsule arr**[**0**]** in state A
rate_ul/dl=**(**2000000/7000000**)**
Capsule RBx**[**0**]** in state
...
...
using sed operator how can i replace all occurences of '[' with '[', '(' with '(', ']' with ']' and so on.
Capsule arr**\[**0**\]** in state A…
Hi,
I'm trying to write a shell script to backup websites, I've got it to go through each directory in vhosts and create a new directory vhosts/{siteurl}/private/backups/ and gzip up the site into there.
However, I also want it to read a file from private that will contain database name, user and password.…
I have structured my Cake files in the following way
/cakes
/2_3
/app
/Console
/cake.php
/apps
/www.website1.com
/Console
/HelloShell.php
/Controllers
/etc...
/www.website2.com
/Console
/Controllers
/etc...
I am getting an error "Error: Shell class HelloShell could not be found."…
I need help getting git extensions to run with msysgit. I have had bad luck with extensions git-tfs and git-fetchall, in both cases it is the same problem. The addon will require a file to be placed where git can find it (git-tfs.exe and git-fetchall.sh). I understand this to mean the files need to be in a…
The below check is not working : expr non-numeric argument shell script.
Always it is going to else. Please tell me what is the mistake.
Earlier I was no using while so the same thing was woring fine now suddenly when I did put it in the while loop it is no working.
echo "`${BOLD}` *****…
I'm trying to retrieve the weather from wunderground.com through their API, and store it in wincache. For testing purposes I made this function in the News model:
public function updateWeather(){
$results =…
Hi I'm somewhat of a newbie to python and I'm using app engine and aptanna studio - I need to run some python shell commands so that i can complete the tasks in this Tutorial on how to set up 118 and django. I…
Hi,
How can I check the mysql connection for a user/password using batch/shell script?
I've user name and password, and I need to authenticate whether they are correct or not, but how?
I tried this way:
…
Debian Squeeze, PHP 5.3.2-1, Yii 1.1.2, PHP $path to php is /usr/bin/php, permissions are '777'.
When I try to run 'crud Test' in yii shell, I get the following error message:
PHP Warning: …
The following registry key contains many system default folder locations.
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
The value for the path of…
Hi all,
This may be a rudimentary question but the answer was not readily available.
I'd like to create a shell script that calls 3 tasks consecutively, but wait till the previous task is…
Hello. I have a tab delimited file with 5 columns and need to retrieve a count of just the number of unique lines from column 2. I would normally do this with Perl/Python but I am forced to…
I've done something to break my Bash Shell Prompt in OS X (10.5.7) Terminal.
This is the PS1 that I had configured:
PS1='\[\e[1;32m\]\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ '
As far as I…
When running the following code through xcode I get inconsistent behavior. Sometimes it prints the git version correctly, other times it doesn't print anything. The return code from the…
For my school project I am implementing a shell and I need help with job control.
If we type a command, say cat &, then because of the & it should run in background, but it's…
I've attached Nautilus to Unity launcher in Ubuntu 12.04.
In Ubuntu 12.04 the default "Files" icon for Nautilus file manager is not as pretty as a "Nautilus Shell" icon.
But when I…
For some reason, I can't get Gnome Shell working after installing fglrx. When I select Gnome Shell in the profile, it just goes to Gnome Classic (No effects).
A few other issues:
…
Hi, I played around with buffer overflows on Linux (amd64) and tried exploiting a simple program, but it failed. I disabled the security features (address space layout randomization…
Hi, I played around with buffer overflows on Linux (amd64) and tried exploiting a simple program, but it failed. I disabled the security features (address space layout randomization…
I've implemented a gen_server and supervisor: test_server and test_sup. I want to test them from the shell/CLI. I've written their start_link functions such that their names are…