Is there some public mirror for composer packages? - composer-php

My company's IPs range seems to be blocked by packagist.org's hosting service and I can't reach that domain. I've already contacted them but I don't know how much long it will take to remove the blockage. Moreover, every external web proxy I try to use falls into my company's firewall so I'm stuck.
Is there any public mirror for composer packages so I don't have to depend on packagist.org domain?
Any other solution is welcome as well.

I couldn't find a public mirror but I was able to solve packagist.org dependency by editing ~/.composer/config.json and adding dependent projects' GitHub links as repositories, eg:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/smarty-php/smarty" },
{ "type": "vcs", "url": "https://github.com/sebastianbergmann/phpunit" },
{ "type": "vcs", "url": "https://github.com/sebastianbergmann/php-code-coverage" },
{ "type": "vcs", "url": "https://github.com/sebastianbergmann/php-file-iterator" },
{ "type": "vcs", "url": "https://github.com/sebastianbergmann/php-text-template" },
{ "type": "vcs", "url": "https://github.com/sebastianbergmann/php-timer" },
{ "type": "vcs", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects" },
{ "type": "vcs", "url": "https://github.com/phpspec/prophecy" },
...
{ "packagist": false }
]
}
The drawback is pretty obvious: I had to map every dependency and dependency's dependencies and point out theirs GitHub link. At least it's been faster to do this than to wait for OVH hosting service to solve the blockage problem.

The team responsible for packagist.org states that they don't block anyone within their server. They cannot vouch for the hosting company though.
There is no mirror server that I know of. Are you positively sure that this isn't an issue with your firewall? If you say that you cannot use public proxies because of it, I would say that it might block too much.
On the other side, relying on certain external servers to be up when you need them probably is an expectation that cannot be met all the time. This isn't just packagist.org, but all other hosting web servers with the software you want, like Github, Bitbucket etc. I'd say this would be an ideal opportunity to start creating a local copy for you, but of course this would need a working first time contact with packagist.org.

Related

How to publish an Extension to Azure FHIR repository?

I am using Azure API for FHIR. I have a Claims payload that requires some additional fields, which I am adding to the extension structure like:
extension: [
{
"url": "ROW_ID",
"valueString": "1"
},
{
"url": "LOB",
"valueString": "MAPD"
}
]
To perform a search on ROW_ID, and LOB, I need to publish this extension which I would be using in my SearchParameter.
How and where do I publish the extension ?
To publish an extension, you post the structure definition to your FHIR server. In addition, if you need to search for it you will need to create a custom search parameter and reindex the database. You can read more about that here: https://learn.microsoft.com/en-us/azure/healthcare-apis/fhir/how-to-do-custom-search

Elasticsearch - refresh config

