command-line

Is there a command to write random garbage bytes into a file?

I am now doing some tests of my application again corrupted files. But I found it is hard to find test files. So I'm wondering whether there are some existing tools, which can write random/garbage bytes into a file of some format. Basically, I need this tool to: It writes random garbage bytes into the file. It does not need to know t...

How to make maven use system proxy settings

I'm using Ubuntu with Gnome where I can set network proxy settings (with authentication). The question is: how I can run maven in command line and make it use this proxy? ...

Piping output from ssh back to the local shell

Is there a way, from ssh, to get output back to the shell ssh was invoked from, kind of like :! in vim? For example, say I'm grepping a file for 'bananas' on a remote server, and I want to copy the output to an IM window - is there a way to invoke pbcopy on my local machine, or am I stuck selecting/copying from the terminal window? In ...

PHP: Why is readdir working for me at command line but not browser?

I have 2 folders: /var/www/vhosts/mydomain.com/httpdocs/ and /var/www/vhosts/mydomain.com/httpdocs/duh/ Both folders have the EXACT same perms, group, owner, everything. If I set $path to the first one, no problems, I echo a list of files with 'html' in the filename. If I set $path to the second one, it dies on the opendir(). However,...

Which is the best way to allow configuration options be overridden at the command line in Python?

I have a Python application which needs quite a few (~30) configuration parameters. Up to now, I used the OptionParser class to define default values in the app itself, with the possibility to change individual parameters at the command line when invoking the application. Now I would like to use 'proper' configuration files, for example...

OS X can't find ANY libraries!!

I recently had some HD issues and had to get a new one. I transferred over my data using Migration Assistant on my freshly imaged disk. Then with but a minute left until I was in the clear, there is a town wide power outage. I was at work and had no backup generator and the university's didn't source the outlets, so my transfer was stopp...

Is it possible to accept custom command line parameters with InnoSetup

I am preparing an installer with Innosetup. But I'd like to add additional custom (none of the available parameters) command line parameters and would like to get the value of the parameter, like: setup.exe /do something check if /do is given, then get the value of something. Is it possible? How can I do this? ...

Ensuring proc_open will keep the command line window alive in PHP

In PHP I am using proc_open to run a command at the command line. It needs to open in a new CMD window, so I prepended 'start' to the beginning of the command. However, it also needs to stay open to display the results, but actually it closes the window automatically afterwards. I have tried adding 'pause' and also the /k option to 'r...

How to use REG_EXPAND_SZ from the commandline?

Hi, I was reading the Windows Commandline Documentation (Win+F1) about the commands that modify the Windows registry, particularly the the "reg add" command. reg add HKCU\testfolder /t REG_EXPAND_SZ /v Stokrotka /d "%systemroot%\system32" Now, I don't know how this was designed to work. When I invoke the command above, the variable %s...

Short options only in boost::program_options

How would one go about specifying short options without their long counterparts in boost? (",w", po::value<int>(), "Perfrom write with N frames") generates this -w [ -- ] arg : Perfrom write with N frames Any way to specify short options only? ...

c++ command line software

Alright, so I've "mastered" the idea of GUI programming in Java and decided I would not touch anything related to windows/linux UI in c++. I've looked at a few UIs programmed in c++ and a few classes already and decided it's not for me. But on that note, what about command line interfaces. I'm currently working on a shipping computer at ...

Linux: how to set up a timezone of a process?

Hi I'd need to set timezones of individual processes started on a linux box. I tried setting TZ variable (in the local context), but it didn't work. Is there a way of running an app from a command line with a different system date to the system one? It might sound stupid, but I need a kind of a sandbox where the system date would be cha...

FTP Batch Upload Script

Two questions pertaining to a FTP Batch upload script I'm working on. 1) My log-in script is failing even though I know my credentials are valid. Any suggestions about this code snippet? open ftp.mydomainname.com user (ftp.mydomainname.com:(none)):[email protected] password:mypassword 2) This is just a general questio...

Move all files of certain file type using SVN

I have a directory full of image files. I want to move all the .jpg files one directory up $svn move *.jpg ../ $svn: Client error in parsing arguments As you can see this approach doesn't work. If this isnt possible how do I move ALL the files up one directory? SVN version 1.4.4 on OSX 10.5 ...

Queuing Nmap Commands in a visible command prompt window in Java

I am trying to run multiple Nmap commands one after another. Ideally, each Nmap command will be created in its own command prompt window. The Nmap command will execute and finish. Then another command prompt will appear with the next Nmap command, execute, and so on and so forth. Unfortunately, the the way the program currently runs,...

Match escape sequence for "bold" in console output with grep

Hi I have lots of logfiles with ^[[1m (as vim displays it) in them. I want to watch a logfile life via tail -n 1000 -f logfile.log | grep <expression-for-escape-sequence> and only get lines that have bold in them. I am not sure which grep options I should use and have tried the following already: tail -n 1000 -f logfile.log | grep "...

How to determine if a build is from the editor or command line?

I am building a C++ solution with Visual Studio 2005. Sometimes I open the solution in Visual Studio and build it from within the development environment. Other times I build it from the command line using msbuild.exe. I'm wondering if there is a way that I can determine which of these two types of builds I'm using at compile time (f...

Long programs using python -c switch

Hi, I would like to use python for things I've been doing using bash. Is it possible to use the -c switch for long programs, e.g. a for loop with two statements? This would let me use python directly from command line, just like bash or php. Thanks. EDIT: Don't know how I missed it, simply doing a python -c ' and then pressing enter do...

Bulk Delete EBS Snapshots From the Command Line in Windows?

Hello! I'm trying to delete all snapshots except the X newest ones on a Windows AWS instance via the EC2 commandline API tools. I've found the following for Linux... Is it possible to do the same in Windows? ec2-describe-snapshots | sort -r -k 5 | sed 1,6d | awk '{print "Deleting snapshot: " $2}; system("ec2-delete-snapshot " $2)' ...

How to debug a C# command-line program

I'm trying to build a command-line tool in C# with VS2010. My question is: how do I debug this, like I would a winforms. With winforms, I can step through the code, see the values at each individual step, etc... Here however, the program only responds when I talk to it from the command line. I can't start a debug session, since that wi...