Add AzureDevOps Search as Chrome/Chromium 'Other search engine' - google-chrome

I want to add Azure DevOps Search to Chrome (or other Chromium) browsers so I can do quick code searches from the browser.
I got it working to search all repositories, but I want to also be able to add a specific "Search engine" for a specific repository.
What's the Query URL to search a specific repository in Azure DevOps?
WHAT I HAVE SO FAR:
I've added a new "Other search engines":
Search engine: Azure DevOps (all)
Keyword: code
Url: https://dev.azure.com/skykick/SkyKick%201/_search?action=contents&text=%s&type=code
And that works:
In address bar, type code and press tab:
Search for test
Press enter - be taken to Azure DevOps code results
What's the URL format to include a specific Repository in my search results?
So I have a Repository SkyKick.Example - I'd like to be able to create an additional "Other search engine" that will search just that repoistory.
I looked at the Network tab looking for what url the app uses, and I tried this configuration:
Search engine: Azure DevOps (SkyKick.Example)
Keyword: example
Url: https://dev.azure.com/skykick/SkyKick%201/_search?action=contents
&text=%s
&type=code
&lp=code-Project
&filters=ProjectFilters%7BSkyKick%201%7DRepositoryFilters%7BSkyKick.Example%7D
&pageSize=25
&__rt=fps
&__ver=2
But this doesn't load a page, just a wall of text.

Cool idea! This works for me for scoping it to just a repository
https://dev.azure.com/COLLECTION-NAME/_search?action=contents
&text=%s
&type=code
&lp=code-Project
&filters=ProjectFilters%7Besmith.dev%7DRepositoryFilters%7Besmith.dev%7D
&pageSize=25
&result=?

Related

wso2 1.10 store DefaultApplication Missing

I have installed a standalone instance of wso2 API Manager 1.10.0 with the CARBON-PATCH-4.4.0-0084 installed. I am walking through the PhoneVerification tutorial and have published the API as instructed. I created a new user for the store and am trying to subscribe to the PhoneVerification-2.0.0 API but cannot because there is no DefaultApplication in the Applications dropdown list. It is missing from the list. I tried to add and application and get an error dialog saying Missing Parameters. I am stuck and cannot go any further. One additional piece of information, I am using mysql instead of the h2 default. I followed all the instructions to setup mysql and had no problems. Also I changed the admin password as well.
I have tried API Manager 1.10 with security patch CARBON-PATCH-4.4.0-0084 with no issues. I can create APIs and subscribe using the DefaultApplication. I tried with default database and a new user who is assigned to 'Internal/subscriber' role.
Please check if you have any other changes for Store Web app at 'wso2am-1.10.0/repository/deployment/server/jaggeryapps/store'. You have to replace 'store' and 'publisher' apps as instructed in the Readme of patch.
(iii) Merge and Replace resource/store to /repository/deployment/server/jaggeryapps/store
(iv) Merge and Replace resource/publisher to /repository/deployment/server/jaggeryapps/publisher
To check if the Mysql configuration worked properly, please check if there are any errors in Carbon log, at 'repository/logs/wso2carbon.log' file related to that. And double check if userstore and api-manager database tables are created properly and configured in 'repository/conf/datasources/master-datasources.xml' properly.

Disable Chrome address bar autosearch for dev

