Make netbeans use virtual box guest installation of phpunit - batch-file

We use netbean's phpunit / unit testing plugins for all our testing. We used to use xampp and point netbeans at our our .bat file from the xampp installation. We recently started using vagrant and are now running our dev environment in virtual box. I would like to make netbeans use the installation of phpunit within the virtual machine. This would save us from having to have both installed. Is this even possible? Netbeans seems to want a file location and I am stumped as to how I can go about doing this.
[EDIT] I've created a custom batch file that uses vbox guestconrols to forward the commands to the VMs installation of phpunit. I am going to then point netbeans at my custom .bat file. My problem is, now, that guestcontrols doesn't seem to be forwarding --bootstrap. It seems to be trying to take it and use it, rather than forward it along. The docs say that all the additional arguments will just be passed on, but that doesn't seem to be the case. Here is what I am using in my my_phpunit.bat :
[my_phpunit.bat]
#echo off
if "%VBoxManage%" == "" set VBoxManage=C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
"%VBoxManage%" "--nologo" "guestcontrol" "<my_vm_name>" "execute" "--image" "/usr/bin/php5" "/usr/bin/phpunit" "--verbose" "--username" "<user>" "--password" "<pass>" "--wait-stdout" "--wait-stderr" "CustomNetbeansTestSuite" "<path/to/test/suite>" "--bootstrap" "<path/to/bootstrap>" %7
I am almost there, as running the bat file without the bootstrap option at the end takes me to the unit test. I am getting exceptions because of some autoloader issues(no bootstrap), but if I can figure out a better way to forward these command line arguments to
[EDIT 2]
I think I've finally solved this, but I need to get some issues with my guest OS in order. Once I've been able to test it a bit more, I'll post the final solution. I solved the Vbox guest control issue by adding "--" before I actually sent the parameters that should be forwarded. It said to do so in the docs, but it wasn't entirely clear to me at first.

I just wanted to update that I never actually got the .bat file to work. I think I got pretty close, but I was hung up on some linux CLI output that I couldn't suppress. The .bat file that I ended up with was:
# .bat example
https://pastebin.com/BX1xnL3q
I ended up moving to PhpStorm and everything worked out of the box. So, if you're still using netbeans, you can try and give that a shot. Maybe someone with more unix / linux experience can fix the issues I was having. I feel I was like 99% there with it.

Related

How to lock an exe file?

