command-line

How to run multiple commands in a batch file?

牧云@^-^@ 提交于 2020-03-18 11:50:51
问题 I am having the below commands in a batch file. While i try to run it using Execute action in Finalbuilder project, 1st command alone was run. So, i planned to have each commands in various batch files. Could anyone please help me to run all the commands in a single batch file run with the delay (if required)? Commands: dnvm list dnvm install 1.0.0-beta8 dnvm use 1.0.0-beta8 –p dnvm -Args alias default 1.0.0-beta8 Also i am getting the below error when run the last command through batch file

set environment variable in GDB from output of command

末鹿安然 提交于 2020-03-17 13:19:08
问题 I am trying to exploit a buffer overflow in a challenge, the buffer gets it's value from an environment variable. In GDB I know that you can set environment variables using the command: set environment username = test However I need to pass the username variable special characters, so I need to do something like: set environment username= $(echo -e '\xff\x4c......') But that command doesn't get executed and the username variable contains literally what I wrote down, does anybody know a trick

set environment variable in GDB from output of command

血红的双手。 提交于 2020-03-17 13:12:06
问题 I am trying to exploit a buffer overflow in a challenge, the buffer gets it's value from an environment variable. In GDB I know that you can set environment variables using the command: set environment username = test However I need to pass the username variable special characters, so I need to do something like: set environment username= $(echo -e '\xff\x4c......') But that command doesn't get executed and the username variable contains literally what I wrote down, does anybody know a trick

Output in Reverse in CMD

亡梦爱人 提交于 2020-03-04 16:38:27
问题 I have a phrase that needs to be outputted in results.txt. The phrase comes from x.txt. For example: "I have two kids", it should output "kids two have I" in results.txt. UPDATE Its already working but i want no loop. Pls see code below Code @ECHO OFF set /p content=<x.txt SET var=!content: =,! SET rev= :LOOP IF NOT "!var!"=="" ( FOR /F "delims=, tokens=1,*" %%F IN ("!var!") DO ( SET rev=%%F,!rev! SET var=%%G ) ) ELSE ( SET rev=!rev:~0,-1! GOTO ENDLOOP ) GOTO LOOP :ENDLOOP ECHO !rev:,= ! >

Run intellij idea project from command line

て烟熏妆下的殇ゞ 提交于 2020-03-03 05:00:27
问题 I have quite massive project which was developed in intellij Idea. Now I have to be able to run it from command line, but there are too many libraries including maven dependencies are used. Is there a way to get command line that is used by intellij idea when it runs a project? 回答1: If you use maven you can do this: mvn install mvn exec:java -Dexec.mainClass="com.module.Main" -Dexec.classpathScope=runtime 来源: https://stackoverflow.com/questions/26400893/run-intellij-idea-project-from-command

Getting The Full Result from “ps”

限于喜欢 提交于 2020-02-29 20:08:29
问题 How do I get the full width result for the *nix command " ps "? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything? 回答1: Try ps -w -w aux . The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux. 回答2: Specify the w option

Getting The Full Result from “ps”

时光怂恿深爱的人放手 提交于 2020-02-29 20:06:51
问题 How do I get the full width result for the *nix command " ps "? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything? 回答1: Try ps -w -w aux . The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux. 回答2: Specify the w option

Getting The Full Result from “ps”

旧时模样 提交于 2020-02-29 20:05:53
问题 How do I get the full width result for the *nix command " ps "? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything? 回答1: Try ps -w -w aux . The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux. 回答2: Specify the w option

perl and bash variable substitution, with hexadecimal characters and repeat count

倖福魔咒の 提交于 2020-02-29 06:32:07
问题 alex@d120432:~$ echo $0 bash alex@d120432:~$ perl -e 'print "\x41\x42\x43\x44\x0a"x2' ABCD ABCD alex@d120432:~$ i=2 alex@d120432:~$ echo $i 2 alex@d120432:~$ perl -e 'print "\x41\x42\x43\x44\x0a" x $i' alex@d120432:~$ Is it possible to get the same output in the second perl command? I cannot find correct syntax to use i as repeat count. 回答1: You will have to escape inner double quotes and use double quotes in shell for variable expansion: perl -e "print \"\x41\x42\x43\x44\x0a\" x $i" ABCD

perl and bash variable substitution, with hexadecimal characters and repeat count

不打扰是莪最后的温柔 提交于 2020-02-29 06:32:06
问题 alex@d120432:~$ echo $0 bash alex@d120432:~$ perl -e 'print "\x41\x42\x43\x44\x0a"x2' ABCD ABCD alex@d120432:~$ i=2 alex@d120432:~$ echo $i 2 alex@d120432:~$ perl -e 'print "\x41\x42\x43\x44\x0a" x $i' alex@d120432:~$ Is it possible to get the same output in the second perl command? I cannot find correct syntax to use i as repeat count. 回答1: You will have to escape inner double quotes and use double quotes in shell for variable expansion: perl -e "print \"\x41\x42\x43\x44\x0a\" x $i" ABCD