I'm using elastic cloud and I need to configure synonyms. I've done that successfully by uploading a zip file containing a elasticsearch/dictionaries/synonyms.txt file and creating an index that uses them by doing:
PUT /synonym_test
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym_analyzer": {
"tokenizer": "lowercase",
"filter": ["porter_stem", "my_synonyms"]
}
},
"filter": {
"my_synonyms": {
"type": "synonym",
"synonyms_path": "elasticsearch/dictionaries/synonyms.txt",
"updateable": true
}
}
}
}
}
}
GET /synonym_test/_analyze
{
"analyzer": "synonym_analyzer",
"text": "notebook"
}
This works correctly. Now I want to update my synonyms.txt file with new entries, which I can do by using the Extensions API. Once I've uploaded the new file correctly, I need all the nodes to pick up the new configuration and this is where I'm getting in trouble.
How do I restart the nodes so that they pick up the new config files?
I've tried using the API /deployments/:deployment_id/elasticsearch/:ref_id/_restart, which does restart the deployment, but the new synonyms file is not picked up.
I'm looking for a way to programmatically update the deployment, i.e without going to the UI and rebuilding manually
After updating your extension with the new synonyms file, you need to Edit your deployment, click on "Settings and Plugins" to make sure your extension is still checked (it should) and then simply Save your deployment again.
A popup will tell you that no significant changes have been detected, but you can ignore that (i.e. ES Cloud most probably doesn't inspect the content of files) and simply Save your deployment and it will restart again with the new synonyms file.
When updating your extensions, you could also change the name of your extension (e.g. with a version number), then Edit your deployment, click "Setting and Plugins" and swap the old for the new extension. That way ES Cloud will tell you that it detected a change and will restart the nodes upon saving the deployment.

How can I post an image to slack from a proxy?

I have an image that is hosted through a corporate proxy on a private network.
I want to post this image as an accessory on slack via a block.
blocks=[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": response
},
"accessory": {
"type": "image",
"image_url": "http://unaccesible_website/files/14619.png",
"alt_text": "User's picture"
}
}
]
When I try to access this image, I get an error telling me that {'messages': ['[ERROR] downloading image failed [json-pointer:/blocks/0/accessory/image_url]']}}which I can only assume is because slack cannot access the image through the corporate proxy. (I have no problem accessing it from my browser when I am in the corporate network).
My question is, how do I tell slack to go get the image through the proxy?
I have a workaround for this right now that involves downloading the image on my local hard drive and then uploading it with files_upload, but this is slow, and stops me from using blocks (so far I haven't found a way to upload a file in a block).

Passing variables to linked arm template using visual studio

I am trying to create linked ARM tempIates using Visual Studio. For creating a VM I need to pass the variable for vnet prefix, subnet name etc to a different template using a parameter file or a template file. I couldn't get a relevant example in the microsoft site. Please help.
There is a well defined way of doing this. You have a 'deployment' resource in your template that references another template with a uri.
"resources": [
{
"name": "myNestedTemplate",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('template').base, 'nested/', variables('template').nested2)]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"apiVersion": {
"value": "[variables('sharedState')]"
}
}
}
So you need to have the other template accessible. In Visual studio, you can make sure it gets uploaded along with the rest of your artifacts to the storage account.
Check out Mark van Eijk's blog for this particular solution, but also the quick start templates on GitHub are a great resource for finding how to do something.
Also, you must've not looked very hard on the msft website...: Linked Template Example on msft

How to create a desktop app version of a website using NW.js?

I've been using Fluid App (OS X) in the past to create standalone desktop apps of specific web apps I want separated from the browser, have their own dock icon, and not have any of the regular browser fluff (toolbar, address bar, etc.). Fluid app, though, has been neglected for a long time and certain newer web apps (e.g. Inbox from Google) completely fail to load in it.
So I'm looking for a simple way to create a desktop app that will have a single window loading a single website, and I think that NW.js would be ideal for that.
What should be the configuration process for building such a simple desktop app for just a webview for a given URL, using NW.js?
If you simply want to open a single webpage in a NW.js program, it is exceptionally easy.
First make sure you read: https://github.com/nwjs/nw.js/wiki/How-to-run-apps
Especially the MacOS section.
Make a directory your_project/
create a file in your_project/package.json
Then configure package.json:
{
"main": "https://github.com",
"name": "github app",
"description": "Github demo app",
"version": "0.1.0",
"keywords": [ "demo", "node-webkit" ],
"nodejs": false,
"window": {
"title": "Github",
"icon": "logo.png",
"toolbar": false,
"frame": true,
"width": 1024,
"height": 768,
"position": "mouse",
"min_width": 400,
"min_height": 200
},
"webkit": {
"plugin": true
}
}
You can run nwjs from the nwjs.app/Contents/MacOS/nwjs path_to_your_project
Note the "nodejs": false option this disables the nodeapi for the application, if you end up needing nodejs in part of your application make sure what whatever webview you use had nodejs disabled as this is a major security flaw, do your research - do it right.
Also note that nothing is preventing the user to access content from other domains in the above example.
You will eventually want to look at packaging your application, which is also quite simple: https://github.com/nwjs/nw.js/wiki/how-to-package-and-distribute-your-apps

Resources