Browsing articles tagged with "shell - 10/39 - Admins Goodies"
Aug 24, 2011
tom

Running Python scripts in linux

I’m trying to run Python scripts with a shebang on Ubuntu. When I create a python script #! /usr/bin/env python import sys … and run it I get a shell error: root@host:/home/user# ./test.py : No such file or directory How can I make it work? Solution: Remove ‘r’s from line endings with dos2unix. I assume the script is executable? Also, check for carriage returns — maybe windows got its dirty little hands on it? You [...]

Continue Reading »
Aug 24, 2011
tom

What is the purpose of each of the different UNIX/Linux shell startup files?

Previously, when setting up a *NIX environment for the first time, I would put all of my shell customisations into .bashrc, with the following .bash_profile: if [ -f $HOME/.bashrc ]; then . $HOME/.bashrc fi However, based on this answer and its associated comments, I’ve recently moved my PATH redefinition into .bash_profile. What types of commands do you feel should go into .profile, .bash_profile, .bashrc (and any other dotfiles), and why? They are read or not [...]

Continue Reading »
Aug 24, 2011
tom

What distributed shell utilities do people feel are good, flexible, and easy to use?

I’ve been searching and collecting links for a lot of them, but many of these tools don’t have enough use case or demonstration documentation to be able to evaluate their potential worth without installing and trying them out. I am hoping that people here have experience with some of them and can offer feedback regarding how easy they are to install, and use. My personal use case is a couple of machine pools that are [...]

Continue Reading »
Aug 24, 2011
tom

Superuser access in shell

How do I get root access from shell? When I’m trying to use su I get: default@default-laptop:~/home/default$ su Password: su: Authentication error default@default-laptop:~/home/default$ su wants the root password, if you’re running Ubuntu that will be scrambled. Try sudo -s -H or sudo su – and give your user password. Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Print for [...]

Continue Reading »
Aug 24, 2011
tom

How to find all executable files? (AIX)

example -rwxr–r– 1 me users 0 May 27 13:58 file_0 -rw-rwxrw- 1 me users 0 May 27 13:58 file_1 -rw-rw-rwx 1 me users 0 May 27 13:59 file_2 -rwxrwxrwx 1 me users 0 May 27 14:02 file_3 I would need to list all 4 files in the current dir AIX non-gnu ‘find’, so “find . -executable” won’t work find . -type f ( -perm -u=x -o -perm -g=x -o -perm -o=x ) worked for me. [...]

Continue Reading »
Aug 24, 2011
tom

windows cmd shell environments

I use it regularly (cmd), but let’s be frank, its environment sucks. No tabs, resizing the window is a pain, … and so on. Console2 and PowerCmd fix some of these problems. But still, I’d love to know are there any other environments for cmd shell. If you know of any, do tell. I’ve also heard of Terminator and Poderosa. Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook [...]

Continue Reading »
Aug 24, 2011
tom

“svn update” on a remote machine

I need an ability to run “svn update” on a remote machine for a non-technical user, how would I go about it? Our non-techincal users are using Windows XP and have Tortoise SVN client installed. I’m thinking to do following but I’m not really in a favor for either so far… Batch (that runs locally on Windows) Shell (runs on a remote machine requires SSH access/client) CGI (that runs on a remote machine via web) [...]

Continue Reading »
Aug 24, 2011
tom

Using unix ‘mail’ command from CGI – dangerous?

I am adding a feedback form to a web page and would like to know if it is safe to simply filter the contents of the TEXTAREA element (after decoding) through the ‘mail’ command to send an e-mail to the page’s maintainer. I have looked at the man page and cannot see a way to abuse this, in particular as long as ‘mail’ does not run in interactive mode, tilde escapes are disabled and ‘.’ [...]

Continue Reading »
Aug 24, 2011
tom

Store file in zip archive with different name (linux command shell)

In a linux command line, you zip a file by: zip -mqj archive.zip file.txt Now, I need to store ‘file.txt’ as ‘file2.txt’ in ‘archive.zip’, without renaming the file before zipping. When unzipped, the file should be called ‘file2.txt’. How can I store the file with a different name? Read through the MAN page and didn’t find an answer. Does creating a hard link to file.txt count? ln file.txt file2.txt Create file2.txt which points to the [...]

Continue Reading »
Aug 24, 2011
tom

Shell script to execute something when one of the daemon dies?

I just had to build two instances of daemon running on different ports. let’s say they both serve critical missions for some applications. How can I do some automatic task (eg. shell script) execution for checking both of daemons when one of them fails to serve? What kind of script that can always check the daemon’s life and maybe can execute some other jobs if one of the daemons incidentally stopped? monit is great in [...]

Continue Reading »
Pages:«1...78910111213...39»