Write failed : broken pipe

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

Mac Os X Terminal: How to view a domain’s zone file?

→ 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 … Read more

How to run a specific Android app using Terminal? [duplicate]

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

Run sql file in database from terminal

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”

How can I get terminal output in python? [duplicate]

>>> 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