shell

deployd Error: Cannot find module ‘deployd/lib/resource’

i installed the file-upload module in deployd and cannot more start the deployd server. To install, i used those commands: npm install dpd-fileupload –save cd dpd-fileupload npm link and when i start the server, i get this error Error loading module node_modules/dpd-fileupload Error: Cannot find module ‘deployd/lib/resource’ at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at…
Read more

Haskell read from process

I’m not quite sure where the problem is, so I’m uncertain if the title is really accurate. I want to open a shell process, and write to it then read the output: import System.IO (hPutStr, hGetContents, hSetBuffering, hClose, BufferMode(NoBuffering)) import System.Process (runInteractiveProcess) main = do (hIn, hOut, _, _) <- runInteractiveProcess “/bin/sh” [] Nothing Nothing hSetBuffering hIn NoBuffering hPutStr hIn…
Read more

Python3: copy/paste sequence works only if done in two steps

I have the same problem on Cygwin/Windows and into a Debian ditro via ssh. If I open a terminal, and copy/paste this whole code at once: f = open(‘dst.txt’, ‘w’, encoding=’utf-8′) f.write(‘xc4xc4xc4’) f.close text = open(‘dst.txt’, encoding=’utf-8′).read() text len(text) I get: Python 3.6.0a0 (default, Jul 7 2015, 23:55:18) [GCC 4.7.2] on linux Type “help”, “copyright”, “credits” or “license” for more…
Read more

How to destroy the subprocess of Java Process

I use Runtime.getRuntime().exec to execute command tail -f filename | grep str which is based on OS pipe.I managed to achieve my business logic.But still there is a problem I must solve: when using pipe,the Process will for another process for tail command: $ ps -ef | grep test.log admin 6953 32721 0 16:32 ? 00:00:00 /bin/sh -c tail -f…
Read more

Pipe generated javascript via commandline

We use PhantomJS to create a screenshot of a webpage. It is run from the commandline, because for some reason php-phantomjs and screen-master don’t work on our server. The solution is to run the commandline script with a PHP shell_exec() command. PhantomJS uses a javascript file which tells what to do, which page to load, and where to write the…
Read more

ProtocolUnknownError when executing wkhtmltopdf from PHP with header and footer?

I have a strange problem with wkhtmltopdf executed from PHP. My PHP code looks like this: <?php exec(‘wkhtmltopdf –header-html “http://example.com/pdf-header” –footer_html “http://example.com/pdf-footer” /tmp/pdf.html /tmp/pdf.pdf’); ?> When I execute the same command from shell, it works perfectly. However, when I try to run it from PHP like mentioned above, the script runs until it time outs resulting in empty PDF file….
Read more

What is a hyphen beside a shell variable

I saw in some of our scripts that there is a hyphen attached to a shell variable. For example: if[ -z ${X-} ] What does this hyphen symbol beside the variable do here. I cannot find any documentation online for this. Source: shell