Debug a file on virtual Vagrant box with Xdebug - vagrant

I have a Vagrant virtual machine, with a website running on it, on my MacBook.
I would like to inspect what is in a variable called $logs. I have set the cookie in my browser using the Chrome extension, and I am listening for PHP debug connections, and I have set a breakpoint. If I select the 'Run' menu and click 'Debug sitelog.module', I get some errors.
I'm not sure how to configure this? My ultimate goal is to inspect the contents of $logs. Thanks.

I do not use cookies anymore for debugging as I found easier to debug by enabling remote debugging in xdebug.
In any case I suggest that you first create a PHP Web application and define a Server for that web application. To do this:
With the Navigation bar visible (View | Navigation Bar), the available run/debug configurations are displayed in the run/debug configuration selector in the Run area.
In the Run/Debug Configuration dialog box, click + (add) on the toolbar. The drop-down list shows the default run/debug configurations. Select the desired configuration type (ie: PHP Web Application).
Set up a server for this configuration by clicking on the ... icon next to the Server dropdown.
On the Servers configuration, fill in the name, host and port and check the Use path mappings checkbox.
Define your path mapping, by selecting on the left side (your host machine) the desired path and then providing the path to the same location in your guest (press enter on the input field once you define the path for the guest machine).
With this you should be able to debug using the XDEBUG cookie. If you would like to try the remote debugging option (which IMO is much simpler) then add this to your xdebug.ini
zend_extension=xdebug.so
xdebug.auto_trace="0"
xdebug.trace_output_dir="/vagrant"
xdebug.trace_output_name="trace.%c"
xdebug.trace_format="2"
xdebug.trace_options="0"
xdebug.collect_includes="1"
xdebug.collect_params="0"
xdebug.collect_return="0"
xdebug.collect_vars="0"
xdebug.default_enable="1"
xdebug.extended_info="1"
xdebug.manual_url="http://www.php.net"
xdebug.max_nesting_level="256"
xdebug.show_error_trace="0"
xdebug.show_exception_trace="0"
xdebug.show_local_vars="0"
xdebug.show_mem_delta="1"
xdebug.dump.COOKIE="NULL"
xdebug.dump.ENV="NULL"
xdebug.dump.FILES="NULL"
xdebug.dump.GET="NULL"
xdebug.dump.POST="NULL"
xdebug.dump.REQUEST="NULL"
xdebug.dump.SERVER="NULL"
xdebug.dump.SESSION="NULL"
xdebug.dump_globals="1"
xdebug.dump_once="1"
xdebug.dump_undefined="0"
xdebug.overload_var_dump="2"
xdebug.profiler_enable="0"
xdebug.profiler_output_dir="/vagrant"
xdebug.profiler_output_name="cachegrind.out.%p"
xdebug.profiler_enable_trigger="0"
xdebug.profiler_append="0"
xdebug.profiler_aggregate="0"
xdebug.remote_enable="1"
xdebug.remote_handler="dbgp"
xdebug.remote_host="192.168.33.1"
xdebug.remote_mode="req"
xdebug.remote_port="9000"
xdebug.remote_autostart="1"
xdebug.remote_log=""
xdebug.idekey=""
xdebug.var_display_max_data="512"
xdebug.var_display_max_depth="2"
xdebug.var_display_max_children="128"
Make sure you adjust the remote_host ip if needed. Once you save this changes to your xdebug.ini, all you need to do to start debugging is to enable the Start listening for PHP Debug Connections icon (looks like a telephone).
Reference:
How to set up Run/Debug Configurations

Related

TortoiseGit IBugTraqProvider2 interface

I'm using TortoiseGit 2.10.0.2. I wrote an Issue Tracker plugin based on the sample programs in C#. Everything works OK except for configuration. On the Setup Issue Tracker Config screen, there is a field called "Provider parameters" where I can manually enter a configuration string. Appendix B of the manual describes the HasOptions and ShowOptionsDialog interfaces for entering the parameters with a GUI instead of a raw string. The appendix says this interface is called when the user clicks the "Options" button. However, there is no "Options" button on the Issue Tracker Config screen.
If I use the Issue Tracker Integration screen to add my plugin to a specific Git directory, the "Options" button is present and works. But I don't want to have to set this up every time a repository is cloned.
How to I get the "Options" button to show on the Setup Issue Tracker Config screen?
You can store the provider UUID and the params to .tgitconfig (i.e., called "project" on the settings page; the config keys are name bugtraq.provideruuid, bugtraq.provideruuid64 and bugtraq.providerparams). Then you can commit this file and the settings are always used.
There is, however, no "Options" button available there - the values need to be entered manually.
cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks-issuetracker-config

