Is it possible to write code for gnome and then build it to windows? - mysql

I want to write a database program and have it built for a windows machine at work. Is that possible to do without much grinding? (so to speak)

Yes, that should be possible. There's a project to bring GTK+ to windows.
You may need this installer if you happen to run a GTK+-based
application and need GTK+ runtime environment to run it. Note that
this installer does not include any development libraries or headers.
If you want to develop/compile GTK+ applications for Win32, download
the dev packages from Tor Lillqvist's pages (see the Links section).
Note, however, that user experience usually deteriorates, the more cross-platform you are.

Use a cross-platform language like:
Python
Java
.Net (Mono)
Or, if you prefer C++, use the Boost libraries: http://www.boost.org/
From the website:
Boost works on almost any modern operating system, including UNIX and
Windows variants. Follow the Getting Started Guide to download and
install Boost. Popular Linux and Unix distributions such as Fedora,
Debian, and NetBSD include pre-built Boost packages. Boost may also
already be available on your organization's internal web server.

Additionally to SimpleCoder's remarks: If it is a program with an UI, make sure that you use an UI toolkit that also is cross-platform or design it in a way that you can use different UI toolkits with the same business layer (a good pattern would be the MVC Pattern).

Related

Portable MongoDB and MySQL/PostgreSQL binaries

I'm currently developing a Python application and I would like to know if there are any ways to pack MongoDB and MySQL (or Postgresql) into the application. By packing I mean taking those application binaries and distribute them with the application files.
For example, Metasploit PRO has some applications like nginx, postgresql, java, ruby, etc... under /opt/metasploit (they come with the application setup), and I would like to know if that could be done with any Linux application. And if so, how could I "choose" what binaries are needed? Would they work for any Debian distro? Can any application follow that procedure? Could it be done with MySQL and MongoDB?
P.D: I would like to do this to distribute one unique application instead of having to "obligate" the user to setup the databases independently, and for pure curiosity.
Thank you very much in advance!
MongoDB already distributes its binaries as standalone binaries in the sense that everything needed for the database (or shell tools) to run is included in the respective binary (mongo/mongos/mongod).
However, these binaries are OS (Linux distribution)-specific. Meaning, for example, they dynamically link against libssl and libcurl and you need to have the right versions of those libraries on the host system. So, for example, a MongoDB binary for Ubuntu 14.04 is likely to not work on Ubuntu 16.04.
As far as I know MongoDB does not support building for "generic linux". Only specific OSes like Ubuntu 16.04 are supported.
With that said, you could possibly build a "portable" MongoDB yourself if you accept some limitations, since its source code is available:
You need to figure out how to build MongoDB on some linux distribution that gives you the baseline glibc that would be compatible with all of your targets.
You may have to forego functionality like TLS connections, or figure out how to link against openssl statically (probably non-trivial).
This would be easier with older MongoDB versions (4.0, 3.6) since they have fewer system dependencies.
I think you can pack the required services and your application as Docker image or Virtual Machine box.
As my experience, I used to package the MongoDB and other Linux CLI tools with my NodeJS web application into a VM box using Vagrant. Or you can use Docker if you prefer container-based application.
If you use Vagrant, the provisioning feature may help you to setup the database before running the application. Check https://www.vagrantup.com/docs/provisioning

Running another MSI through visual studio installer

