terminal

How do I create a line-break in Terminal?

浪子不回头ぞ 提交于 2019-12-20 20:31:31
问题 I'm using Python in Terminal on Mac OSX latest. When I press enter, it processes the code I've entered, and I am unable to figure out how to add an additional line of code e.g. for a basic loop. 回答1: In the python shell, if you are typing code that allows for continuation, pressing enter once should not execute the code... The python prompt looks like this: >>> If you start a for loop or type something where python expects more from you the prompt should change to an elipse. For example: >>>

svn: E175002: Unable to connect to a repository at URL

怎甘沉沦 提交于 2019-12-20 19:47:39
问题 I'm trying to svn checkout this library https://code.google.com/p/google-api-objectivec-client/source/checkout but my svn doesn't connect from a particular macbook, same internet connection but different macbook it is able to checkout successfully I get: svn: E175002: Unable to connect to a repository at URL 'http://google-api-objectivec-client.googlecode.com/svn' svn: E175002: OPTIONS of 'http://google-api-objectivec-client.googlecode.com/svn': Could not read status line: connection was

Stopping in-built php server on Mac Mavericks - Livecode

若如初见. 提交于 2019-12-20 12:42:39
问题 I'm developing something in Livecode and I have been experimenting with using Mavericks own in-built php server. I started the server by sending the following command through shell... php -S localhost:8000 This enabled PHP to run successfully through localhost:8000/ However, I can not work out how to stop/disable PHP now in order to continue testing starting it - when I previously started PHP through the terminal I was able to do ctrl+c to stop php running but since I do not yet know how to

Mac Terminal error: -bash: /Users/tim/.profile: No such file or directory

☆樱花仙子☆ 提交于 2019-12-20 11:37:10
问题 Every time I open a new Terminal window I see the following. -bash: /Users/tim/.profile: No such file or directory I have no idea why this is happening or where to look to fix it; my profile is located at /Users/tim/.bash_profile not /Users/tim/.profile Any thoughts on how to troubleshoot this? 回答1: This happened to me as well and I noticed that at the top of my .bash_profile it had: source ~/.profile My understanding is that on MacOS / OS X .bash_profile is given priority over .profile so

Mac Terminal error: -bash: /Users/tim/.profile: No such file or directory

混江龙づ霸主 提交于 2019-12-20 11:37:10
问题 Every time I open a new Terminal window I see the following. -bash: /Users/tim/.profile: No such file or directory I have no idea why this is happening or where to look to fix it; my profile is located at /Users/tim/.bash_profile not /Users/tim/.profile Any thoughts on how to troubleshoot this? 回答1: This happened to me as well and I noticed that at the top of my .bash_profile it had: source ~/.profile My understanding is that on MacOS / OS X .bash_profile is given priority over .profile so

Read first x lines of csv file into new outfile?

风格不统一 提交于 2019-12-20 11:03:53
问题 How would one copy only the first x lines of a csv file into a new csv file via the terminal? 回答1: Brief (You'll use a linux terminal/console) Use head -n NUMBEROFLINES file.csv to get the first NUMBEROFLINES of lines. Write it into another file using shell redirection ( > ) like this: head -n NUMBEROFLINES file.csv > mynewfile.csv Note that this will totally recreate mynewfile.csv , if it had any content before it is now deleted forever (-ish). If you ever happen to want the opposite ( last

JavaScript (or JS+PHP) Terminal Client

隐身守侯 提交于 2019-12-20 10:55:17
问题 Does anyone know of a JS-based terminal client? Either something that initiates an SSH connection with a remote host or even something that simply communicates with a remote PHP script to execute commands and retrieve output. Does such a thing exist? 回答1: Check Anyterm, it uses a XmlHttpRequest channel to communicate with a daemon that uses a pseudo-terminal to communicate with a shell or other application. 回答2: http://www.masswerk.at/termlib/ looks interesting as a base. 回答3: http:/

Clearing the terminal screen?

拥有回忆 提交于 2019-12-20 10:32:41
问题 I'm reading data from 9 different sensors for my robot and I need to display them all steadily, in the same window so I can compare the values and see if any of the readings is off. The problem I'm having with both Serial.print and lcd.print is that the values are constantly moving and I can't really have a good look at them while moving the robot. I was thinking to call something like Serial.clear() before displaying anything else and that would just keep things steady and in one place,

Extending terminal colors to the end of line

梦想的初衷 提交于 2019-12-20 10:32:16
问题 I have a bash script which generates a motd. The problem is depending on some terminal settings which I am not sure about the color will extend to the end of the line. Othertimes it doesn't: e.g. v.s. IIRC one is just the normal gnome-terminal and the other is my tmux term. So my question is how can I get this to extend to 80 character (or really to the terminal width). Of course I can pad to 80 chars but that really doesn't solve the problem. Here is a snip of my code which generates the

How do you change the MIME type of a file from the terminal?

我只是一个虾纸丫 提交于 2019-12-20 10:25:47
问题 What I'm looking for is a counterpart to file -I (Darwin; -i on Linux). For example, given: $ file -I filename.pdf filename.pdf: application/octet-stream; charset=binary I would like to be able to do something like this: $ [someCommand] filename.pdf application/pdf The result would be that filename.pdf would then be typed as application/pdf. The reason for the question is that sometimes web servers use the wrong MIME type, which results in programs refusing to open the file. (Most often text