0
votes
1answer
24 views

Writing a secure login script

I'm trying to write a secure login script to allow a user to have limited access to a server and change particular options. My method for doing so is via a python script executed by the users ...
0
votes
1answer
67 views

ipython notebook can't find python

I had a couple of Python 2 versions under home-brew. Since I was only using ipython notebook, I decided to uninstall all Python 2 instances, which turned out to be a bad idea because now I just get an ...
0
votes
1answer
45 views

Is it possible to open a port for listening without netcat?

I have a need for a Linux system to listen on a TCP port and dump what it receives to a file and/or stdout. The system does not have netcat installed. I have root permissions, but am not allowed to ...
2
votes
2answers
60 views

How do I handle multiple quotes in an alias (for bash or zsh)

I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly. So far I've got: pycalc() { ...
1
vote
2answers
27 views

Can't run the Python interpreter in Mac's Terminal

At the moment i'm on Mavericks, and i just uninstalled homebrew. With homebrew i had installed python, but after uninstalling it my terminal can't start the python interpreter. I receive this message: ...
0
votes
1answer
100 views

Why do python's os.stat and du and ls not agree on block size?

While writing a simple function that computes the quantity of blocks consumed in a directory, I checked with du to see that I was getting the same answers. Why do ls and du say this file occupies ...
1
vote
1answer
62 views

Can't get a bash to work with python on a SGE

I'm currently working on a SGE and I'm extremely unfamiliar with the linux environment. I have to execute python scripts but the setup is kinda confusing for me and I can't get it to work. The ...
0
votes
0answers
99 views

Find an xterm window by title, enter one command and press return using python/bash

I have an xterm window with a custom title. The xterm was fired up the following way: xterm -T customTitle I would like to enter a command (for example ls -l) into this xterm window from a ...
0
votes
1answer
397 views

Passing parameters to python -c inside a bash function?

I need to print the value of a Django setting while in a Bash shell. Basically, the command I'd like to run is python -c 'from django.conf import settings; print settings.MEDIA_ROOT'. I need to be in ...
1
vote
2answers
833 views

Apple Mavericks - why doesn't this one-line BASH script set my Python virtual environment like I expect?

I have the following Bash script: #!/bin/bash echo $MYPROJECT_HOME/bin/myproject_venv/bin/activate source $MYPROJECT_HOME/bin/myproject_venv/bin/activate echo ...
0
votes
1answer
147 views

bash: syntax error near unexpected token `ex25'

all I have tried to make a program from 'learn python the hard way'. it's exercise 25. in the extra credit it tells me to go help(ex25), but when I type that in, I get this on linux mint 15 terminal: ...
0
votes
0answers
49 views

Why is the Python interpreter provided by Django suddenly showing me Python tab completion upon a single Tab press?

This issue seems to have just started happening; basically I just noticed that whenever I press the Tab key in the Python interpreter that comes with Django, it gives me the Display all ... ...
1
vote
1answer
76 views

How do I get `set show-all-if-ambiguous on` in my .inputrc to play nice with the Python interpreter?

I noticed that after I added the set show-all-if-ambiguous on line to my ~/.inputrc, whenever I pressed tab to indent a block, it would show me the bash Display all ... possibilities? (y or n) prompt, ...
2
votes
1answer
73 views

How do i need store all command output and errors

Hi there! I need to capture all command, stdout and stderr without any addition to command. I mean, that i need store to 3 files result of this: $ echo 'test' $ ls -l $ cat some_file ...
3
votes
1answer
126 views

Combining multiple MP3 files from a specific day

Everyday I have about 10 different mp3 files created on my server. What I would like to do is setup a cronjob to run at night and combine the current days tracks into one mp3 track. I don't care so ...
3
votes
2answers
248 views

Dowloading all Urls accessible under a given domain with wget without saving the actual pages?

Hi trying to determine all the valid urls under a given domain without having the mirror the site locally. People generally want to download all the pages but I just want to get a list of the direct ...
2
votes
0answers
55 views

SoX fails to concatenate *some* newly generated aiff files

I have a Python script that is using Mac OS X's built in speech synthesis API to create aiff files of some processed text via PyObjC/AppKit. Everything is working fine, but I can't get the aiff files ...
0
votes
0answers
158 views

Edit Zip files recursively using VI editor

I have a use case in which I want to edit a file using vi editor which is bundled inside a war package and the war package is bundled inside an ear package. I am on a linux machine Oracle Enterprise ...
0
votes
1answer
617 views

Rsync Remote To Local Issue

I was wondering if I could get some help with this rsync command. I am trying to copy files from a remote system by running rsync on the local system. Here is my command: /usr/bin/rsync -avz ...
1
vote
1answer
259 views

Rundeck get verbose output of command executing on node

I have Rundeck executing a remote script, which is in python is using print statements to return output normally such as: $ python mytest.py PASS: Condition 1 passed PASS: Condition 2 passed PASS: ...
0
votes
3answers
695 views

Raw multiline string in bash?

Is there a way to get an uninterpreted string in bash - it could include single and ouble quotes and Bang ! etc. ? I want to do something like #!/bin/bash echo -e "Line One\nLine Two\nLine three" | ...
0
votes
1answer
203 views

Streaming log file contents (piping)

I am trying to understand how piping works and am stuck at this point. A log file is being streamed and its output is being piped to pigz. What I am trying to do is, redirect the pigz content to a ...
1
vote
2answers
513 views

Function defined in my user's .bashrc causes an error when I sudo su

I have a function defined in my user's .bashrc file that displays my current git branch name at my command prompt: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* ...
1
vote
3answers
59 views

How do I get multiple scripts prompted with an alias in Cygwin?

I want to run one command, then bring up a second, but modify it first before pressing enter on it. (Cygwin) I usually just type it all out like this: svn up 8.0; ./merge.py 8.0 12345 I also have ...
0
votes
1answer
2k views

How can I make script globally executable in Ubuntu?

I have a bash script which I would to like to execute from everywhere (like other Linux basic commands, for example ls). I tried to follow this tutorial but it doesn't work, I always get command not ...
3
votes
2answers
98 views

Deleting Certain Extension with Bash (quickly)

I have seen other threads about deleting a certain extension in a directory. However, when I try it, it seems to work but takes a long time to go through directories and say "Permission denied" on ...
1
vote
1answer
417 views

Redirect output of remote python app started through ssh to file

I have a python app in a remote server that i need to debug, when I run the app locally it prints some debug information (including python tracebacks) that i need to monitor. Im trying to redirect ...
0
votes
4answers
473 views

iMacros-like program for terminal?

Is there such a program for Terminal like the iMacros plugin for Firefox, that can record what I did, then automatic do the work I have done? I hope that there is such a program to help me do the ...
7
votes
2answers
102 views

Is it possible to modify bash to run one command through another (say a python script)?

I was wondering if it is possible to modify bash such that when I type command --arg1 what actually happens is ~/prerun.py command --arg1 (prerun.py would handle starting command --arg1 itself) ...
1
vote
2answers
34 views

Find script with early cutting branches on first occurences

It must exists, my problem is how to express my need. When I search for a given filename, Iwant the search stop searching the current branch when it finds a first occurence, BUT continue to search in ...
6
votes
4answers
5k views

Making `#!/usr/bin/env python` work on Windows

