Search This Blog

Sunday, November 27, 2016

Query NodeChef MongoDB

Query NodeChef DB

Get the connection string from chef
E.g.
mongodb://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxx-xx


Download mongo client

E.g. for windows

Install it
In the connection copy the url to this windows in the application


Save your changes.
Click connect to this url after.
Edit the settings in case you need to - e.g. for max fetch size the default is 3 M - i changed it to 10M.


Save your changes.

In the left pane double click on the installation table.
A list of query type.
E.g. find --- to find rows
Count - to get the total.

To use query , you need to use special syntax - you can read on the syntax here


E.g to get count of codeVersion greater than 253
Selector = {codeVersion:{$gt:253}}

Monday, September 5, 2016

How to call C++ code from Managed, and vice versa


An Overview of Managed/Unmanaged Code Interoperability

How to call a managed DLL from native Visual C++ code in Visual Studio.NET or in Visual Studio 2005

Call C# code from C++ and read an array of struct which contains strings

http://www.codeproject.com/Articles/12673/Calling-Managed-NET-C-COM-Objects-from-Unmanaged-C


How to call C++ code from Managed, and vice versa (Interop) – deeptanshuv's WebLog:






How to call C++ code from Managed, and vice versa


An Overview of Managed/Unmanaged Code Interoperability

How to call a managed DLL from native Visual C++ code in Visual Studio.NET or in Visual Studio 2005

Call C# code from C++ and read an array of struct which contains strings

http://www.codeproject.com/Articles/12673/Calling-Managed-NET-C-COM-Objects-from-Unmanaged-C


How to call C++ code from Managed, and vice versa (Interop) – deeptanshuv's WebLog:






How to call C++ code from Managed, and vice versa


An Overview of Managed/Unmanaged Code Interoperability

How to call a managed DLL from native Visual C++ code in Visual Studio.NET or in Visual Studio 2005

Call C# code from C++ and read an array of struct which contains strings

http://www.codeproject.com/Articles/12673/Calling-Managed-NET-C-COM-Objects-from-Unmanaged-C


How to call C++ code from Managed, and vice versa (Interop) – deeptanshuv's WebLog:

5 Tips for Understanding Managed-Unmanaged Interoperability in .NET

Safearray and com c# dll from c++








Monday, August 29, 2016

HOW to Redirect from batch file using START commnd

in case you want to redirect the output from batch file and you do use START command , and you want to redirect the output from the start command, here is the way

in YELLOW you can find the trick

start cmd /c myexe.exe -p1 param1 -p2 param2 ^> c:\temp\5.txt

enjoy
Yaniv Tzanany

Sunday, June 5, 2016

Find out which keystore was used to sign an app

the simple answer is to compare the signature

here is how to compare APK signature with the keystore you have

android - How do I find out which keystore was used to sign an app? - Stack Overflow:


Find out which keystore was used to sign an app

the simple answer is to compare the signature

here is how to compare APK signature with the keystore you have

android - How do I find out which keystore was used to sign an app? - Stack Overflow:

check out this thread as well
The apk must be signed with the same certificates as the previous version



Thursday, May 5, 2016

Oracle on linux configurtion

we find out huge differences when retrieving huge amount of data from oracle , when it was installed on linux and on windows ( the windows was allot faster)

DBA:
 check the next articles and compare/add/fix the values that suggested by oracle for Linux  - you might find there what we are looking for https://docs.oracle.com/database/121/LTDQI/toc.htm#BHCCADGD
Have a look at this article http://www.dba-oracle.com/art_builder_tns.htm - there are some critical parameters to check (tcp.nodelay = yes ?????).

IT:
I suggest to improve the kernel for all our application server RedHat + zLinux with the necessary changes for best throughput , concentrate with the Network tuning
There are allot of resources how to improve it if you didn’t    (specially net.core.rmem_max , net.core.wmem_max)



enjoy 
Yaniv 

Wednesday, April 6, 2016

sqlcmd - command line to run sql scripts (batch mode)

sometimes the best option to get fast result is to use an exisitng queries tools, many option include formatting for csv files.



Use sqlcmd with Scripting Variables:

sqlcmd Utility




Saturday, March 12, 2016

Android - access gmail account - less secure app

the app i devlop needed to access gmail account to send and read emails.
i need to set my gmail account to allow access to less secure app.
e.g. https://www.google.com/settings/security/lesssecureapps

google change the security issue as you can read here
https://security.googleblog.com/2014/04/new-security-measures-will-affect-older.html

to allow access to gmail account without any "less secure " prompt issue, you might need to use OAUTH2 access to imap & SMTP.
to do that use , javamail 1.5.5 from
https://java.net/projects/javamail/pages/Android.

sample code could be found here
https://github.com/darrenjl/EmailYourself/blob/master/android/EmailYourself/src/me/darrenlyons/emailyourself/email/GmailSender.java

and here OAuth flow using the AccountManager on Android


from Android SDK Authenticating to OAuth2 Services

NEW 03-2019

