command

Linux zip command: add a file with different name [closed]

扶醉桌前 提交于 2019-11-29 01:14:05
I´d like to add a file in a zip file, with a different name, and avoiding the creation of a new file with the desired name. For example, I´d like to add the myfile.txt file to a zip, but renaming it to myfile2.txt. Thanks mkrnr You can use zipnote which should come with the zip package. First build the zip archive with the myfile.txt file: zip archive.zip myfile.txt Then rename myfile.txt inside the zip archive with: printf "@ myfile.txt\n@=myfile2.txt\n" | zipnote -w archive.zip (Thanks to Jens for suggesting printf instead of echo -e .) A short explanation of "@ myfile.txt\n@=myfile2.txt\n"

How to recover the deleted files using “rm -R” command in linux server? [closed]

不羁的心 提交于 2019-11-28 23:19:25
I have unfortunately deleted some important files and folders using 'rm -R ' command in Linux server. Is there any way to recover? since answers are disappointing I would like suggest a way in which I got deleted stuff back. I use an ide to code and accidently I used rm -rf from terminal to remove complete folder. Thanks to ide I recoved it back by reverting the change from ide's local history. (my ide is intelliJ but all ide's support history backup) Short answer: You can't. rm r e m oves files blindly, with no concept of 'trash'. Some Unix and Linux systems try to limit its destructive

WPF ContextMenu with ItemsSource - how to bind to Command in each item? [duplicate]

夙愿已清 提交于 2019-11-28 23:15:27
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Specify Command for MenuItem in a DataTemplate I have a collection of objects (viewmodels) that represent menu items. Each of them have a command that I would like to execute when a MenuItem is clicked. If I wanted to do the menu statically, I do it like this: <ContextMenu> <MenuItem Header="{Binding Text1}" Command={Binding Command1}> <MenuItem Header="{Binding Text2}" Command={Binding Command2}> </ContextMenu>

how to call a program from python without waiting for it to return

元气小坏坏 提交于 2019-11-28 23:11:08
is there a way to call a program from python without waiting for it to return? i created a script which copies a program to a directory and runs that program. but when i call the program from python, the python script does not exit until the program i launched exits. i have tried os.system and Popen. is there another way to do this? Added info: os.spawnl with os.P_DETACH still doesn't work; according to the docs, "P_DETACH is similar to P_NOWAIT, but the new process is detached from the console of the calling process". but it is still somehow attached to my calling process (calling script won

CTest with multiple commands

馋奶兔 提交于 2019-11-28 23:00:05
问题 I'm building some tests using CTest. Usually, I can set up the test by simply the line: ADD_TEST(Test_Name executable args) However, I've run into a problem, I have some tests that require two commands to be run in order for it to work, is there any way I can run two programs within a single ctest, or am I required to create a new test for each? Thank you. 回答1: The add_test command only accepts one executable, but you can run any executable that is really a script. To do this in a cross

Pass private key password to openvpn command directly in Ubuntu 10.10 [closed]

南笙酒味 提交于 2019-11-28 22:49:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I tried the method with different parameter I have password. Here below password is mypassword 1) root$ echo mypassword || openvpn client.conf.ovpn the result was display: mypassword 2) root$ openvpn client.warriors.conf.ovpn || echo mypassword the result was display: Thu Jun 28 00:00:00 2012 us=757575 NOTE:

WPF MVVM Correct way to fire event on view from ViewModel

佐手、 提交于 2019-11-28 22:34:33
问题 In my WPF application I have 2 Windows (both Windows have their own ViewModel): Application's Main Window that displays list with bunch of words (bound to MainViewModel) Dialog Window that allows users add new items to the list (bound to AddWordViewModel) MainViewModel has Articles property of List(this collection is populated by one of the service classes) bound to Main Window's ListBox AddWordViewModel has SaveWordCommand that is bound to Add Word Dialog's Save button. It's task is to take

How can I assign the 'Close on Escape-key press' behavior to all WPF windows within a project?

巧了我就是萌 提交于 2019-11-28 22:33:06
问题 Is there any straightforward way of telling the whole WPF application to react to Escape key presses by attempting to close the currently focused widow? It is not a great bother to manually setup the command- and input bindings but I wonder if repeating this XAML in all windows is the most elegant approach? <Window.CommandBindings> <CommandBinding Command="Close" Executed="CommandBinding_Executed" /> </Window.CommandBindings> <Window.InputBindings> <KeyBinding Key="Escape" Command="Close" />

Using SC to install a windows service and then set recovery properties

你说的曾经没有我的故事 提交于 2019-11-28 22:05:50
问题 I want to set the Recovery Options on a Windows Service I'm installing on a Windows Server 2003. I know this is possible to do manually, but I want to set the Recovery configuration when I install the service. I use SC script to do this: SC create MyService displayname= "MyService" binpath= "C:\Program Files\MyService\MyService.exe" start= auto SC failure MyService reset= 86400 actions= restart/1000/restart/1000/run/1000 SC failure MyService command= "C:\Program Files\Myservice\MyService.exe"

Linux command output as a parameter of another command

送分小仙女□ 提交于 2019-11-28 22:01:46
I would like to pass the output list of elements of a command as a parameter of another command. I have found some other pages: How to display the output of a Linux command on stdout and also pipe it to another command? Use output of bash command (with pipe) as a parameter for another command but they seem to be more complex. I just would like to copy a file to every result of a call to the Linux find command. What is wrong here?: find . -name myFile 2>&1 | cp /home/myuser/myFile $1 Thanks This is what you want: find . -name myFile -exec cp /home/myuser/myFile {} ';' A breakdown / explanation