How to set up gist to work with an existing token? - ruby

I've installed gist Ruby gem. However, I'm having trouble setting up my gist to work with an existing Github account and taken. I've read the instructions in here. However, I'm lost on the next steps I should try to get the authentication working despite following the instructions.
------ Update--------------------------
Found this issue to be open in its Github page: https://github.com/defunkt/gist/issues
Not much I can do at this point.
Thanks in advance for your insights!

You should use your github password, not token: https://github.com/defunkt/gist#authentication

Related

uploadState returns commitFileFailed

I'm trying to create an app in InTune using the Microsoft Graph REST API. I'm able to create the app, the contentversion, upload a file to Azure Storage, and call the commit action. After that, I'm waiting for uploadState 'commitFileSuccess', but it returns 'commitFileFailed'.
I saw a similar question, but that's assuming the file encryption is wrong:
commitFileFailed during mobileAppContentFile Commit
However, I have no clue where the error lies. Is there anybody with experience on this particular subject?
If you need more info, please let me know.
I found out what I was doing wrong. I used the PowerShell sample from Github as a base to write my own Ruby version, but I overlooked one thing.
https://github.com/microsoftgraph/powershell-intune-samples/tree/master/LOB_Application
I was uploading my apk file at once to the azureStorageUri, but I needed to upload it in chunks. After doing that the uploadState got updated to commitFileSuccess.
I will share my Ruby script once I've cleaned it up!

Hyperledger-Composer REST Authentication

Request assistance with hyperledger composer. I have created a network and web app around the REST API that was built with the composer-rest-server. I am able to add participants, assets and execute transaction with the default settings. I am now trying to add authentication to the REST server as well as add identities to new participants. However I got stuck. I have reviewed the information at
https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.html
But I'm not sure where I should place the export COMPOSER_PROVIDERS='{.... information to continue the setup.
Any assistance, tips and tricks are much appreciated.
Ok so I figured it out. The problem was that I was running off an older version of composer-rest-server.
I installed the developer tool back in Sep 17 and did the tutorial soon after. I tried the tutorial again and noticed that the deployment command was different and it would not let me deploy my network.
So I updated the composer-rest-server and component cli and it deployed fine. I then followed the steps on the authentication webpage that I referenced above and it worked as intended. I deployed my personal network with the new command and it worked as intended.
Lesson learned this stuff is still being updated and I should be more aware on what changes. Thank you very much #nilakantha singh deo
Open a new terminal from inside the project folder.Format your COMPOSER_PROVIDERS in notepad according to the document you mentioned and copy the whole message and paste it in the terminal.Then you can echo it (see it) by typing the following.
echo $COMPOSER_PROVIDERS
It should ideally return the same json file.
Then make sure that the compopser-rest-server is running with multiuser mode and authentication enabled in the same terminal where you echoed and saw the COMPOSER_PROVIDERS.
In browser now type
localhost:3000/auth/github
It should ask for authentication .Rest of the steps are listed in the document you mentioned.
Cheers!

Sonar rest API insufficient privileges

I can't access most of the Sonar API, for example
localhost:9000/api/tests/show?key=htmlparser:/src/test/java/HtmlParserTest.java
or see api/sources/scm. api/server/system and some other general stuff works but nothing where I actually see the code.
I always get a
{"errors":[{"msg":"Insufficient privileges"}]}
I set the project permissions to let anyone see source code & browse the porject, I tried it with Postman, a Java HttpRequest, the command line ...
curl -u admin:admin localhost:9000/api/tests/show?key=htmlparser:/src/test/java/HtmlParserTest.java
I checked with SonarQube 5.1 and 4.5.1. I've found a posts with the same issue but have yet to find a fix. Does anyone have a solution idea?
Thanks for your help
SOLUTION
It was a syntax error (even though the message said Insufficient privileges). The correct call would be:
localhost:9000/api/tests/show?key=htmlparser:htmlparser:src/test/java/HtmlParserTest.java
If you are not sure what goes before the "src/..." don't worry. You can get it by calling api/projects/index and looking at the attribute named "k".

Twitter handler (sensu and ruby) troubleshooting

I'm trying to get Sensu twitter-handler working on my environment. The issue is that I'm not getting any errors on screen or logs when I cat a .json event into the twitter-handler and, the tweets are not being shown on the linked account.
Here're are my config files:
https://gist.github.com/Mariano-gon/8648427
https://gist.github.com/Mariano-gon/8648455
https://gist.github.com/Mariano-gon/8648489
This is the output I get:
https://gist.github.com/Mariano-gon/8648480
One important note is that in sensu-api.log the request are being recieved:
https://gist.github.com/Mariano-gon/8673758
So, my question is: is there a way to troubleshoot this issue? Any way to debug the handler.rb?
Thanks!
Finally got it working! Thing was the new 'twitter' gem (in my case v5.6) won't work with the code as it was written. I needed to follow this great answer and this thread too. Was just a matter of sintaxis (as usual).
Thanks!

Unable to upload files to AWS S3 buckets using CORS

I was just trying out the example which is specified in this blog, but I am getting this error "Could not contact signing script. Status = 404". I followed all the steps specified in the blog and also carefully changed the CORS configuration in AWS management Console too. I am not able to figure out the problem. Kindly help me out.
Here is the blog link http://www.ioncannon.net/programming/1539/direct-browser-uploading-amazon-s3-cors-fileapi-xhr2-and-signed-puts/
I faced the same problem you did trying to follow the example in this blog post. I wrote an article showing everything I had to do to make it work for me.
https://blog.pjam.me/posts/direct-upload-to-s3/
Hope it'll work for you.

Resources