cloud sql proxy as a service on windows 7 - google-cloud-platform

Run "cloud_sql_proxy" as a service in "windows 7" operating system
I have the binary "cloud_sql_proxy" with which I can access the instance of the mysql server in the Google cloud platform, up there all right.
but I need to ensure that the executable provided by Google, is always running and so my application / client program does not lose the link to these services.
Any idea how I can do this?

Based on what I understand from your question, it seems you are attempting to ask “ How can I run cloud_sql_proxy_xXX.exe when I startup Windows 7 ?”. I can tell you that the proxy does not run as a service so you will have to execute it every time you boot up your machine. Luckily, running programs on startup for Windows 7 is relatively easier than later versions of Windows such as 8.X and above.
For Windows 7, You can follow the guided steps provided here. Essentially, you just have to put the .exe file you wish to run in your Startup folder under the Start menu. (I.e: Open Start menu > All Programs > Startup > Drag file in here)
This should execute ”cloud_sql_proxy_xXX.exe” every-time you boot your Windows 7 local machine.

The documentation for GCP says literally:
"For the Windows operating system, run the proxy as a Windows Service. In general, the proxy should have the same uptime requirements as your application process."
so your answer is not acceptable.

Related

Automate an RDP connection right after Windows instance turns on in GCP

I am performing some UI Automation on GCP using a Windows Server.
The process is as follows:
=> Machine Switches on at a defined time
=> RDP Connection to Machine
=> UI Interaction Script Runs on Startup
=> Process Ends
=> Machine Switches off at a defined time
All the components have been fulfilled except for automating the RDP connection in some way or other. I referred to this link but didn't find much insights or documentations.
Does anyone know a way to Automate an RDP connection right after instance turns on in GCP?
There is a windows application called IAP Desktop, using that you can manage multiple remote Desktop connection to Windows VM. While connecting to the VM you can save the credentials which will allow you to access the Windows VM using RDP just after boot on.
Also to automate the Windows password generation here is the documentation related to 1, inside of that document there are both options available automate or manually.
How are you deploying your startup script?
During the boot sequence, a script will either run before, after or during the boot process. By declaring Windows-specific metadata keys, you can run startup scripts after the instance turns on.
If that doesn't work, there is a paid Cloud Automation service that sounds like it will meet your requirements.
Tried using startup-scripts but no luck IAP Desktop didn't work due to scheduling as well. Finally Managed to solve it via using Windows 10 Auto login settings. This skips login screen and the best part was that out of all the users, it allows you to login via user of your choice. After I Login to the system, I added a startup a bat file by running shell:startup and it worked great.

