terminal

GitHub ERROR: Repository not found. fatal: The remote end hung up unexpectedly

荒凉一梦 提交于 2019-12-11 11:40:56
问题 I'm trying to follow along Michael Hartl's Ruby on Rails tutorial http://ruby.railstutorial.org/chapters/beginning#fnref:1.16, but I've run across an error. I signed up on GitHub and issued a new SSH key and made a new repository. But when I try to push my repository up to GitHub I get the following error: ERROR: Repository not found. fatal: The remote end hung up unexpectedly Any ideas? Here are some of the commands I entered into the terminal: Parkers-MacBook-Pro:.ssh ppreyer$ git remote

Adding a permanent number line to VIM OSX Terminal

无人久伴 提交于 2019-12-11 11:40:03
问题 I have come across a command for vim in osx terminal that allows you to view each line in a predetermined .c document, which is :set number . I want to set this parameter to be on default each time a document is created or opened. After doing a search I came across this: you can append :set number to vi ~/.vimrc First, what is this file? How do you access it, and how do I append such a command to it? I've tried searching the vim docs for .vimrc , but it doesn't make much sense as it talks

Stanford-NLP: Could not find main class error

早过忘川 提交于 2019-12-11 11:37:11
问题 This question seems to have been answered a few times (What does "Could not find or load main class" mean? and https://stackoverflow.com/a/16208709/2771315) but for some reason none of the shared methods are working. What I've done so far. 1) Navigated to the directory containing the CoreNLP source files in terminal: ~/Downloads/CoreNLP-master/src 2) Selected one of the packages as a test case e.g. executed the command java -cp "*" -mx5g edu.stanford.nlp.sentiment.SentimentPipeline -file foo

Xcode Swift Command Line Tool reads 1 char from keyboard without echo or need to press return [closed]

爱⌒轻易说出口 提交于 2019-12-11 11:03:38
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I need a function, like the old "getch()", in Objective C or Swift to read one single character from the keyboard without echo and without the nedd to press return after the character has been typed to make the function continue. This is, I know, only interesting when programming

Problems with Zsh on macOS after update

本小妞迷上赌 提交于 2019-12-11 11:02:10
问题 After upgrading to macOS 10.15 I have some serious problems with the console. I got strong problems with rbenv and ruby. Any new window or tab from the console gives me the following information: user@macbook-name ~ % rbenv -v rbenv 1.0.0-33-gc7dcaf1 user@macbook-name ~ % which ruby /usr/bin/ruby I tried reinstalling rbenv. I reinstalled ruby through rbenv. I wrote this line in ~/.zshrc file: export PATH="$HOME/.rbenv/bin:$PATH" But as soon as I close the tab or exit the console window or the

Unix $RANDOM function not random in Bash terminal

て烟熏妆下的殇ゞ 提交于 2019-12-11 11:00:52
问题 I'm trying to generate a random number in between a specified range by using the $RANDOM function in the bash terminal. The problem is that the numbers it is generating don't appear to be random at all. The script I am using is: RANDOM=$$; a=$RANDOM b=9; #Number of scripts in collection -1 c=`expr $a % $b `; #Random number between 0 and b if (( c==0 )); then echo "script 1 (random = $a, mod = $c)"; elif (( c==1 )); then echo "stript 2 (random = $a, mod = $c)"; ... else echo "error (random =

Cannot start Electron application - missing package.json

蓝咒 提交于 2019-12-11 10:47:49
问题 I'm currently doing a Python project where I want to display my results in an Electron application. I have seen a demo video on YouTube on how to set up Electron on a Mac. The video showed 3 simple steps to be executed in the terminal: git clone https://github.com/electron/electron-quick-start cd electron-quick-start npm install && npm start When I first ran the above commands it worked fine for me. I was able to start the Electron application. But when I tried to re-start the application

Create file in Bash Terminal from Swift

删除回忆录丶 提交于 2019-12-11 10:43:41
问题 I'm trying to use Swift to run a command in the (macOS) terminal. Specifically, to create an empty file. Here's what I have for running in a shell: import Foundation func shell(_ args: String...) ->Int32{ let task = Process() task.launchPath = "/bin/bash" task.arguments = args task.launch() task.waitUntilExit() return task.terminationStatus } Note that I have tried /usr/bin/env/ for the launch path with no good result. When I call shell("touch /path/to/new/file.txt") it returns an error like:

Passing an alias as a function parameter

只谈情不闲聊 提交于 2019-12-11 09:03:15
问题 Newcomer to bash scripting here. Been outfitting my bash_profile with some useful functions to query some mysql databases, but am having trouble getting bash to recognize a passed parameter as an alias. See below for details: function findfield() { $2 -e "SELECT TABLE_NAME,TABLE_SCHEMA,COLUMN_NAME AS 'Matched Field' FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE '$1';" } example usage: findfield %field% mpc Where mpc is an alias that points to the database to query. This usage returns

Open a local html file with url params through applescript

时光怂恿深爱的人放手 提交于 2019-12-11 08:47:47
问题 I need some help with a very simple applescript. I need it to open a local URL on mac with a url parameter. set str to "open -a 'Firefox' file:///Users/bob/Desktop/someFolder/index.html?val=28" do shell script str I can't find a way to get the webpage to open with the parameters, it always just opens the .html. Can someone help? Thanks 回答1: You may want to use Safari, which is scriptable: tell application "Safari" make new document with properties {URL:"http://stackoverflow.com/questions