Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Joveice

Programming on multiple machines (Code sharing issues)

So I installed VirtualBox, set it up as a copy of the production server.

Added a shared folder to it.

 

Boom easy testing.

Recommended Posts

Posted · Original PosterOP

Hello,

 

So I'm coding on my Linux server from my Windows computer to share the code I did use filezilla before and just move it over when I wanted to test out 2 line changes I did. And I'm doing maby 200 of them a day because I'm still learning to code the language.

 

So I moved to bitbucket so I could easyer revert back big changes that I did that I probably shouldent have done. But it's a bit wrongly used I think as I'm commiting each 2 line changes I do (because I need to test it on the server) and since I do so many I can't really have a message on them all so most of them are empty.

 

How do others do this? I'm gonna be sticking around with the windows -> linux for quite some time so changing the OS of my computer to match it isent a option, and I don't feel like starting with a VM.

 

Thanks for any ideas, tips and how to's!


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites
2 minutes ago, Joveice said:

Hello,

 

So I'm coding on my Linux server from my Windows computer to share the code I did use filezilla before and just move it over when I wanted to test out 2 line changes I did. And I'm doing maby 200 of them a day because I'm still learning to code the language.

 

So I moved to bitbucket so I could easyer revert back big changes that I did that I probably shouldent have done. But it's a bit wrongly used I think as I'm commiting each 2 line changes I do (because I need to test it on the server) and since I do so many I can't really have a message on them all so most of them are empty.

 

How do others do this? I'm gonna be sticking around with the windows -> linux for quite some time so changing the OS of my computer to match it isent a option, and I don't feel like starting with a VM.

 

Thanks for any ideas, tips and how to's!

You could get a nas? Create a folder on your Windows machine and share it over the network and connect to it using SMB on your Linux machine? 

Link to post
Share on other sites

Quick and easy way would be to use Dropbox sync. Takes maybe 5-10 seconds at most for them to sync automatically.


[Out-of-date] Want to learn how to make your own custom Windows 10 image?

 

Desktop: AMD R9 3900X | ASUS ROG Strix X570-F | Radeon RX 5700 XT | EVGA GTX 1080 SC | 32GB Trident Z Neo 3600MHz | 1TB 970 EVO | 256GB 840 EVO | 960GB Corsair Force LE | EVGA G2 850W | Phanteks P400S

Laptop: Intel M-5Y10c | Intel HD Graphics | 8GB RAM | 250GB Micron SSD | Asus UX305FA

Server 01: Intel Xeon D 1541 | ASRock Rack D1541D4I-2L2T | 32GB Hynix ECC DDR4 | 4x8TB Western Digital HDDs | 32TB Raw 16TB Usable

Server 02: Intel i7 7700K | Gigabye Z170N Gaming5 | 16GB Trident Z 3200MHz

Link to post
Share on other sites

But why, just make a test environment on your own computer. Not to say it is really bad to just upload to your server and test there.

Test locally commit locally push to Bitbucket, then when some big features are done push it to Master.

 

How to properly use git can be found here http://nvie.com/posts/a-successful-git-branching-model/

git flow commands are already in GIT build in


Quote or mention me if not feel ignored 

Link to post
Share on other sites
Posted · Original PosterOP
11 minutes ago, Cruorzy said:

But why, just make a test environment on your own computer. Not to say it is really bad to just upload to your server and test there.

Test locally commit locally push to Bitbucket, then when some big features are done push it to Master.

 

How to properly use git can be found here http://nvie.com/posts/a-successful-git-branching-model/

git flow commands are already in GIT build in

Can't test locally as I'm on windows and the server is linux and the code is linux spesefic


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites

Why not just ssh into the server and program directly on it with vim or emacs?


My comps:

Main: rMacBook Pro mid 2014 15"

Gaming: i7-7700, GTX 1060 6GB, 16GB 3000Mhz DDR4, 512GB SATA SSD

Link to post
Share on other sites

Github?


CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to post
Share on other sites
7 hours ago, BrendanReed said:

You could get a nas? Create a folder on your Windows machine and share it over the network and connect to it using SMB on your Linux machine? 

Meh.

7 hours ago, DeadEyePsycho said:

Quick and easy way would be to use Dropbox sync. Takes maybe 5-10 seconds at most for them to sync automatically.

Not bad.
 

