command-line

Cron Job - Command to delete all .flv files everyday

Hello all, I have this command that I run everyday via cron: find /home/get/public_html/videos -daystart -maxdepth 0 -mtime +1 -type f -name "*.flv" |xargs rm -f The problem is that it doesn't delete the .flv files in a directory that are 1 or more days old. How can I correct the above command? EDIT: Paul - the command "ls -l /ho...

What's an easy way to trim N lines from the tail of a file (without the use of 'head')?

Say I've got a bunch of files that are all >100 lines long. I'd like to trim off the top 14 lines and the bottom 9 lines, leaving only the lines in the middle. This command will trim off the top fourteen: cat myfile.txt | tail -n +15 Is there another command I can pipe through to trim off the bottom 9 without explicitly passing the ...

Command Line Compiling Settings.settings using VBC

To an earlier question of mine, invovling VBC and NAnt with WinForms, I have since come up with a better way of stating this. Within vbproj file, you have the following: <ItemGroup> <None Include="My Project\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <CustomToolNamespace>My</CustomToolNamespace> ...

Open txt file from C# application

The following code is suppose to open CMD from my C# application and open the file text.txt. I tried to set the file path as an environment variable but when notepad opens it looks for %file%.txt instead of text.txt Any idea why? System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents=false...

Simple string parsing in Cocoa / Objective-C: parsing a command line into command and arguments.

Here's a piece of code to take a string (either NSString or NSAttributedString) input that represents a command line and parse it into two strings, the command cmd and the arguments args: NSString* cmd = [[input mutableCopy] autorelease]; NSString* args = [[input mutableCopy] autorelease]; NSScanner* scanner = [NSScanner scannerWithStri...

Ignoring try block in C# command line program

I have a command line program in C# that I've wrapped with a try-catch block to keep it from crashing the console. However, while I am debugging it, if an exception is thrown somewhere in the DoStuff() method, Visual Studio will break on the "catch" statement. I want Visual Studio to break where the exception occurred. What's the best...

Trying to find a simple way to do upload only modified files through FTP.

Need to find a way to upload files to my server through FTP. But only the ones that have been modified. Is there a simple way of doing that? Command line ftp client or script is preferred. Thanks, Jonas. ...

How to test Internet connection speed from command line?

There's plenty of websites for it, but they're all Flash, not of much use for servers without graphics mode. Any tool I can use to test up/down bandwidth from Linux command line? ...

WPF Command Line

I am trying to create a WPF application that takes command line arguments. If no arguments are given, the main window should pop up. In cases of some specific command line arguments, code should be run with no GUI and exit when finished. Any suggestions on how this should properly be done would be appreciated. ...

Windows Command to detect and remove text in a file

I have an ascii file and in there somewhere is the line: BEGIN and later on the line: END I'd like to be able to remove those two lines and everything in between from a command line call in windows. This needs to be completely automated. EDIT: See http://stackoverflow.com/questions/425864/sed-in-vista-how-to-delete-all-symbols-between...

Flex Command Line compiler capablities

Although the Flex command-line compiler (mxmlc) can compile MXML+ActionScript files into SWFs, I need specific insights into its capabilities, via the command-line switches. Configure which language you're writing in, ActionScript 2 / 3 Configure which Flash Player version you're targetting, 7 / 8 / 9 / 10 Configure what frames of the ...

How to extract a text part by regexp in linux shell?

How to extract a text part by regexp in linux shell? Lets say, I have file where in every line is an IP address, but in different position. What is the most simple way to extract those IP addresses using common unix command-line tools? ...

How to process a YAML stream in Python

I have a command line app the continuously outputs YAML data in the form: - col0: datum0 col1: datum1 col2: datum2 - col0: datum0 col1: datum1 col2: datum2 ... It does this for all of eternity. I would like to write a Python script that continuously reads each of these records. The PyYAML library seems best at taking fully l...

Where's the HXML docs?

I've looked all over the HAXE Flash Command-line compiler website but was unable to find any detailed documentation of the HXML files (scroll down to the "Changing SWF properties" section) which describe the compile. Anybody know of a reference source? Found HXML: -swf MyApp.swf .... Compile to SWF -main MyAppClass .... Entry-point...

accessing command-line arguments from OSGi bundle

I have an application that runs as a collection of OSGi bundles. I start it using a very small wrapper that embeds the Felix framework. The necessity of that wrapper irks me a little, as does the fact that it depends on Felix (whereas the application itself could run just as well in, say, Equinox), so I want to get rid of it, and use the...

What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network?

What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network? I just need a number of how many of given addresses belongs to given subnet. Lets say network is 192.16.55.40/27 and addresses is 192.16.55.45, 192.16.55.115, 88.87.45.8, 192.16.55.37, 192.16.55.60 and 192.16.55.210.. ...

Are there good Java libraries that facilitate building command-line applications?

I need to write a simple command-line application in Java. It would be nice to use a library that takes care of parsing commands and takes care of things like flags and optional/mandatory parameters... UPDATE Something that has built-in TAB completion would be particularly great. ...

Execute multiple command lines with the same process using .NET

I'm trying to execute multiple commands without create a new process each time. Basically, I want to start the DOS command shell, switch to the MySQL command shell, and execute a command. Here's how I am calling the procedure (also below). Also, how do I handle the "\"'s in the command? ExecuteCommand("mysql --user=root --password=sa ca...

How do I upgrade PHP 5.1 to 5.2 on SUSE 10.1 using the yast command line only?

How do I upgrade PHP 5.1 to 5.2 from the SUSE 10.1 command line? Is there a package manager command to do it automatically? Actually I need JSON support to use the JavaScript-RTE and believe it's in PHP 5.2 only. ...

ClearCase: How to find elements that do NOT have a particular label

I'm looking for a ClearCase command that will list all the elements that are visible in my current view, but do NOT have a particular label applied to them. Say for example, most of the elements that are visible in my view have *LABEL_X* applied to them. I want a list of those elements that do not have *LABEL_X*. I obviously need to u...