Java Mail API Using GMAIL OAuth API In Android


Sunday, February 28, 2016

Websphere SSL - invalid certificate, key identifier is missing from authority key identifier extension

when you tried to access to secured WebService from your Websphere application , and get such error ":org.apache.axis2.AxisFault: 
javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.g:PKIX path building failed: java.security.cert.CertPathBuilderException: invalid certificate, key identifier is missing from authority key identifier extension"

you probably need to install the certificate in your web sphere

To establish trusted server-to-server communication for IBM Connections, import signer certificates from IBM HTTP Server into the WebSphere Application Server default trust store.
There are different types of certificates that you can use. This procedure describes how to import a self-signed certificate. You can also import a certificate that you purchased from a third-party Certificate Authority. To help decide a key file strategy for your environment, go the IBM HTTP Server knowledge center.
To import a public certificate from IBM HTTP Server to the default trust store in IBM WebSphere Application Server, complete the following steps:

Procedure

  1. Log into the IBM WebSphere Application Server Integrated Solutions Console and select Security > SSL Certificate and key management > Key stores and certificates.
  2. Click CellDefaultTrustStore.
  3. Click Signer Certificates.
  4. Click Retrieve from port.
  5. Enter the Host name, SSL Port, and Alias of the web server. The Alias is typically an arbitrary string that will become the name of the credentials.
  6. Click Retrieve Signer Information and then click OK. The root certificate is added to the list of signer certificates.
  7. If using Tivoli® Access Manager or other proxies, also repeat steps 4-6 for your Tivoli Access Manager or other proxy servers.
  8. restart server.

there is another way :

Procedure


export the certificate :
navigate to the url via browser , in the browser click on the certificate , and export it in DER format or base64 format.
save it in accessible path.
  1. Log into the IBM WebSphere Application Server Integrated Solutions Console and select Security > SSL Certificate and key management > Key stores and certificates.
  2. Click NodeDefaultTrustStore.
  3. Click Signer Certificates.
  4. Click Add.
  5. Enter the Alias of the web server. The Alias is typically an arbitrary string that will become the name of the credentials, and the exported certificate location- described above, choose the right dataType  (DER format or Base64).
  6. Then click OK. The root certificate is added to the list of signer certificates.
  7. restart server.

TRACE HTTP communication on WebSphere

Problem determination: Debugging HTTP communication using Tracing, HTTP error, and NCSA access log settings | WebSphere .



good article

Saturday, February 27, 2016

Parse alternative backend service providers + Push issue

GitHub - relatedcode/ParseAlternatives: A collaborative list of Parse alternative backend service providers.:


Migrate from Parse to NodeChef’s Managed Parse Server



Azure welcomes Parse developers  - i could not migarate my db :(



i choose NodeChef - very easy to migrate and all is working.
the steps i did:

  • upgrade my app to the latest parse SDK.
  • Create in google api console server key + enabled GCM 

and boom the push is working

enjoy 
Yaniv Tzanany







Wednesday, February 17, 2016

OData Services - CodeProject

OData Services - CodeProject:

OData URL sample

http://hldt-yanivt/YanivTZServices/AlisDataService.svc

http://hldt-yanivt/YanivTZServices/AlisDataService.svc/$metadata

//all data
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries?$format=json

//all id and name
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries?$select=country_id,country_name&$format=json

//name and id for pk=1
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries(1)?$select=country_id,country_name&$format=json

//Filter by name
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries?$select=country_id,country_name&$format=json&$filter=(country_name eq 'Israel')

//Filter by id
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries?$select=country_id,country_name&$format=json&$filter=(country_id eq 1)

//count
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries/$count

//order by
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries?$select=country_id,country_name&$format=json&$orderby=country_name desc


//Insert recort
http://hldt-yanivt/YanivTZServices/AlisDataService.svc/t_countries?$format=json
POST
{
                "_id": 997,
                "_name": "Unknown997",
                "_abbreviation": null,
                "_cee": 0,
                "ent": 0,
                "iban_length": null
}

Saturday, February 13, 2016

gmail smtp access from shared hosting

i get error in my code
"The SMTP server requires a secure connection or the client was not authenticated"
i used valid uid  and password for gmail account + SSL enabled   but still get it.

so i figure out that there is two secire links i needed to use:

enable Less Secure app 

and accout access enebled 

and its worked.

enjoy
yaniv tzanany

Wednesday, January 13, 2016

Bootswatch: Free themes for Bootstrap

Bootswatch: Free themes for Bootstrap:

From MS acdemy building-responsive-ui-with-bootstrap  or full video
bootstrap with MVC  - good tutorial , the code sample are here BootstrapMVA

must code snippets - add it via NUGET

bootstrap-snippets-visual-studio 



Html Bootstrap many code sample @  bootsnipp 

Tools for VS2013
SideWaffle Templates for Visual Studio 2012/2013/2015
Bootstrap Bundle - to create new bootstrap site many templates

enjoy 
Yaniv Tzanany