Developing a web app locally and I just can't get Chrome to actually go to this address, because auto search always kicks in (http://0.0.0.0:5000/api works though, for example).
Is there a way to overwrite this behaviour or force Chrome to try a http request first, before anything else?
I am aware I can just curl it or whatever to see the response...
Go to chrome://omnibox/ and check [x] Prevent inline autocomplete
The answer to this has to be in chrome://chrome-urls
you should see something like the following:
The "full" set of settings is on the chrome://chrome-urls . Also chrome://flags is worth to check. As a side by enabling some experimental features from chrome://flags you can greatly enhance your browsers HTML5 support which can be checked at HTML 5 support .
else:
Clear browser historythen go to settings and under Privacy --> uncheck [] Use a prediction service to help complete searches and URLs typed in the address bar .
Another idea is to examine carefully if using linux the output of the following command for parameters:
ps -aux | grep google-chrome-stable
in my case the output tells me a lot about what parameters are used at launch by default:
/opt/google/chrome/chrome --type=renderer --disable-layer-squashing --enable-transition-compositing --enable-deferred-image-decoding --enable-display-list-2d-canvas --enable-distance-field-text --enable-encrypted-media --enable-experimental-canvas-features --enable-experimental-web-platform-features --enable-lcd-text --enable-one-copy --enable-overlay-scrollbar --enable-renderer-mojo-channel --enable-smooth-scrolling --enable-viewport-meta --enable-webgl-draft-extensions --enable-web-midi --enable-zero-copy --max-tiles-for-interest-area=512 --enable-plugin-power-saver --lang=en-US --force-fieldtrials=AutoReloadExperiment/FlagEnabled/AutoReloadVisibleOnlyExperiment/FlagEnabled/ChromeSuggestions/Default/DomRel-Enable/enable/EnhancedBookmarks/Default/ExtensionContentVerification/Enforce/ExtensionInstallVerification/None/GCM/Enabled/MaterialDesignNTP/Enabled_forced/OmniboxBundledExperimentV1/StandardR4/PasswordGeneration/Disabled/PrerenderFromOmnibox/OmniboxPrerenderEnabled/QUIC/FlagEnabled/SafeBrowsingIncidentReportingService/Default/SettingsEnforcement/no_enforcement/UMA-Dynamic-Binary-Uniformity-Trial/default/UMA-Population-Restrict/normal/UMA-Uniformity-Trial-1-Percent/group_09/UMA-Uniformity-Trial-10-Percent/group_02/UMA-Uniformity-Trial-100-Percent/group_01/UMA-Uniformity-Trial-20-Percent/group_04/UMA-Uniformity-Trial-5-Percent/group_16/UMA-Uniformity-Trial-50-Percent/group_01/UwSInterstitialStatus/OnButInvisible/VoiceTrigger/Install/WebRTC-IPv6Default/Default/ --enable-crash-reporter=9F2AFD26-85F1-40CB-991F-0980EF2C4D14 --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --enable-offline-load-stale-cache --enable-app-window-controls --enable-embedded-extension-options --enable-experimental-extension-apis --enable-scripts-require-action --enable-nacl --enable-nacl-debug --enable-streamlined-hosted-apps --enable-web-based-signin --javascript-harmony --out-of-process-pdf --enable-delegated-renderer --enable-impl-side-painting --num-raster-threads=4 --enable-gpu-rasterization --channel=5035.27.2136067136
Even yet another idea is maybe to write a small widget using python's tkinter and the webrowser modules, it could even get its input from the clipboard.
this command could be a work around solution too:
python -m webbrowser -t "http://ip.ip.ip.ip:portport/file/"
Another option yet is to use The Omnibox API and embed a custom omnibox in a simple webpage. Here are the omnibox api ready made samples.
You can avoid this by adding a "/" at the end of the URL http://0.0.0.0:5000/api/
or
You can try to add a null search engine with a URL of http://%s and null keyword.
Go to the search engine settings:
Open Settings.
Click Manage search engines
At the bottom of the Other search engines section add a new search engine.
Using #Juan Buhagiar answer as a starting point, I added your URL as the URL of a default search engine:
Other search engines
| MyAPI | 0.0.0.0 | http://0.0.0.0:5000/api/venues/show/45/20/cafes?rubbish=%s |
That just worked. The only drawback is that you get a redundant query to your request:
http://0.0.0.0:5000/api/venues/show/45/20/cafes?rubbish=0.0.0.0%3A5000%2Fapi%2Fvenues%2Fshow%2F45%2F20%2Fcafes%2F
instead of plain:
http://0.0.0.0:5000/api/venues/show/45/20/cafes
So as long as it does not conflict with your own GET, you can just ignore it.
Simplest way - Add a bookmark with your desired address. This time it will not goto search. This may not be useful if you have to change variables regularly, which was not my case.
This is helpful if you do not want it to disable omnibar search completely since it is quite a useful feature.

How to enable API button for CKAN data set?

I have successfully added a data set for the CKAN site. It enables to preview the data set as well.
Below is the URL for the data set
testckan.com:5000/dataset/my-data1/resource/4c2647ca-a4ab-4d20-8119-5c3da9d4ae14
By adding api/rest/ to the URL as below enables to expose data sets as a JSON service.
testckan.com:5000/api/rest/dataset/my-data1/resource/4c2647ca-a4ab-4d20-8119-5c3da9d4ae14
All I want to do is add an button so that user can view the data set as a JSON rather than typing it in the URL which is not user friendly.
I have seen similar button in the
http://data.gov.uk/dataset/bona-vacantia-estates-advertisements
under API & APPS. Please see the image below.
How to enable API button for CKAN data set like above?
You will have to modify the front-end templating for the package (aka dataset) view. You can either add this change to your own copy of CKAN source code, or like Hendrik mentioned and data.gov.uk people have done, create a CKAN extension to modify the templates.
Your example of the feature is implemented for the data.gov.uk site which is open source and available in GitHub. The specific part is in the read_common.html:
<b>API: </b><a href="${h.url_for(controller='api', register='package', action='show', id=c.pkg.name, ver='2')}">
${h.url_for(controller='api', register='package', action='show', id=c.pkg.name, ver='2')}
</a>
The url_for function is from the ckan.lib.helpers module which "is available for templates as 'h'" according to the CKAN docs, so you should be able to use it directly in the template as in the code above.
AFAIK that's no feature of CKAN itself, thus it can not be enabled. You can, however, easily add it yourself in an extension.

