Skip to main content

Posts

Showing posts from 2015

Oauth2 GET/POST request samples

Requesting an access token: curl -v -X POST \    -H "Content-Type: application/json" \    'http://localhost:8080/my-server/oauth/token?username=ercan&password=password&client_id=my-client-with-secret&client_secret=password&grant_type=client_credentials&scope=read' Refreshing a token: curl -v -X POST \    -H "Content-Type: application/json" \    -H "Authorization: Basic MzUzYjMwMmM0NDU3NGY1NjUwNDU2ODdlNTM0ZTdkNmE6Mjg2OTI0Njk3ZTYxNWE2NzJhNjQ2YTQ5MzU0NTY0NmM=" \    'http://localhost:8080/oauth2-provider/oauth/token?grant_type=refresh_token&refresh_token=ab06022f-247c-450a-a11e-2ffab116e3dc' curl -v -X GET \   -H "Accept: application/json" -H "Content-Type: application/json" \   -H "Authorization: Bearer 72d4a91d-7989-4d65-b52f-c788ecae87c2" \   'http://localhost:8080/my-server/sample/result' | json_reformat > output.json ==> Format xml output  (| json_reformat)...

How to acccess cloudera embbed db

$ sudo service cloudera-scm-server-db status # cat /etc/cloudera-scm-server/db.properties # cat /var/lib/cloudera-scm-server-db/data/generated_password.txt # psql -U cloudera-scm -p 7432 -h localhost -d postgres Enter password: postgres=# \l         Name                |       Owner           -------------------------+--------------------  amon                        | amon                hive                          | hive                nav ...

Self signed certificate configuration for WildFly server

# Create self signed certificate keytool -genkey -alias YourCertificateName -keyalg RSA -keystore YourCertificateName.jks -validity 9999 -keysize 2048 -storepass 123456 -keypass 123456 --dname "CN=ercan,OU=DevUnit,O=company.com,L=Istanbul,S=Istanbul,C=TR" # Delete certificate keytool -delete -alias YourCertificateName -keystore YourCertificateName.jks # list certificate keytool -list -keystore YourCertificateName.jks # Insert the following into your standalone.xml in the security-realms section. <security-realm name="ssl-realm">   <server-identities>        <ssl>            <keystore path="YourCertificateName.jks" relative-to="jboss.server.config.dir" keystore-password="123456" alias="YourCertificateName" key-password="123456" />        </ssl>    </server-identities> </security-realm> # Add the following line to the server section of the stan...

Installation Scala on Ubuntu 14.04

sudo apt-get remove scala-library scala sudo wget www.scala-lang.org/files/archive/scala-2.10.4.deb sudo dpkg -i scala-2.10.4.deb sudo apt-get update sudo apt-get install scala wget http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.12.4/sbt.deb sudo dpkg -i sbt.deb sudo apt-get update sudo apt-get install sbt