I want to install MySQL installer msi with my setup.(MySQL installer has to install silently. I am using batch file in custom action to do this.)
However, the problem is that MySQL's msi cannot be run from within main setup.msi it gives out 1618 error(Another installation needs to be completed.) I would like to know an easy way around this.
Background info: MySQL installer unpacks the manifest which contains MySQLInstallerConsole.exe it is then called through another cmd command to install MySQL.
So all I am looking to do is to execute MySQL installer so that it unpacks the manifest. Later I would call the MySQLInstallerConsole.exe to install MySQL through custom action.
Just to mention even more possibilities- some my colleagues mentioned (VS bootstrapper, burn):
Just start writing a batch or script for calling the two MSIs after each other.
Always a good starting point maybe, if you have no experience with MSI.
Write your own mini setup.exe bootstrapper with 5 lines of code to do the above.
(To be more concrete in "Third party tools":) Buy InstallShield or Advanced Installer or InstallAware, this are the tools with ready GUIs to do such easy bootstrapping.
I would recommend the second out of them. Starting another MSI are only two clicks. Similar with the other. But there are BIG differences between the three, especially InstallAware is special.
! Mentioned "mini bootstrappers" of those tools are not as powerful as Burn or the others followed:
Buy the ready setup suite SetupFactory which can be used as a bootstrapper for MSIs.
Use the InstallShield "Suite" project type, if you buy the Premium Edition of InstallShield. Costs big bucks, but has a friendly user interface. I was successful using it before some years, but I had to work around a handful of bugs as always with IS (but I guess you will discover bugs with most tools. Way it is.)
There (again) Burn would come in handy, you could fix potential bugs or behaviours on your own here ...
Only it could take you more time in the beginning.
... Of course there may be more.
There isn't an easy work around. Windows Installer enforces a 1 installation at a time rule through the use of a mutex. You need to create a bootstrapper / chainer to serialize the installation of your packages. Visual Studio Deployment Projects don't support this. I'd suggest looking at Windows Installer XML (WiX) and it's Burn boostrapper / chainer engine.
The documentation is a bit sparse, but in the Visual Studio world the customized bootstrap is the Bootstrap Manifest Generator. The docs start here:
https://msdn.microsoft.com/en-us/library/ms165429.aspx
and there is an old article here:
https://msdn.microsoft.com/en-us/magazine/cc163899.aspx
but it's not clear how much info and support is available since setup projects were removed from setup projects and then restored.

Open Source Application Server Solution

A project with the following technologies and components has surfaced: to up a Web stack solution initially composed with Ubuntu, JDK, JBoss, Spring MVC 3.0+, and MySQL.
In planning this project, I have been struggling to find answers to the following questions for first steps, best practices, and sequence:
1) Does the JDK (and JBoss) need to be installed as ‘root’? (I have seen articles that mention it is not a good idea to operate in root unless absolutely necessary due to the fatal consequences.)
2) Does Ubuntu need to be installed as a Server in order to accomplish all this, or can it also be installed as a Desktop? I have not been able to determine if having a JBoss and MySQL need to be installed on top of Linux as a server.
3) Does Maven need to be used within Spring STS in order to get JBoss, and MySQL (and in the future Hibernate) to work successfully together?
4) My intent is to install in this order: a) Ubuntu -> b) Java -> c) JBoss -> d) Spring STS -> and e) MySQL. Are there any blatant conflicts in this sequence?
JBoss will require Java (recommend Java 7) before it will do anything. I don't think it really "installs" per-say, but rather just unpacks to some directory (even if you install from the package manager, it just really extracts itself). I question your need for Spring since JBoss and Java EE in general really does everything Spring does, and better now-a-days. Unless you have a specific requirement for Spring, I'd question this extra dependency.
For linux - in a high level, any OS can be a "server", all it needs is to be capable of serving things (web pages, ssh connections, etc). In M$ world, different "levels" of the OS have been specially designed based on anticipated task/workload. So for example, while Windows 7 can indeed run as a server, it was not designed for it and therefore may not be optimized or include helper utilities and tools to make life easier as a sys admin of the system. Windows Server on the other hand does include all the "normal" server tools and lots of goodies to make maintaining and setting the server up easier.
In linux land, this is no such thing. Linux is the kernel that talks back and forth with the bare metal, etc... and Distro makers will take that and build an OS around the kernel, basically just attaching any packages they feel their distro needs... such as wget, or cat, or any other standard userland apps, plus some non-standard such as mysql or java or whatever they want.
Now, some distributions of linux will tailor themselves at being "server" ready, while others will tailor themselves at being a desktop OS. The difference? It's really just whatever default packages the distribution maker decides to include or not. For example, the overwhelming majority of linux servers are run completely headless, and therefore there is absolutely no reason to have X11 and a huge bloated GUI environment installed and/or running on that system... it's pointless. Also, an "average joe" user does not need MySQL installed by default on his desktop system since it would only bloat his system and he likely won't ever use it.
So basically it comes down to default installed packages.
Some linux server distros take this further and exercise extreme caution when making updates, patches, or new releases in the name of stability and security, while on the other hand most desktop distros are more haphazard with their updates since if it breaks a home users web browser, it's probably not a huge deal... but if a server update breaks the webserver application stack, now that's a serious problem.
So you'll find server OS's like CentOS (based on upstream RHEL) are extremely slow to bring in the "latest and greatest" features that desktop OS's get early on. Their goal is high security and long term stability.
Now, for Ubuntu. While I certainty know a lot of folks run Ubuntu as their server OS choice (partly due to Amazon choosing Ubuntu as the default linux VM for their ECS cloud), but I'd really question this. Ubuntu is not focused on being a server. It's focused on being a great all-around desktop oriented OS. Yes the LTS version is meant for long term stability, but it's based out of a desktop OS, so it's still not the focus.
IMHO, I'd go with CentOS because it's free and completely binary compatible version of RHEL - and RHEL is the de-facto standard for enterprise-grade linux servers. Be aware though, the RHEL way of doing things is a bit different than the debian way -- so there is no apt-get, you must use yum install instead. Startup scripts are different and some ways of doing things are different, but really, once you know linux, you know linux.
EDIT: Also check into Jenkins - its a free opensource continuous integration system that runs on JBoss or Tomcat or any other container, and can automagically pull your code from a repo (github, git, svn, etc) and compile/package it then push it to live deployment. You setup your ANT or Maven build scripts, and it can kick off on a schedule or however you configure it.
EDIT EDIT: I'd also recommend using OpenJDK -- as it's likely included in your package manager (for just about every disto) and will be more updated than the oracle version if it's in your package manager too. I've found most "server" distros will have OpenJDK 7 while only having Oracle java 6 in their package managers. Also, installing it via the package manager will enable you to keep it updated a ton easier.
Installed as root, why not? Run as root, probably not a good idea.
If you want a desktop, install a desktop distrib. If you want a server, install a server distrib. This doesn't change what can and can't be run in the OS. It only changes what is installed by default.
Maven is a build tool. JBoss doesn't care how you build your app. All it cares about is if the application you deploy is a valid Java EE application.
No. You need an OS, so Ubuntu must come first. JBoss and (AFAIK) Spring STS need a JRE to run, as they're Java applications, so Java should be installed before them. MySQL is independent of JBoss, STS and Java, so you can install it whenever you want.
Note that if you're struggling just with this installation part, be prepared to suffer with the rest. Building a Java EE webapp is not a piece of cake, and you should probably find some experienced developer to help you, as it seems you're only beginning with Java.

