How to update Django file from local machine to Ubuntu development server(AWS EC2)? - django

I am developing an app in my local machine(windows OS) and I am using an AWS Ubuntu Server to show updated website to the client in another country. But my problem is that when i am uploading python file through FileZilla Sftp, its not make any change on the server till I reboot ubuntu server using "sudo reboot"
I am tired of doing this process again and again. I read about git version control can help me with this situation but I don't know how to do it.
Please help me I am stuck from 3 days on this.

You don't need to reboot all the time. What you should do is simply check the running service or process using "ps -ef | grep processName" and kill it(kill -9 'processId') and restart the process again.

Related

Restart Jupyter Lab server running in the background

I'm trying to restart a Jupyter Lab server (not just the kernels) running in the background of an AWS SageMaker notebook instance. I have already tried the following:
Killing the server by it's process ID
pgrep doesn't show me the process
pkill can't find the process
ps aux shows the process ID as constantly changing
Stopping the server through jupyter notebook stop
I get an SSL error and nothing happens
The only thing I've been able to do is reboot the entire instance, which isn't a great option as it can take awhile to become available again.
Edit 1:
The main reason I am trying to do this is that after installing the tqdm package and trying to use tqdm.notebook in Jupyter Lab, in order for it to display correctly I need to enable/install notebook and lab extensions. In order for these to take effect the server then needs to be restarted.
Try this:
Left hand navbar, Commands
Navigate to the Help section on the popout menu
Reset Application State
Both classic Jupyter and Jupyter lab live within the same process.
sudo initctl restart jupyter-server --no-wait is what AWS suggest in https://forums.aws.amazon.com/thread.jspa?messageID=917594&#917594
Assuming it runs on port 8888:
jupyter lab stop 8888 && jupyter lab

How to keep django app running in the background within the vagrant?

I have a Ubuntu 14.04 host headless Server.
Using root user, I vagrant up a VM that is using VirtualBox.
Inside this VM, is a Django Python 3 app.
Every time I vagrant up and vagrant ssh this VM, I need to run sudo service gunicorn start.
If I exit from the vagrant ssh, and then switch to another user, the app dies.
How do I maintain this Django app running from the VM permanently?
If the host machine has to reboot for whatever reason, how can the Django app automatically run itself?
In summary:
how to allow vagrant and the gunicorn inside the VM run for a very long time while I switch between users in the host OS?
Is there a way to automatically revive the vagrant and the gunicorn inside, whenever the host OS is rebooted?
Use:
sudo service gunicorn start &
The & sign will make your command to run on a different process then the terminal one, so you can close the terminal without closing the gunicorn.
By the way, this is not a vagrant related, it happens on all linux-like terminals.
For your second question, you need to use something like supervisor to handle this for you.

Do I have to leave the terminal open while using the Parse Server?

I have an AWS EC2 Instance running Ubuntu.
I've installed Parse Server on it and MongoDB. I noticed that whenever I close the terminal on my laptop, my android app cannot reach the server.
So my question is if I close the Java terminal window, leave the instance running on AWS, and still make usage on my Parse Server?
I solved it using the nohup command:
$ nohup parse-server --appId APP_ID --masterKey MASTER_KEY --databaseURI DATABASE_URI &

VMWare Workstation won't suspend from command line

I'm trying to automate VMWare Desktop on Windows 7 to suspend all vm's before I do a backup job each night. I used to have a script that did this but I've noticed now that it won't suspend anymore with the same command that used to work.
If I do vmrun list I get a list of the running vms with no issue.
If I do vmrun suspend "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" it just hangs and I have to kill the command with CTRL+C.
I've even tried a newer command using -T to specify it's workstation, ie vmrun -T ws suspend "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" and still no love.
If I have the vm already stopped, I can issue vmrun start "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" and it starts fine.
As well as the suspend command, the stop command also does not work. I'm running VMWare Workstation 11.1.3 build-3206955 on Windows 7.
Any ideas?
Update:
I installed latest VMWare Tools on the guest, as well as the latest Vix on the Host so everything should be up to date.
I can start a vm using vmrun with no problem using vmrun -T ws start <path to vmx> but the command doesn't come back to the command prompt, so I'm assuming it's not getting confirmation from the vm that it is now running.
If I cancel the 'start' command and now try and suspend I'm getting the same lack of communication from the guest. If I manually suspend the vm, once it's suspended I get an 'Error: vm is not running' and the 'suspend' command finally times out and comes back.
So, it looks to me like there is no communication from vmrun to the guest about what state it's in etc. Is there a way to debug the communication from the host to the guest using vmrun or other means? Are there ports I need open in the guest OS?
So, I never did get vmrun to work properly on my main system, although I did get it behave ok on my laptop so there is something weird happening on this machine. I also installed a trial of the latest VMWare 12 and the same thing happens.
As a workaround, I ended up changing the power management settings in my guest OS so that it would 'sleep' after 1 hr of inactivity. When this happens VMWare detects it and automatically suspends the guest which is really what I'm looking for. Not the most slick solution but it does manage to unlock the files I need to be backed up in a nightly backup.

SVN repo What is difference between http://server/ ... / and svn://server/ .. /

I'm new in Linux world and recently start messing around with ubuntu server. For week or so I was able to understand the basics and now I'm shooting for more difficult tasks like setting up web server, ssh and SVN.
The question is: how to set url to be visible like svn://......../....
I found this and the book http://svnbook.red-bean.com/en/1.7/svn.serverconfig.svnserve.html perhaps i'm not doing something right:
svnserve as daemon
The easiest option is to run svnserve as a standalone “daemon” process. Use the -d option for this:
$ svnserve -d
$
# svnserve is now running, listening on port 3690
When tape this line and restart the service apache2 nothing changes. And I'm not sure is this the way to make it.
When tape this line and restart the service apache2 nothing changes
Apache in any way does not related to handling svn:// protocol
Quote from referenced by you page of SVN Book
Once we successfully start svnserve as explained previously, it makes
every repository on your system available to the network. A client
needs to specify an absolute path in the repository URL. For example,
if a repository is located at /var/svn/project1, a client would reach
it via svn://host.example.com/var/svn/project1.
(Bolded parts is important)