(Sorry in advance, if I have the wrong tags)
Hello!
So I am trying to work on a personal WPF project which would allow the client application exe to download another application exe (Unity Application) and open it within the client exe's Grid. Everything is working fine.
But, I am wondering if there's a way to "lock" the downloaded application in a way that only my client exe can open the downloaded exe?
Here's the only solution I have thought of but not sure with
Check for command line arguments within the Unity Applications
This works well but people who knows about the existence of decompiler might be able to decode that I am trying to check the arguments, and input relevant data there. :(. So, it won't help too much?
Thanks for any insights.
-Kevin
There is no non-hackable solution, you can only make it harder for crackers to break into the app by code obfuscation (hard to read the code) + adding integrity checks (make sure that your app is not modified).. There are commecial apps out there to do this (ex. PreEmptive), and their solutions differ from each other, nothing is ultimate.
Anyway, You might make Unity Application read some file or some registry value that Client application has updated just before launching the Unity Application, along with command line args method that you mentioned..

Mongo DB - bash: mongo: command not found

So I have been learning about databases and I'm new to it. In my udemy course the video was outdated for the installation of MngoDB version 6.0.1. The video instructor showed a way to install it using the vim editor. However it didn't work for me. Then I discovered that many people are going through the same problem and a guy told a solution to delete the file created with vim and instead use "system environment variable". I edited the path by adding a new one in which I did exactly as the guy mentioned to specify the 'bin' folder inside mongoDB in the Program files. And when I tried to run the 'mongod' command inside hyper I got this at the last line.
{"t":{"$date":"2022-09-09T10:05:27.885+05:30"},"s":"I", "c":"NETWORK", "id":23016,
"ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
The instructor did mention that I should see something like "Waiting for connections at port 27017". However the last line in hyper doesn't explicitly mention it in one line, but I think that's fine. Because the instructor was using a mac and I am using a Windows device. Now here comes the main error. When I open a new tab in Hyper and type 'mongo', I get this error
$ mongo
bash: mongo: command not found
I've researched a lot on stackoverflow but nothing helped me in the end. However I can provide with something that might help in figuring out the solution. Here's something unusual that I noticed. The 'bin' folder in C:/ProgramFiles/MongoDB/Server/6.0 seems to contain very few files. It has only 2 .exe applications namely - 'mongod.exe' & 'mongos.exe'. There is no 'mongo.exe' that my instructor has on her computer. I think this might be the root of the problem, however I'm not sure. also there are other files that seem to be missing. But I would like to mention that I've not tampered the files even once since I've installed them from the setup. I hope this is enough for you guys to solve this. Please help me.

Starting a graphical application using sfml on Raspberry Pi boot

I would like to make a Graphical interface for a home-made program using SFML on Raspberry Pi2. I am using Raspbian. I recompiled the graphical lib
It works fine unsing startx first, then using my application, which wors perfectly fine.
But I can't figure if it is possible or how to launch my application directly after boot without launching startx (just to optimise the cpu of the Raspberry).
Starting my program direcly after boot, I get the following error:
Failed to open X11 display: make sure the DISPLAY environnement variable is set correctly.
Aborted.
I already tested the classic export DISPLAY=:0.0 but without sucess.
I interested myself in x and xinit, but I am not sure that would even do it.
Where should I start looking? I don't need a complete solution, even a hint or an idea would be nice!
I checked to see if it was possible to open a graphical app without the X desktop environment and as that answer states, with Firefox at least, you need the X server which SFML also probably needs in order to create a window.
The answer states:
Basically something like:
$ X
Then you just start Firefox in this X server:
$ DISPLAY=:0 firefox
You can switch from the X server and the framebuffer by using
CTRL+ALT+F1 and CTRL+ALT+F7.
You could try that and see if it helps.
Also, still searching, I found a forum post on the sfml website about what you're trying to accomplish stating somewhere:
SFML requires OpenGL, so as far as I know you need at least X running,
but you probably don't need gnome, KDE or a similar Desktop
Environment on top.
The forum guy asking for help seems to have managed to get X11 and a SFML basic render window to work on Ubuntu server after someone posted a link to xinitrc. I guess, that's the route to go from here.

Getting the examples in libspotify to work under Windows 7

I want to get started with libspotify on my Win 7 machine but I dont have a clue on how to get it all setup so that I can even run the examples included in the pack. I have a Spotify Premium account and I have tried installing libspotify by copying libspotify.dll to c:\windows, c:\windows\system32 and to c:\windows\SysWOW64 and also changed the path variable to include the path where libspotify.dll is located but I still dont understand how to get the examples to work.
I have Code::Blocks installed but as soon as I try to import and run any of the .c files included in the /examples/ folder I get all kinds of error messages. The truth is that I am not even sure how to install libspotify and the documentation is absolutely non existent so for a beginner it is impossible to even have a chance at getting started.
Is there somebody out there who can do a simple walkthrough on how to install libspotify and get the examples up and running on a Win 7 (64-bit) machine?
The only thing I really want to do with libspotify is to be able to via a command prompt or something like that be able to queue a song in Spotify so I dont really care about the other parts. But I can probably solve that by myself as long as I can get an example up and running.
Sadly libspotify is not well-supported on Windows, in fact the example code won't even build because there is no Windows audio driver for them. Your best bet to just get up and running would be to use mingw, or linux in a VirtualBox environment.

fatal error: call to undefined function mssql_connect() on mac osx lion 10.7.4

So, I can execute php scripts from the terminal, but when the script tries to connect to the database using mssql_connect(), I run into this problem. I have gone through almost all of the sources available for this problem. But, it seems like I have something different. I'm fairly new to Mac, but I have followed most of the steps like uncommenting
#LoadModule php5_module libexec/apache2/libphp5.so
from the httpd.conf file, turning on the web sharing under system preferences. However, I'm not sure if I need to uncomment php_mysql/(i).dll from the php.ini file as well, since I'm using ms sql and not my sql. Also, I do not seem to have php_mssql70.dll like it was suggested in one of the forums I ran into during my search. But, there are 2 lines in my .ini file that read
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll \\Yes. They both read the same thing.
Can someone point me in the right direction please? I'm not sure if the information I gave is sufficient. But yes, I think I have read and tried to emulate 90% of the forums that claim to solve this problem.
NOTE: This post seemed quite close to what I am trying, given that the user is a noob at this. I haven't really set up PHP, Apache, etc by myself since I have only worked with Php and MySQL in school till now.
How to install/use php on mac v 10.7.2
Since you're not on Windows you need to ignore anyone mentioning anything containing '*.dll'.
Look for extensions.ini which should in the same folder as php.ini, or in a folder very close to it, and you should be able to enable it from there, it should be a .so file. If it is not already there then the extension is not installed at all. I have no idea how to add PHP extensions on OSX, though. :I

Resources