command-line

GhostScript, How to set custom page size using command line?

萝らか妹 提交于 2021-02-11 01:16:16
问题 I know that have a simillar question : How to change Ghostscript output file (in printer spooler) but the answers was not helpful I using the command : -q -dBATCH -dNOPAUSE -dNODISPLAY -c "mark /NoCancel true /OutputFile (%printer%Ricoh c2051) /UserSettings << /DocumentName (Test) /MaxResolution 600 >> (mswinpr2) finddevice putdeviceprops setdevice" -f "C:\duplex.pdf" to set a custom name for document, but if a try to use "-sPAPERSIZE=a4" still the outputpaper size is "LETTER". then,how to

Is there a command to list all the servers currently being run locally?

泪湿孤枕 提交于 2021-02-10 19:39:30
问题 Im sure this question has been asked before I am just having a really hard time finding it... Currently when I go to start my rails server, I am running into `initialize': Address already in use - bind(2) for "0.0.0.0" port 5000 (Errno::EADDRINUSE) obviously port:5000 is currently being used but is there is quick way to list all local web servers and to also kill said servers. Please excuse my ignorance. 回答1: ps aux | grep ruby or ps aux | grep rails find the server then kill -9 pid 来源: https

DOS Multiline batch command. How to add comments between arguments?

左心房为你撑大大i 提交于 2021-02-10 12:02:03
问题 Id like to add comments like this: makecert -r ^ // This means SelfSigned -pe ^ // Private key is exportable -a sha512 ^ // The algoritm ... Is this possible? How? 回答1: Nothing official, but there is a simple and very effective hack - use undefined variables. At least one = is added to guarantee that the content cannot be a valid variable name, since the character cannot be used in a variable name. I use one at the beginning and end just for symmetry. Also, the comment cannot contain % or : .

DOS Multiline batch command. How to add comments between arguments?

折月煮酒 提交于 2021-02-10 12:01:52
问题 Id like to add comments like this: makecert -r ^ // This means SelfSigned -pe ^ // Private key is exportable -a sha512 ^ // The algoritm ... Is this possible? How? 回答1: Nothing official, but there is a simple and very effective hack - use undefined variables. At least one = is added to guarantee that the content cannot be a valid variable name, since the character cannot be used in a variable name. I use one at the beginning and end just for symmetry. Also, the comment cannot contain % or : .

DOS Multiline batch command. How to add comments between arguments?

你。 提交于 2021-02-10 12:01:23
问题 Id like to add comments like this: makecert -r ^ // This means SelfSigned -pe ^ // Private key is exportable -a sha512 ^ // The algoritm ... Is this possible? How? 回答1: Nothing official, but there is a simple and very effective hack - use undefined variables. At least one = is added to guarantee that the content cannot be a valid variable name, since the character cannot be used in a variable name. I use one at the beginning and end just for symmetry. Also, the comment cannot contain % or : .

Parsing multiple arguments from the command line Node.js/js

回眸只為那壹抹淺笑 提交于 2021-02-10 06:29:06
问题 I'm trying to write a program that takes any number of command line arguments, in this case, strings and reverses them, then outputs them to the console. Here is what I have so far: let CL = process.argv.slice(2); let extract = CL[0]; function reverseString(commandInput) { var newString = ""; for (var i = commandInput.length - 1; i >= 0; i--) { newString += commandInput[i]; } return console.log(newString); } let call = reverseString(extract); I can't figure out a way to make this work for

How to compile Kotlin to include jar of Java with command line?

回眸只為那壹抹淺笑 提交于 2021-02-10 05:44:05
问题 I want to include jar of Java to Kotlin. I tried like below, but I had error. javac -encoding utf-8 javasorce/test/JavaTestClass.java jar cvf javasorce/test/JavaTestClass.jar javasorce/test/JavaTestClass.class kotlinc kotlin/CallJavaTestClass.kt -cp javasorce/test/JavaTestClass.jar -include-runtime -d kotlin/CallJavaTestClass.jar java -jar kotlin/CallJavaTestClass.jar The error is: Exception in thread "main" java.lang.NoClassDefFoundError: javasorce/test/JavaTestClass at CallJavaTestClassKt

How to compress all files with exception of newest file in each subfolder of a folder into one ZIP file per subfolder?

醉酒当歌 提交于 2021-02-10 05:20:10
问题 I'm trying to create a batch script that will zip all the contents in each subdirectory except the latest (or latest few). I'm currently attempting in Windows with 7-Zip but the directory is technically on a Linux server so any suggestions geared towards a Linux command is welcome. The directory structure is like this: Directory-Parent ---Sub-Directory-1 --------File1 --------File2 --------File3 ---Sub-Directory-2 --------File1 --------File2 I would like to run a batch at the Directory-Parent

Run a python script and a compiled c code without terminal or dock item in Mac OS X

廉价感情. 提交于 2021-02-10 05:11:55
问题 For great help from stackoverflow, the development for the Mac version of my program is done. Now I need to deploy my program, and I was wondering if there is any way to "hide" my running Python code (it also runs .so library and it seems it makes a dock item to appear). The program is supposed to be running in the background and it would be great if I can hide any terminal or dock items. In Windows or linux, it was easy, but I am still not that used to Mac and could not figure out how to do

Multiple lines input from console in c#

五迷三道 提交于 2021-02-08 13:59:16
问题 I am trying to read some values in c# from console and then processing them. However i am stuck at a error. The input from console is: Name:ABCD School:Xyz Marks:80 //here the user enters a new line before entering new data again Name:AB School:Xyz Marks:90 //new line again Name:AB School:Xyz Marks:90 and so on. I do not know before hand the number of console inputs...How can i detect that user has stopped entering & store the input. I tried using string line; while((line=Console.ReadLine())!