Upload and Deploy Golang application to VPS - deployment

I've made a Go app and when I run the exe locally it works fine. Where would I upload this to on my VPS? public_html/domain.com/somefolder ? or /usr/somefolder with SSH?
I have my app, my .exe and src-files, but what do I do with it when I deploy online on my VPS? I haven't been able to find a tutorial about this, so I hope you can help me.
do I upload all files in my src folder including the binaries from when I've written "go build"?
upload to where on my VPS? using ssh or cpanel / ftp program or what?
What are the steps from "go build" on your own local windows 8 computer to uploading and running it online on a linux server?
Ps.
Additionally will CentOS 5.1.1 although not supported https://golang.org/doc/install - allow for me to run an already linux compiled go program on my VPS, and does it only mean that I cannot install Go and do compilation on the CentOS 5.x server? Would CentOS 5.1.1 explain the "segmentation fault" error shh gives me when running the command "./[filename]"?

Well, usually, you would:
Copy the binary you created + all resource files (html, css, images, ...)
(optionally the source code as well)
Have a way to ensure the program keeps running
crontab can be used to check if your program is alive, but a simple monitoring program would suffice as well (which you can write yourself)
Run the binary as a non-privileged user
(you can also combine it with something like Docker if you want)
It does not make sense to put it inside public_html/domain.com/somefolder, as it is not public html code. You'd want your files somewhere they cannot be accessed unless using the application/binary you created.
My apologies for not having neat source links to my story. However, this does seem like the best thing to do.
Another important note:
Even though your VPS may run Windows, you can also deploy linux binaries to a Linux VPS (which are drastically cheaper) - looking at this SO question.

A short note I wrote on writing golang app on osx and deploying on Linux server: http://kumargaurav.co/2016/08/10/deploy-go-lang-app-linux-server/

Related

Developing Flutter with VSCode and WSL2

Since I mostly develop Web, using nginx, PHP and MySQL, I have ported my WebDev-environment entirely to WSL2.
Since performance is very important, all my web-related projects reside on the WSL2-vhdx file /home/user/Projects/Web. In WSL2 I've installed all my necessary tools for a nice and neat Linux-like experience, Docker, GIT, etc.. This combined with VSCode remote integration works very well.
Now, I'm digging into building Flutter-Apps, and my Flutter-environment is installed on the Windows side. My Flutter-related projects reside on D:\Projects\Flutter which is a partition, and NOT USED in WSL2 in any way. Building Flutter-apps with flutter-windows-sdk and VSCode works neatly.
But, the problem is: Now I've my project files scattered all across my computer. Web-stuff in a WSL2-vhdx-file and Flutter-stuff on the D-partition.
Is there a way to build flutter-apps with Flutter, while having the project-files stored on a WSL2-vhdx-file, in combination with VSCode-remote and an Android-emulator?
I tried creating a test Flutter-project on the \\wsl$ network mount, which didn't work.
Moving my web-related project files to the D:\ partition of Windows is no option, since the I/O mounts in WSL2 are extremely slow.
I got it working, reliably with adb connect 192.168.xxx
For anyone interested, see my full blog post here: https://dnmc.in/2021/01/25/setting-up-flutter-natively-with-wsl2-vs-code-hot-reload/
Is there a way to build flutter-apps with Flutter, while having the project-files stored on a WSL2-vhdx-file, in combination with VSCode-remote and an Android-emulator?
I'm assuming (based on the mention of VS Code Remoting) that you want to run the extension in WSL. I haven't tried that specifically, but I have run Flutter inside WSL and also connected a VS Code Remoting session to an Android emulator in the cloud, so I would expect this to work.
You'll need to make sure you set up the Flutter SDK inside WSL (so you can run flutter commands inside WSL - it should be the Linux version of the Flutter SDK and not the Windows one if you're using the zip).
To have your emulator show up in flutter devices from inside WSL, you will likely need to run adb tcpip 5555 from the Windows side (this means you need an Android SDK in Windows) - this will tell your phone to listen on TCP port 5555. Then you'll need to run adb connect [phone ip]:5555 from inside WSL (this means you'll need an Android SDK in Linux). If all goes well, the phone should then show up in adb devices and also be picked up by the device selector in VS Code.
I tried creating a test Flutter-project on the \wsl$ network mount, which didn't work.
It's not clear what went wrong here, though my first guess would be that maybe the UNC path isn't supported - if you map a drive letter to it does it make a difference?
While this isn't an officially supported setup, feel free to raise issues in the Dart-Code repository on GitHub with any issues you have. It's not a priority, but I would like for VS Code Remoting (including WSL and Docker) to generally work for Dart and Flutter dev.
Anytime you're crossing/sharing the file-system boundary from windows to wsl you're paying a massive cost in speed/time.
With the setup you've described I'd consider trying to self-host the browser based VSCode.dev inside wsl - checkout details instructions here: https://medium.com/geekculture/3-steps-to-code-from-anywhere-45401247f479
Personally I've settled on running VSCode and docker inside a Linux VM on Windows, and have a 96% time saving in things like running up a server and watching code for changes making this setup my preferred way now.
The standardisation of devcontainer.json and being able to use github codespaces if you're away from your normal dev machine make this whole setup a pleasure to use.
see https://stackoverflow.com/a/72787362/183005 for detailed timing comparison and setup details