5 hours ago, Cruorzy said:

But why, just make a test environment on your own computer. Not to say it is really bad to just upload to your server and test there.

Test locally commit locally push to Bitbucket, then when some big features are done push it to Master.

 

How to properly use git can be found here http://nvie.com/posts/a-successful-git-branching-model/

git flow commands are already in GIT build in

Yay we did it everyone!

Git saves the day!

 

4 hours ago, edward30 said:

Why not just ssh into the server and program directly on it with vim or emacs?

Why not just scp the file over once you've made your changes?

Link to post
Share on other sites
38 minutes ago, Erik Sieghart said:

Why not just scp the file over once you've made your changes?

You could do that too, though it is an extra step. Learning a terminal editor (especially vim/vi) would be advantageous for the OP if he doesn't have experience with one so far.


My comps:

Main: rMacBook Pro mid 2014 15"

Gaming: i7-7700, GTX 1060 6GB, 16GB 3000Mhz DDR4, 512GB SATA SSD

Link to post
Share on other sites
Posted · Original PosterOP
20 hours ago, edward30 said:

Why not just ssh into the server and program directly on it with vim or emacs?

To go from a IDE to a text editor sounds like a bad idea and I'm not gonna do that ever.

 

16 hours ago, DXMember said:

Github?

I use BitBucket to keep the repo private for free.


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites

@Joveice There is no difference between Github and Bitbucket for this problem

I dont know what the script is about if it is like a self made web server or something or a script that needs to be ran manually and see the output of it like a read file script.

 

Both can be done in Docker for example, if you want to be as minimal as possible download Docker for your pc.

Open the Command line or Terminal and just start a docker container. it will be ran in the background and totally stand alone like a VMWare machine.

 

You can get into it and actually interact with it, without using SHH you can simply type "docker exec -it [containername] [shellname]" shellname is for example bash.

 

If its a script that actually runs in the background you can do even something more awesome!

You can put a Dockerfile in your Repository which includes rules how the image should be created, for example : Take as Distro Debian and run apt-get update and install MySQL.

Then you would create a file when you Copy/Move your Repo files in the docker container and set a automatic execute command.

 

So everytime you build your image your application gets pulled from Bitbucket (latest) and then just simply run it locally or on the server! :)

 

Also Dockerhub (like github but then for dockers)  makes it able to read your Repository docker file and Build your image on Dockerhub AUTOMATICLY on EVERY push on a branch which you can specify.

 

So everytime develop gets a push dockerhub will build your develop image, and when Master gets a push Dockerhub will build your Master/Release image with specific tags etc.

 

 

Docker requires a learning step but if you have fun with setting up servers and linking them really nice etc, this would be no time waste.


Quote or mention me if not feel ignored 

Link to post
Share on other sites
Posted · Original PosterOP
31 minutes ago, Cruorzy said:

@Joveice There is no difference between Github and Bitbucket for this problem

I dont know what the script is about if it is like a self made web server or something or a script that needs to be ran manually and see the output of it like a read file script.

 

Both can be done in Docker for example, if you want to be as minimal as possible download Docker for your pc.

Open the Command line or Terminal and just start a docker container. it will be ran in the background and totally stand alone like a VMWare machine.

 

You can get into it and actually interact with it, without using SHH you can simply type "docker exec -it [containername] [shellname]" shellname is for example bash.

 

If its a script that actually runs in the background you can do even something more awesome!

You can put a Dockerfile in your Repository which includes rules how the image should be created, for example : Take as Distro Debian and run apt-get update and install MySQL.

Then you would create a file when you Copy/Move your Repo files in the docker container and set a automatic execute command.

 

So everytime you build your image your application gets pulled from Bitbucket (latest) and then just simply run it locally or on the server! :)

 

Also Dockerhub (like github but then for dockers)  makes it able to read your Repository docker file and Build your image on Dockerhub AUTOMATICLY on EVERY push on a branch which you can specify.

 

So everytime develop gets a push dockerhub will build your develop image, and when Master gets a push Dockerhub will build your Master/Release image with specific tags etc.

 

 

Docker requires a learning step but if you have fun with setting up servers and linking them really nice etc, this would be no time waste.

Sadly I got myself Windows Home as I dident know there was that big of a diff on home and pro, so now 5 years later I'm starting to wonder if I should at it on a "Need list".

 

