terminal

How to install Visual Studio for Mac from Terminal (Mac OS)

拜拜、爱过 提交于 2019-12-24 21:23:14
问题 I would like to install Visual Studio for Mac on ssh. Therefore, I have to use Terminal for the installation. I download the .dmg file and copy it from local computer to ssh. Then, I follow this link, but it doesn't work. I still can't use 'mcs' command to compile C# code. Can anyone tell me how to install Visual Studio for Mac via Terminal? 来源: https://stackoverflow.com/questions/49727677/how-to-install-visual-studio-for-mac-from-terminal-mac-os

issue appending files python

不羁的心 提交于 2019-12-24 20:24:36
问题 I am currently working on an open source project with the goal of producing a tetris game that can run in the terminal. I'm currently stuck on the third test. I have written code that passes the first test. and the second test. and passes the eye test for test 3. But test 3 requires taking the output from test 2 and inserting at the start of test 3. I figured I would do this by appending it '>>'. that's where the problem comes in. The first test is to save a file called learntris.py to the

export default routes; SyntaxError in NodeJS

烈酒焚心 提交于 2019-12-24 19:44:23
问题 const routes = (app) => { app.route('/contact') .get((req, res, next) => { // middleware console.log(`Request from: ${req.originalUrl}`) console.log(`Request type: ${req.method}`) next(); }, (req, res, next) => { res.send('GET request successful!!!!'); }) .post((req, res) => res.send('POST request successful!!!!')); app.route('/contact/:contactId') .put((req, res) => res.send('PUT request successful!!!!')) .delete((req, res) => res.send('DELETE request successful!!!!')); } export default

How to pull the output of the most recent terminal command?

岁酱吖の 提交于 2019-12-24 19:44:04
问题 I'm building a CLI that, when run, requires the output of the most recently executed bash command. Is it possible to pull this output without recomputing the command? For example, let's say I run python main.py and receive this error: File "main.py", line 41 messages_list.insert(0, { "author" : "dummy_author0", "message" : " " } ) ^ IndentationError: unindent does not match any outer indentation level I'd like to then run a command that automatically pulls this error message and does

Telnet to a cloud instance from outside

老子叫甜甜 提交于 2019-12-24 16:35:15
问题 I have a cloud MS window instance on EC2. I want to telnet this instance from my own machine (outside). What I did: 1- turned off the MS firewall 2- turned on the telnet client and telnet service in the instance.. Now from my machine, if the public ip address for the cloud instance is 80.8.8.9. then, on the the cmd terminal from outside. I wrote telnet 80.8.8.9 where It said that the connection is failed. What I am missing, what is the wrong thing I did.. 回答1: Make sure you go to AWS

Displaying UTF8 stings in Ubuntu's terminal with a Python script

亡梦爱人 提交于 2019-12-24 16:20:06
问题 In my Python script running at the command line on Ubuntu, it's selecting UTF8-encoded content from a MySQL database. Then, I want to print the string to the console. The displayed strings have an encoding problem, as they don't show the accented characters correctly. How do I fix this? Preferably, the script would make the decision, rather than setting a system environment, to ensure easy running on other systems. 回答1: It is very strongly recommended that you not use "?" as a replacement

Running multiple python files in different terminals/consoles from one python file

故事扮演 提交于 2019-12-24 15:32:55
问题 I have 5 python files which i need to run on different terminals/consoles. Currently what i'm doing is running each file on its own terminal/console python filename.py . What i would like is to run one file that will run all the other files in different terminals/consoles. I haven't tried anything yet. I'm looking for someone to point me in the right direction on what to do. 回答1: You could use the screen command, if it is not actually necessary that five different terminals pop up. Write a

Make osascript print stdout interactively / in real-time

荒凉一梦 提交于 2019-12-24 14:13:45
问题 Ok, so I have this very simple python script: import time import sys for i in range(25): time.sleep(1) print(i) sys.exit() When I use python to run it ( /usr/local/bin/python3.6 testscript.py ), all works fine and the output reads: 1 2 3 4 etc.. With each number printed 1 second after the other. However when I run: /usr/bin/osascript -e 'do shell script "/usr/local/bin/python3.6 testscript.py" with prompt "Sart Testing " with administrator privileges' There isn't any output for 25 seconds and

Beanstalkd / Pheanstalk security issue

馋奶兔 提交于 2019-12-24 14:02:03
问题 I have just started using beanstalkd and pheanstalk and I am curious whether the following situation is a security issue (and if not, why not?): When designing a queue that will contain jobs for an eventual worker script to pick up and preform SQL database queries, I asked a friend what I could do to prevent an online user from going into port 11300 of my server, and inserting a job into the queue himself and hence causing the job to be executed with malicious code. I was told that I could

artisan - SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1'

馋奶兔 提交于 2019-12-24 13:46:24
问题 I ran the command: "php artisan migrate" and got the error message displayed below: [PDOException] SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) What's the problem and how do I fix it? 回答1: there could be following possibilities - you haven't set the right credentials for mysql access in your .env file which is located at the root of your application. Solution - Open .env file in your preferred editor and check if all the mysql access credentials are correct. its