I use Bash on Windows, provided by MSYS. I tried to run a Python file with a shebang of #!/usr/bin/env python, but I get this error message: /usr/bin/env: python: No such file or directory What ...
8
votes
3answers
618 views

How can I run my python program directly from the shell?

I wrote a script. When it starts, it won't stop, and it keeps getting data from the Internet. I can call it this way: cd /User/Desktop/project/internetScanner/ python3 main.py start But I would ...
6
votes
10answers
11k views

Scripting: what is the easiest to extact a value in a tag of a XML file?

I want to read a pom.xml ('Project Object Model' of Maven) and extract the version information. Here is an example: <?xml version="1.0" encoding="UTF-8"?><project ...
0
votes
1answer
460 views

osx: setting default python for files in terminal?

How do I set the default python for running py files without "python" keyword i.e $ django-admin.py manage.py startproject" in bash shell?
1
vote
2answers
171 views

Split a file by two consecutive newlines

I have text file like this 1. some topic a 20p ID: 20 2. something topic another here there ID: 30 3. ... here come another ID: 40 They are separate by two newlines. How could I split this into ...
1
vote
1answer
150 views

Quitting dozens of the same process in OS X Terminal

Whenever I'm testing a python class I'm working on, I initiate and re-initiate python a lot to refresh the updates I make to the code. When I close the Terminal window later, I get a window that says ...
1
vote
2answers
519 views

Linux: Compressing files despite low disk space

I use Linux. I coded a screenshot program some time ago and now I have 9 GIG of screenshots, 60000 JPEGs, most of them look pretty similar, and I have 300 MB of disk space remaining. What are some ...
1
vote
1answer
495 views

Character encoding after shebang in shell scripts?

I came across some Ruby scripts on Github. The first line is the normal shebang (#!/usr/bin/ruby), but the second line is the following: # -*- coding: utf-8 -*- I didn't know this method of ...
0
votes
2answers
718 views

List/remove files, with filenames containing string that's “more than a month ago”?

I store some data in files which follow this naming convention: /interesting/data/filename-YYYY-MM-DD-HH-MM How do I look for the ones with date in file name < now - 1 month and delete them? ...
2
votes
0answers
204 views

Branch names not showing in Mercurial's tab completion

I have a development machine running mercurial 1.6.3. Tab completion in bash works great for completing commands, tags and branch names. I've set up a new machine with the same mercurial version (both ...
0
votes
3answers
831 views

remotely execute bash or python scripts via webserver on ubuntu

Hi I want to run certain scripts on my linux machine by simply clicking a link on a webpage that is supplied by a webserver running on that machine. It is currently running ubuntu, which webserver ...
0
votes
3answers
780 views

How do I find out which file type is taking up the most space?

I have a zillion little files in a complex folder hierarchy; these are taking up too much space (ie. terabytes). I'd like to find out which file type (ie., .pdf etc) is taking up all the room so that ...
24
votes
4answers
63k views

How can I change the default Python version on Snow Leopard?

I recently upgraded my Mac OS X 10.5 Leopard install to 10.6 Snow Leopard, and with that came an upgraded version of Python, 2.6.1 (instead if 2.5.1). Now when I type python in the Terminal i still ...