Can we develop kde applications using a machine that runs gnome?

Although I am still new at Linux and the destop environemnts, I want to know if I can develop KDE based applications from a system using GNOME as its desktop environment.
Yes. You just have to make sure you have the KDE libraries and development headers installed. (Should be a package named something like kdelibs-devel in your package manager.) You may find it difficult to test your application properly, though, for obvious reasons.

Automatic tool detection with Jenkins/Hudson?

What mechanisms exists in Jenkins/Hudson to automatically detect tools that are installed on the Nodes?
For example, .NET frameworks, Visual Studio versions, Setup-Builder Tools, installed scripting language executables, etc.
I'm currently trying to figure out if and how (and whether it makes sense) Jenkins can auto-detect our tools that I have to install on all the Nodes (Salves).
Since our Nodes are Windows machines, hard-coding paths doesn't make sense (IMHO) due to path mismatch Windows 64bit vs. 32bit / XP vs. Windows 7 / different language versions.
Also, quite a few tools require installation, so just mirroring over files isn't an option either.
Obviously, I could just define a set of environment variables for our tools and use these from Jenkins. But I much rather use/build something that makes new Nodes/Slaves auto-configured.
You can also read this question as: Is it possible to write a plugin that automatically detects "stuff" on Windows slaves and makes that available as Node Properties? (and where would I start if I wanted to do that?)
AFAIK, the only tools that Jenkins can natively autoconfigure are Java JDK, Ant, and Maven. I'm not sure what other plugins can do.
You might have to go the environment variables way, or you could create a multi-configuration job that installs your tools onto the slaves, if they don't already exist. This would assume that your tools can do quiet installs, and that you can specify the installation directory (same across all platforms).
I've gone with the route of having a set of common environment variables for all nodes.
Since I have to manage what is installed on the Windows nodes manually anyway -- many tools have installers I need to run prior to using them -- adjusting the environment variables on each node isn't such a big deal. (I have a small batch script that set's up everything via setx.)