Changing server name in WPS/WAS 7.5

After federating the node from a WAS to another DMGR application, the server name was automatically changed to server1.
Is there any way to change it to, for example, server2?
Try this:
Create a new server template using your existing server configuration.
a. In Admin console, go to servers > Websphere Application Servers
b. Click on "Templates" > "New" and select your current server (eg:server1) and click "ok"
c. Name the template (eg: MyServerTemplate) and enter a short description. Click "Ok" and save the changes
Create new server using the template created in last step
a. In Admin console, go to servers > Websphere Application Servers
b. Click on "New", Enter the desired server name (eg: server2) and Click on "Next"
c. Select the new template name created in the last step (eg: MyServerTemplate) and click "Next"
d. Select "Generate Unique ports" (unless you need the default ports and know how to manage it)
e. Click Finish and Save the changes
Now you will have two servers with identical configurations. Validate the configs in the new server and delete the Old server with wrong name.

Checkbox to toggle Application Insights Diagnostics on a Worker Role in VS2015 not toggling

I was following this tutorial so I could add Diagnostics to my worker role. I followed all the steps but when I get up to Step 1 of the "Azure Diagnostics" section, I can see the "Send Diagnostics data to Application Insights" checkbox there, but I am unable to select it.
When I click on it, it doesn't toggle, stays unchecked.
What may cause this to occur? Are there any steps specific to Worker Roles to get this working that Web Roles didn't need?
If you don't see the "Send diagnostics data to Application Insights" dialog when you click the Checkbox (which sounds like a bug, I'm wondering if this is happening to all of your worker role projects even with newly created ones), you can still manually edit the configuration files to achieve the same thing.
First go to the Settings tab in the role properties page and add a new setting item named "APPINSIGHTS_INSTRUMENTATIONKEY". The "Type" of the setting should be "String". The "Value" of the setting should be the instrumentation key of your target Application Insights resource. You can find it on the Azure portal by selecting the resource and then go to its Settings -> Properties blade.
Then open the "diagnostics.wadcfgx" file under your worker role in Solution Explorer. From there add an attribute "sinks" with value "applicationInsights.errors" to the "DiagnosticsMonitorConfiguration" element. The element should then looks like this:
<DiagnosticMonitorConfiguration overallQuotaInMB="4096" sinks="applicationInsights.errors">
In the same file, add the following section under the WadCfg element:
<SinksConfig>
<Sink name="applicationInsights">
<ApplicationInsights />
<Channels>
<Channel logLevel="Error" name="errors" />
</Channels>
</Sink>
</SinksConfig>
So, it turns out that I needed to put the instrumentation key in both the Cloud and Local service configurations. I had only had it on cloud as I thought I would only be using the diagnostics on cloud deployments.

Firefox extension: Secret Agent - User Agent String Randomizer - Application testing

Extension Link: https://www.dephormation.org.uk/?page=81
This plugin is great. It has one problem though, on pages that use AJAX to make http requests, it switches the user agent for each request and confuses many ajax applications.
What I want to do is figure out where the preferences for this plugin are saved. Particularly, where all the User-Agent Strings that are currently being used are located. I would like to do this so that I could edit these settings outside of firefox before I open the browser so as to "hot swap" one user agent string for each browsing session at a time. I have looked through all kinds of .sqlite databases in my firefox profile but still haven't found the information.
I am using Watir-Webdriver with ruby to application test.
As Mr Palant said... simply changing general.useragent.override would achieve what you want.
Type about:config in the address bar, accept the warning, and filter on useragent and you'll see the setting.
I gather (but haven't tested) this preference may not affect the user agent presented to client side Javascript code. So if your Ajax code references navigator.useragent you might find the real user agent is returned despite your override setting.
Pete (author of SecretAgent).
www.secretagent.org.uk
PS See also
https://developer.mozilla.org/en/Document_Object_Model_%28DOM%29/window.navigator.userAgent
You don't need an add-on for that - changing general.useragent.override preference (create it if not present yet) is enough to set a different user agent string. In Firefox you can do it under about:config, when Firefox isn't running you can add this preference to the file prefs.js in the Firefox profile.

How to associate a URL to an application using Cocoa

From the command prompt it's possible to run for example "open http://www.example.com" and have that homepage displayed in the default browser.
Similarly you can run "open callto:xyz123" to open up a skype-call to user xyz123.
I'd like to do the same with a customized web browser without replacing the default web browser. My idea is to register a new protocol (mb) so that when I run "open mb://www.example.com" that web page will open up in this new custom browser.
How can an application register itself to handle URL's with a certain protocol?
Found it, it's in the Info.plist file using the key CFBundleURLTypes

Resources