I do have a flask application running on port 8000 because i have logstash running on port 5000.
app.run(debug=True, host='0.0.0.0', port=8000)
i can run my app successfully. but when i use VScode debugger it throws
OSError: [Errno 98] Address already in use
because the debugger tries to run my app on port 5000.
i tried editing .vscode/launch.json and set "port": 8000 inside configurations but the error still the same. how can i tell the VScode to run my app with debugger on another port?
Add args key to your debug configuration and set the port there:
https://code.visualstudio.com/docs/python/debugging#_set-configuration-options
{
"name": "Python: startup.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/startup.py",
"args" : ["run", "--port", "8000"]
}
Related
I'm aware that when I set up my server with python manage.py runserver [my custom IP address] I can choose what IP and port will be chosen. But when I use VScode in debug mode I don't know where I can define the server other than 127.0.0.0.1:8000. Having 127.0.0.0.1:8000 I can access the page just by my pc (win 10).
I need to change the address, because I'm unable to open my page on my android phone (for testing with this debugger), but I don't know where and how.
I suspect that it can be somehow defined in launch.json, but I haven't found any information about that yet.
You can do that by giving the IP as args to launch.json.
#launch.json
{
"version": "1.0.0",
"configurations": [
{
"name": "Python: Current file",
"type": "python",
"request": "launch",
"program": "${file}",
"args": ["runserver", "192.168.1.0:8000"], //or whatever IP you want to use
"console": "integratedTerminal"
}
]
}
I'm trying to use native debug (https://marketplace.visualstudio.com/items?itemName=webfreak.debug) extention in vscode to launch gdb on a remote server through ssh.
It's working when I'm connecting directly to remote sever :
{
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "launch",
"name": "Launch Program (SSH)",
"target": "./appli",
"cwd": "${workspaceFolderBasename}",
"arguments": "",
"ssh": {
"host": "xxx.xx.xxx.xxx",
"cwd": "/home/username/project",
"keyfile": "/home/username/.ssh/id_rsa",
"user": "username"
},
"valuesFormatting": "parseText"
}
]
}
Is there any way to launch gdb on remote server through proxy ?
Let https://www.npmjs.com/package/ssh2 command for example use my .ssh/config file
I want to launch gdb on remote server yyy.yy.yyy.yyy through a proxy xxx.xx.xxx.xxx
It's working ! I changed the code of the webfreak.debug to handle ssh proxyCommand, using ssh2-promise : https://www.npmjs.com/package/ssh2-promise instead of ssh2
I am trying to follow the tutorial on read the docs for Django Channels. In the settings.py file I am trying to change the inmemory BACKEND to the redis backend with the following code:
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": [("localhost", 6379)],
},
"ROUTING": "chan.routing.channel_routing",
},
}
However, the moment I do this, the console which is running the runserver command shows the following error:
ConnectionError: Error 61 connecting to localhost:6379. Connection refused.
How can I fix this?
Please make sure if redis is installed on your system and it is running.
To check if redis is running use
redis-cli
then it will take you to redis console, then if you type ping it will return PONG if redis is running or not.
If you don't have redis in your system, please visit Redis Quick Start.
For Mac OS X: Go to terminal and type brew install redis.
This is worked for me:
redis-server
That's simple
I want to deploy my website using meteor-up. I want to deploy it to a EC2 instance on AWS. I have created my mup.json file and configured it as follows:
{
// Server authentication info
"servers": [
{
"host": "ec2-52-24-95-147.us-west-2.compute.amazonaws.com",
"username": "ubuntu",
//"password": "password"
// or pem file (ssh based authentication)
"pem": "C:/Users/username/meteor.pem"
}
],
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
"nodeVersion": "0.10.35",
// Install PhantomJS in the server
"setupPhantom": false,
// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "Homepage",
// Location of app (local directory)
"app": "C:/website",
// Configure environment
"env": {
"ROOT_URL": "ec2-52-24-95-147.us-west-2.compute.amazonaws.com",
"PORT": 80,
"METEOR_ENV": "production"
},
// Meteor Up checks if the app comes online just after the deployment
// before mup checks that, it will wait for no. of seconds configured below
"deployCheckWaitTime": 15
}
Unfortunately this is not working and I am getting the following error:
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT {public IP from AWS}:22
at Object.exports._errnoExcpetion (util.js:837:11)
at exports._excpetionWithHostPort (util.js:860:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
Per the https://github.com/arunoda/meteor-up, try setting the DEBUG environment variable:
Verbose Output
If you need to see the output of meteor-up (to see more precisely where it's failing or hanging, for example), run it like so:
DEBUG=* mup <command>
where is one of the mup commands such as setup, deploy, etc.
Im running a Play Framework app on AWS Beanstalk with Docker (64bit Amazon Linux 2015.03 v1.4.1 running Docker 1.6.0).
Docker File:
FROM relateiq/oracle-java8
MAINTAINER XXXX
EXPOSE 9000
ADD files /
WORKDIR /opt/docker
RUN ["chown", "-R", "daemon", "."]
RUN ["chmod", "+x", "bin/app"]
USER daemon
ENTRYPOINT ["bin/app"]
CMD []
Dockerrun.aws.json
{
"AWSEBDockerrunVersion": "1",
"Ports": [{
"ContainerPort": "9000"
}]
}
When the instance first starts I get about 1 minute where its deployed as normal, then after I browse a few pages the error shows:
502 Bad Gateway
nginx/1.6.2
The error in the ElasticBeanstalk logs is:
Play server process ID is 1 This application is already running (Or delete /opt/docker/RUNNING_PID file).
I also get in the /var/log/docker-events.logthe following messages every 30 seconds:
2015-05-30T20:07:58.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) start
2015-05-30T20:08:15.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) die
2015-05-30T20:08:16.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) start
2015-05-30T20:08:31.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) die
Can anyone see my issue? Cheers.
Adding the following to build.sbt should resolve the issue:
javaOptions in Universal ++= Seq("-Dpidfile.path=/dev/null")