Is it possible to put programs on a machine through filezilla?

I know this isn't exactly a coding based thing and I am sorry for that. My friend has a server that we use to store files and run a minecraft server. I know call me lame and you are hella right I am. We use putty and msm as a console for it, but I want to switch to MCSS (https://www.mcserversoft.com/downloads).
My question is would it be possible to install this program on there through filezilla or is not possible? If it is how do I do it?
As far as I can tell, MC Server Soft is meant to be run in a Windows environment. If your server is Windows (which I doubt it is considering the other tools you mentioned), you are probably going to need to remote desktop into your server to install and setup MCSS.

OSGi headless deployment on Linux

I've developed a OSGi application on my windows machine that is just lovely. How ever I need it to run on my Linux server and this is where I run into problems.
My application has no GUI. It simple works with a console and is command line driven.
My first attempt at deployment I built a product based on my existing run target. It exported fine to a Windows .exe so I added the required delta packs for Linux. The problem with this is it has only two options Linux (GTK) and Linux (MOTIF). My linux server runs on CentOS with no GUI as it is a hosted machine so when I try and deploy it I get a segmentation fault.
I have been searching around as to what to do but I'm not coming up with any answers.
Any help would be much appreciated. I have been banging my head on this one for over a week
Cheers
The google keyword you need is 'xvfb' - it acts like an X server, but ignores everything sent to it, so you don't need any graphics hardware. Try firing that up (make sure you set DISPLAY appropriately).
A cleaner solution would be to figure out why the library is demanding an X server if it works without - perhaps you could update the question with more details.

Run a program on Mac OS host from Windows running as parallels guest

On a MacBook Pro running Windows 7 in Parallels 7, I need to run a Unix Executable File on the Mac side via a command line invocation on the Windows side. In Windows Explorer, I can use Open on Mac, but I need a way to do this via a batch file or anything else that can be expressed on a command line. I was hoping that Parallels Tools might have a command that can do this, but I can't find anything.
This seems like it should be pretty straightforward, but my searches have turned up nothing.
I also tried creating an alias on the Mac side, which I added to my Applications folder. I was hoping that it would appear in Start > All Programs > Parallels Shared Applications, which might allow me to access it with a batch file. However, I don't see it. I'm not sure what it takes to add new entries to Parallels Shared Applications. Maybe a reboot would do it, but I have not tried that yet.
Thanks for any advice.
It seems like the Platypus app might be able to help with this. It wraps a shell script into a Mac App. Unfortunately I can't get Parallels to provide access to the Platypus generated app the same way it provides access to the other Mac apps.

Deploy files on a network share from a client machine using an installation package?

We have a large application that has been developed over 15 years and in installed in 200+ client locations. The application currently consists of an Access database and a bunch of executable and report files located on a network share. A Setup.EXE file is run on each client machine (dlls are installed on the client) and then the client machines run the executables directly from the network share. During our upgrade procedure the new executable and report files are copied to the network share and that way each client gets the update immediately.
Our current installation program is very old and, among other things, it doesn't handle x64 so we are in the process of moving to a new deployment tool. At the same time we are migrating client Access databases to SQL Server. I am having difficulty finding a deployment tool to do what we require. Specifically we need the install/upgrade file to do the following:
It must be able to be run from a client machine on a network and copy the new executable and report files to the network share. That share could be a Linux box or a dumb storage device.
Accept a password before running the installation
Allow the user to select the network share as the location to copy the executables
It must NOT add anything to the client machine from where the package is run (Add/Remove Programs, registry, etc.)
Connect to a SQL Server database and run a script
The install/upgrade must be contained in a single, standalone .msi or .exe file. (no dependencies on dlls or frameworks other than those that come with Windows XP)
The file must be able to be run in one simple step. It is the end user that runs the upgrade without our support and without involvement from IT.
It looks like the closest thing to what I need is WiX but the problem there is that whenever the .msi file is run from a client, the client machine thinks that a program is being installed so it allows the client machine to uninstall the product, which is not acceptable.
If the product were written today it would certainly be architected differently but it currently is what it is and we can’t change that. Any help here would be greatly appreciated!
WiX is just a toolset built on top of Windows Installer technology. It makes many things easier and simpler as well as hides lots of Windows Installer weird features... But, it is still limited by Windows Installer, its underlying technology.
Your list of requirements made me think that Windows Installer is not the right technology to choose. I would assume that you'll spend more time on workarounds, than on functional code... But I have no experience with other installation technologies, so I'll leave those recommendations to others.