I tryed docker toolbox since you mentioned docker last time, but there are more errors than I have ever worked with and nothing worked, even the simple docker -v threw errors.


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites
38 minutes ago, Joveice said:

I tryed docker toolbox since you mentioned docker last time, but there are more errors than I have ever worked with and nothing worked, even the simple docker -v threw errors.

@Joveice Its true that the windows installation isn't fast done. I had some problems myself. And it needs Hyper-V to run their virtualization ofcourse. So maybe a Windows Pro would be nice in the feature :) (Kinguin) 

 

In this case you might actually want to run it on a server. use SCP that uses SSH tunnel to tranfer files to the server from your computer. Write a script and set it to a keybind maybe to make it easier and faster to transfer?

 

So you edit a bit and then just hit ALT+F5 for example and the SCP script runs to overwrite the files on the server.

 

Still would recommend to use GIT for version control bit it might be a bit of a pain when you can't test locally, also installing Docker on a Linux machine can be done by a Baby and i would encourage you to check it out. You might like it :)

 

https://www.digitalocean.com/ they charge per hour, and specially made for developers in mind. They even have a droplet image that already installs certain applications like Docker or LAMP Stack. And i even think if you turn your server just off. That you dont have to pay.


Quote or mention me if not feel ignored 

Link to post
Share on other sites
Posted · Original PosterOP
1 hour ago, Cruorzy said:

@Joveice Its true that the windows installation isn't fast done. I had some problems myself. And it needs Hyper-V to run their virtualization ofcourse. So maybe a Windows Pro would be nice in the feature :) (Kinguin) 

 

In this case you might actually want to run it on a server. use SCP that uses SSH tunnel to tranfer files to the server from your computer. Write a script and set it to a keybind maybe to make it easier and faster to transfer?

 

So you edit a bit and then just hit ALT+F5 for example and the SCP script runs to overwrite the files on the server.

 

Still would recommend to use GIT for version control bit it might be a bit of a pain when you can't test locally, also installing Docker on a Linux machine can be done by a Baby and i would encourage you to check it out. You might like it :)

 

https://www.digitalocean.com/ they charge per hour, and specially made for developers in mind. They even have a droplet image that already installs certain applications like Docker or LAMP Stack. And i even think if you turn your server just off. That you dont have to pay.

by digitalocean I could just install docker on the server and use that, but that does not have anything to do with making the coding easyer to test :P


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites
18 hours ago, edward30 said:

You could do that too, though it is an extra step. Learning a terminal editor (especially vim/vi) would be advantageous for the OP if he doesn't have experience with one so far.

scp username@domain:/path_to_file/myfile myfile
is not an extra step over:
vi myfile
They're the same number of steps.

Link to post
Share on other sites
1 hour ago, Erik Sieghart said:

scp username@domain:/path_to_file/myfile myfile
is not an extra step over:
vi myfile
They're the same number of steps.

I suppose you missed the part where before he uses scp he'd have to use another editor on his system. That includes a number of different steps. The transfer is an extra step over simply creating and saving the document, which he has to do anyway. Obviously.


My comps:

Main: rMacBook Pro mid 2014 15"

Gaming: i7-7700, GTX 1060 6GB, 16GB 3000Mhz DDR4, 512GB SATA SSD

Link to post
Share on other sites

Synergy is the... Never mind.


i5 6600k and GTX 1070 but I play 1600-900. 1440p BABY!

Still, don't put too much faith in my buying decisions. xD 

Link to post
Share on other sites
Posted · Original PosterOP
1 hour ago, YedZed said:

Synergy is the... Never mind.

What?


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites
13 minutes ago, Joveice said:

What?

Bad LTT sponsor spot joke


i5 6600k and GTX 1070 but I play 1600-900. 1440p BABY!

Still, don't put too much faith in my buying decisions. xD 

Link to post
Share on other sites
Posted · Original PosterOP
1 minute ago, YedZed said:

Bad LTT sponsor spot joke

Well can't use it on a linux server :P


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites
Posted · Original PosterOP · Best Answer

So I installed VirtualBox, set it up as a copy of the production server.

Added a shared folder to it.

 

Boom easy testing.


Operator @ Norsk Helsenett SF. Our mission is to deliver and develop a secure, robust and appropriate national ICT infrastructure for effective interaction between healthcare and healthcare professionals.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×