Redirecting command output to a variable in bash fails
Maybe the output goes to stderr, not stdout? Try this: OUTPUT=”$(sudo apache2ctl configtest 2>&1)”
Maybe the output goes to stderr, not stdout? Try this: OUTPUT=”$(sudo apache2ctl configtest 2>&1)”
This should resolve the problem for Mac osX version: 10.8.2 add: ServerAliveInterval 120 TCPKeepAlive no to this file: ~/.ssh/config Or, if you want it to be a global change in the SSH client, to this file /private/etc/ssh_config “ServerAliveInterval 120” basically says to “ping” the server with a NULL packet every 120s, and “TCPKeepAlive no” means … Read more
→ dig -t ANY stackoverflow.com ; <<>> DiG 9.6.0-APPLE-P2 <<>> -t ANY stackoverflow.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20242 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;stackoverflow.com. IN ANY ;; ANSWER SECTION: stackoverflow.com. 1202 IN A 64.34.119.12 … Read more
Use the cmd activity start-activity (or the alternative am start) command, which is a command-line interface to the ActivityManager. Use am to start activities as shown in this help: $ adb shell am usage: am [start|instrument] am start [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>] [-c <CATEGORY> [-c <CATEGORY>] …] [-e <EXTRA_KEY> <EXTRA_VALUE> [-e <EXTRA_KEY> <EXTRA_VALUE> … Read more
Try reinstalling pip and then reinstalling virtualenvwrapper (I had to go through these steps after upgrading to Mavericks): $ sudo easy_install pip $ sudo pip install –upgrade virtualenvwrapper
I found it’s a combination: One The ZSH developers do not think that ZSH should define the actions of the Home, End, Del, … keys. Debian and Ubuntu fix this by defining the normal actions the average user would expect in the global /etc/zsh/zshrc file. Following the relevant code (it is the same on Debian … Read more
Yes. Just run: sudo update_dyld_shared_cache
try using \r instead of \n when printing the new “version”. for(int i=0;i<=100;++i) printf(“\r[%3d%%]”,i); printf(“\n”);
I presume that it is MYSQL. To run it from Unix / Linux environment you must do this: $ mysql -h “server-name” -u “your_username” -p “your_password” “database-name” < “filename.sql” There is another way: mysql –host=localhost –user=your_username –password=your_password -e “filename.sql”
>>> import subprocess >>> cmd = [ ‘echo’, ‘arg1’, ‘arg2’ ] >>> output = subprocess.Popen( cmd, stdout=subprocess.PIPE ).communicate()[0] >>> print output arg1 arg2 There is a bug in using of the subprocess.PIPE. For the huge output use this: import subprocess import tempfile with tempfile.TemporaryFile() as tempf: proc = subprocess.Popen([‘echo’, ‘a’, ‘b’], stdout=tempf) proc.wait() tempf.seek(0) print … Read more