command

How to show ping output dynamically in a web page?

五迷三道 提交于 2019-12-03 12:38:58
问题 As part of a diagnostics page I would like to have the user be able to run a "ping", ie an ordinary shell command to send ICMP_ECHO_REQUSTs to a certain IP and display the resuls dynamically in a div in the browser. The backend is Ruby/Rails. I'm past running the command on the server side and reading the output from the ping command. And I've been building web pages that periodically calls back to the server to update som parts of the page dynamically. But in this case there are three

In GDB, how do I execute a command automatically when program stops? (like display)

一曲冷凌霜 提交于 2019-12-03 12:35:08
I want some commands to be automatically executed each time the program stops, just like what display does with x. How do I do that? neuron Here's the easy way I found out: define hook-stop ...commands to be executed when execution stops end Refer to this page for details: http://sourceware.org/gdb/current/onlinedocs/gdb/Hooks.html#Hooks Another "new" way to do it is with the Python Event interface : def stop_handler (event): print "event type: stop" gdb.events.stop.connect (stop_handler) which will trigger the stop_handler function each the the inferior stops. There are two other similar

Cordova and setting Android using command line

烈酒焚心 提交于 2019-12-03 11:59:11
I am trying to migrate my existing project from cordova 2.1 to the latest, 3.1 wich can be installev vía command line, I already have the Android SDK installed, So: sudo npm install -g cordova // All good cordova create hello com.example.hello HelloWorld // All good cordova platform add android // Then it fires: Checking Android requirements... [Error: The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: ] So I installed Macports and tried: sudo port install android Wich logs: Warning

How commit all files except one with SVN

无人久伴 提交于 2019-12-03 11:53:04
问题 I want to commit all modified files except one using Subversion. So here is the scenario: $ svn st M file1 M file2 M file3 M file4 I can do something like this: svn ci -m "Commit 1" file1 file2 file3 svn ci -m "Commit 2" file4 But when a large number of files, I'm trying to simplify my work: svn ci -m "Commit 1" `svn st | awk '{print $2}' | grep -v file4` svn ci -m "Commit 2" file4 This solution is very fragile, because this scenario not works: $ svn st M file1 M file2 D file3 A + file4 I

“ps aux” works but “ps -aux” doesn't

[亡魂溺海] 提交于 2019-12-03 10:42:01
This might seem like a silly question but I haven't been able to find a clear answer. This website states that the dash is optional in ps aux However, ps aux works but ps -aux brings up the error no user named 'x' . Any ideas what the issue may be here? Running Mac 10.8.2. Thanks man ps will give you this: The biggest change is in the interpretation of the -u option, which now displays processes belonging to the specified username(s). Thus, "ps -aux" will fail (unless you want to know about user "x"). As a conve- nience, however, "ps aux" still works as it did in Tiger. Back in the day (from

Need to Capture selective STDOUT from Android for display in listview

天涯浪子 提交于 2019-12-03 10:17:19
问题 I'm running the an embedded library [tuProlog (2p.jar)] Prolog Inference Engine in Android with custom logic bases which I can successfully query and display (some) of the results in an Android ListView. What gets displayed is only the results from the inference engine itself, not ancillary commands like a Prolog 'write' statement which (by default) writes to STDOUT. I need to capture the result of that 'write' printing to the STDOUT in an Android variable to display to the user. The general

How do I get a Mac “.command” file to automatically quit after running a shell script?

纵然是瞬间 提交于 2019-12-03 09:51:28
In my shell script, my last lines are: ... echo "$l" done done exit I have Terminal preference set to "When the shell exits: Close the window". In all other cases, when I type "exit" or "logout", in Terminal, the window closes, but for this ".command" file (I can double-click on my shell script file, and the script runs), instead of closing the window, while the file's code says "exit", what shows on the screen is: ... $l done logout [Process completed] ...and the window remains open. Does anyone know how to get a shell script to run, and then just automatically quit the Terminal window on

Running R commands using a bash script

倖福魔咒の 提交于 2019-12-03 08:48:12
I have the commands below that I use to make plots in R. The main text file is cross_correlation.csv. How can I put it in bash script so that when I launch it on the terminal, the R commands will perform their jobs and finish (like all other shell scripts). cross_correlation <- read.table(file.choose(), header=F, sep="\t") barplot(cross_correlation$V3) dev.copy(png,"cc.png",width=8,height=6,units="in",res=100) dev.off() hist(cross_correlation$V3, breaks=15, prob=T) dev.copy(png,"hist_cc.png",width=8,height=6,units="in",res=100) dev.off() dwcoder If you have R installed, you should also have

PowerShell Invoke-Expression with ampersand in the command string

半腔热情 提交于 2019-12-03 07:24:45
I am trying to pass a variable with a string that contains an ampersand into Invoke-Expression, and it is telling me I have to put it in quotations and pass it as a string. I've tried multiple combinations of escaping and using a raw string and a string in a variable with combinations of "" and '' to no avail. How can I do it? Here's the code: $streamout_calmedia01 = ` "rtmp://75.126.42.216/livepkgr/calmedialive01?adbe-live-event=liveevent&adbe-record-mode=record" $streamcmd_calmedia01 = "C:\avconv\usr\bin\avconv.exe 'rtmp://75.126.42.211/transcoder/mobileingest live=1' -f flv -c:v libx264 -r

IntelliJ IDEA disable font increase/decrease on CMD+scroll

江枫思渺然 提交于 2019-12-03 07:21:09
问题 I am using IntelliJ IDEA 9.0.2 on Mac OS X - with the Magic Mouse. Whenever I press the command button and move my finger a micrometer or two on the surface of the mouse, IDEA immediately increases or decreases my font size rapidly. How can I disable this feature? 回答1: Settings | Editor | Enable Ctrl+MouseWheel changes font size (On Mac it would be Preferences | Editor | General | Enable CMD+MouseWheel changes font size .) 回答2: IntelliJ IDEA 14.1 By default it is disabled and it can be found