Setting the Default Search Provider on Chrome via a script

I am attempting to set various Google Chrome preferences via a script (on both OS X and Windows). I can successfully set a number of preferences, and add bookmarks, by editing the Preferences and Bookmarks json files in the user's Application Data folder. However, when i attempt to set a new default search provider, the browser automatically reverts to Google search.
The default search provider node in the Preferences file looks like this:
"default_search_provider": {
"enabled": true,
"encodings": "UTF-8",
"icon_url": "http://www.google.com/favicon.ico",
"id": "2",
"instant_url": "{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&ie={inputEncoding}&ion=1{searchTerms}&nord=1",
"keyword": "google.com",
"name": "Google",
"prepopulate_id": "1",
"search_url": "{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}&q={searchTerms}",
"suggest_url": "{google:baseSuggestURL}search?client=chrome&hl={language}&q={searchTerms}"
}
In order to add my desired search provider, I've simply added it manually (via the wrench menu), viewed the effect of this action on the json file, and then written a script to mimic these changes. However, when I change it via a script, the default search provider is used for the first search, but then resets the next time chrome is started. What am i missing here?
as mentioned, you should edit the 'Web Data' file, which is an sqlite database.
To add a search engine, add an entry to the 'keywords' table.
To change the default search engine, edit the 'Default Search Provider ID' value inside the 'meta' table.
If you want to change the default search provider in Google Chrome you have to modify 'Web Data' file wich is an SQLite file.
On my computer the location where you can find the file is C:\Users\daniel\AppData\Local\Google\Chrome\User Data\Default(Windows7).
See the content of file with SQLite Database Browser; you can find one here.
Despite everybody here suggesting to write to Chrome's Sqlite DB, the same can be achieved via JSON based config files (as noted above by https://stackoverflow.com/users/49572/andreas-huber).
The relevant documentation can be found here:
https://www.chromium.org/administrators/policy-templates
https://www.chromium.org/administrators/linux-quick-start
https://www.chromium.org/administrators/policy-list-3#DefaultSearchProvider
For Chrome on Linux putting something like this into /opt/chrome/etc/policies/recommended/duckduckgo.json shoud get you started:
{
"DefaultSearchProviderEnabled": true,
"DefaultSearchProviderName": "DuckDuckGo",
"DefaultSearchProviderSearchURL": "https://duckduckgo.com/?q={searchTerms}"
}
On Windows and OSX and with Chromium the places to set this are different, but are all documented under the above given URLs.
A solution that is working for Chromium and Chrome on Ubuntu can be found here:
https://github.com/andreashuber69/os-setup/blob/master/common/reset-browser-preferences
Besides setting the default search provider, the linked script further customizes Chromium/Chrome to my liking. For Chrome, the part relevant to the question goes like this:
# Modify the preferences relevant to the default search provider
cat ~/.config/google-chrome/Default/Preferences | jq '.default_search_provider_data.template_url_data={ "keyword": "duckduckgo.com", "short_name": "DuckDuckGo", "suggestions_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list", "url": "https://duckduckgo.com/?q={searchTerms}&t=canonical" }' >adapted-preferences.json
mv adapted-preferences.json ~/.config/google-chrome/Default/Preferences
This simply adds a new entry to the list of search engines and sets it as default. If you want to select an existing one, things are little more complicated (see script for details). The above requires the package jq, which is not present out of the box on Ubuntu.
Contrary to other posts, it seems no longer possible to set the default in the meta table. It must be done through the Preferences file as shown above.

Sourcegear Vault: How do I get an automated list of checked out files?

Question:
How can I get a list of all checked out files per user in Sourcegear Vault?
Use of this functionality:
From time to time we have developers leaving files checked out and although this results in drastic punishment (they owe a coffee to the person who needed the checked out file) we are still left with files checked out and work held up.
We would like to display a list of all current number of files checked out by each developer. This way they can check if they have anything checked out before they go home or out the office.
In the Vault Client app, use the Search tab at the bottom of the window.
Select Search By: "Checked Out By" to see a list of all files checked out by a specific user, or by any user.
You can choose to search a specific sub-folder, or from the root, recursively or not.
To automate this, use the Vault Command-Line client (vault.exe)
vault -host myhost.mydomain -user something -password something -repository myrepo listcheckouts
Will give you a list, in XML, of all checked-out files and their users. You can transform the results, or use the command-line client's source code (provided as an example with the Vault .NET API) as a starting point to write your own version.
The various clients and APIs can be grabbed from http://sourcegear.com/vault/downloads.html - didn't want to link to a specific version that would be outdated after the next release.