ERROR: x86 emulation currently requires hardware acceleration!` in android studio on google cloud virtual machine

Currently new to google cloud
and working on vm.
Can anyone help me how can i use android emulator on vm.
it shows me
Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!
now how can i enable hardware acceleration on vm??
First of all you can not access BIOS on Google Compute Engine VM. When you restart the instance you will be automatically disconnected from the SSH session. As soon as you open another SSH session again you will be already logged in to the os.
Android Studio Emulator is another Virtual Machine that emulates the operation of an Android device. So what you are looking for is VM nested inside a Google Compute Engine VM, you can refer to the Enabling Nested Virtualization for VM Instances documentation, for further information.
However, you can use arm64-v8a or armeabi-v7a ABI. They are pretty slow but you will be able to test your applications there. You can make them faster, but it will require a powerful VM that will cost a lot of money. To use those images in Android Studio emulator:
Go to Tools > AVD Manager.
On the bottom left corner click on + Create Virtual Device ....
In Choose a device definition, choose any device you want and click Next
In Select a system image go to Other images tab
Choose any arm64-v8a or armeabi-v7a ABI. (Download if you don't have one)
Click on Next, give a name and click Finish
Run the Virtual Device and give it some time, according to how powerful is your VM it will take some time to load. You will see an Android logo loading and after few minutes you will see the Home Screen. If it takes too long, try restarting the AVD and the Android Studio, then leave it some time to load. It is pretty slow, but it is working, I tested it myself.
Try below steps -
Open SDK Manager (In Android Studio, go to Tools > Android > SDK Manager) and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't.
Now go to your SDK directory C:\users\%USERNAME%\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager\ and run the file named intelhaxm-android.exe.
In case you get an error like "Intel virtualization technology (vt, vt-x) is not enabled". Go to your BIOS settings and enable Hardware Virtualization.
Restart Android Studio and then try to start the AVD again.

Starting sas job from remote computer

I have a scheduling program running on Server A running Windows 2008 RS. Server B is my SAS server under Windows 2008 R2. How do I kick-off a job on SAS server from my scheduling server? I can either use the sas.exe or a batch file to start my job. Owners of the SAS server tell me that I cannot add an application or Windows service to the SAS server. Is this even possible?
Below is a copy of my answer to a slightly different question (source: http://www.runsubmit.com/questions/260/hide-sas-batch-jobs-winxp). I'm copy/pasting it here for perpetuity and also because it's more likely to help people searching:
You can use PsExec which is part of Microsoft/Sysinternals list of utility programs. This file will go on the scheduling server. Grab it from here:
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
The tool is designed to allow you to execute jobs on remote machines. For example, if you want to launch a SAS program from the command line you could run:
psexec \\machinename sas.exe -sysin remotedrivename:\remotefolder\myprogram.sas
This would launch SAS.EXE on the remote machine and run the supplied program that exists on the remote machine. When it launches SAS it appears to launch it within a PsServ service. Because it's running within a service no interface will be displayed. I'm not even sure if you would see it appear as it's own process or application in windows task manager. If you use SysInternals other program, ProcessExplorer, instead of Task Manager you can see this happening.
Note that the REMOTE MACHINE and the LOCAL machine can be the same machine.
PROS: Many other uses for this technique. It's free. PsExec is only required on the machine that is making the call, not both machines.
CONS: Its a bit of a roundabout way to do things. Need to install a third party program (although it is now a MS tool). Some antivirus programs/network admins may not allow it.
Note that if your SAS jobs access network resources then you will probably need to make the network resource available first using the net map command. I suggest running your sas job in a batch file like so (or use the 'x' command from within your SAS file to call the 'net use' commands):
Command executed from local machine:
psexec \\machinename -sysin remotedrivename:\remotefolder\myprogram.BAT
Contents of batch file on remote machine:
net use m: \\fileserver\sharedfolder /USER:mynetworkdomainname\myusername mypassword
sas.exe -sysin remotedrivename:\remotefolder\myprogram.sas
net use m: /delete

Command line application running as a windows service. Getting error 1053

I have created a c++ command line application. This application sends a revives messages from other computers and logs the results to a file. A simple application. One of the first things the app does is write to the log file the start up time.
Now that I have gotten the application to a good place, I want to install it as a service that runs on my computer (win 7).
I am using the NSIS, Simple_Service_Plugin to install the application and register the service in windows. I can see the service in windows service manager.
When I attempt to start the service, I get the following error message. The log file does not get created.
Windows could not start __THE_APP__ service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
When I start the app from explore it starts without any problems and the log file is updated correctly.
When I search this error message on-line I find lots of help for C# and .Net applications and nothing for c++ apps.
My question is:
How do I start a C++ application (not dot.net) as a service?
A service isn't a regular appliction. It's a program that uses specific system classes and implements certain features that enable the OS to communicate with it.
See here (and the surrounding pages) for more details.

CruiseControl.NET run as a windows service and as a standalone process behaves differently

I have a project that is being built using CruiseControl.NET. The project contains an 'MSBuild task' that runs the build for the project and also the unit tests. The unit test in turn is just a MSBuild 'exec' task that runs an executable.
The unit test involves some .NET remoting. And when the unit tests are run through the system command prompt, the software's window opens up, tests run and the process exits.
When I force a build through the web dashboard, the build hangs at the point where the unit test starts running. The software's window does not open up, but the executable is running. If the process is killed through the task explorer, the build goes through with a 'Failure' status. This happens when I run ccnet as a windows service.
If I run CCNet directly (not as a windows service) and force a build through the web dashboard, the build and unit tests go through fine as expected. (with the window of the software opening up.)
It looks like there is a deadlock in the case where CCNet is run as a windows service. I am guessing it is related to the standard output/error streams.
Is this is known problem?
What might be the problem going on?
Any suggestions on debugging this?
How can I get around it?
(I am using CCNet version 1.4.4 SP1)
When CCNet is running as a service it is not going to have access to the display, so don't expect to see anything on the screen in this configuration. The first thing I would check is the permissions - make sure the service runs as an account that has permissions to access whatever resources you need. You also have CCNet log files, which you can find via Dashboard.
On a side note, try TeamCity instead of CCNet, its 10 years ahead.
Maybe this answer will help :
delphi windows service can't download file from internet
You should know that when running CCNet as an application (the dosbox) it uses the environment variables and all rights from the logged account. So it may connect to a server, use cached passwords, get registry variables for this account.
BUT when ran as a service, the account is the one you provided : LocalSystem for exampe, where env. varibales are not the same.
So, what you can do is to change the CCNet service account for test. Change it to your user account (with password), and I'm sure it will work better !