Jump to content

Programming on multiple machines (Code sharing issues)

Joveice
Go to solution Solved by Joveice,

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

Added a shared folder to it.

 

Boom easy testing.

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!

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Try Vagrant or Docker to setup a virtual test image. Testing on the server it self is just a no go.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

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

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

@Joveice Thats why I included SCP to try out.

Or easly go make some SAMBA share thing.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

1 hour ago, YedZed said:

Synergy is the... Never mind.

What?

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

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 comment
Share on other sites

Link to post
Share on other sites

1 minute ago, YedZed said:

Bad LTT sponsor spot joke

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

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

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

Added a shared folder to it.

 

Boom easy testing.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

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

×