1 Download code
git clone https://github.com/Microsoft/cpprestsdk.git
2 Open solution in Visual Studio
cpprestsdk120.sln
Change from dynamic to static linking
Select All Configurations and All Platforms from the drop-downs at the top of the Properties dialog.
In Configuration Properties -> General -> Project Defaults, change the Configuration Type option to Static library (.lib).
In Configuration Properties -> C/C++ -> Code Generation, change the Runtime Library option to Multi-threaded Debug (/MTd) for the Debug configuration and Multi-threaded (/MT) for the Release configuration.
In Configuration Properties -> C/C++ -> Preprocessor for All Configurations, add the text _NO_ASYNCRTIMP; to the Preprocessor Definitions option. This prevents the compiler from trying to export the functions to a DLL.
Click OK to save the changes.
3: Prepare your application
Open the solution for the application you want to build, right-click on it and choose Properties.
Select All Configurations and All Platforms from the drop-downs at the top of the Properties dialog.
In Configuration Properties -> VC++ Directories, add a new entry in Include Directories as follows:
C:\PathToCppRESTSDK\Release\include
In Configuration Properties -> VC++ Directories, add a new entry in Library Directories as follows:
C:\PathToCppRESTSDK\Binaries\Win32\$(Configuration)
In Configuration Properties -> C/C++ -> Preprocessor, add the text _NO_ASYNCRTIMP; to the Preprocessor Definitions option. This prevents the compiler from trying to find the C++ REST SDK functions from a DLL.
In Configuration Properties -> Linker -> Input, add winhttp.lib , Bcrypt.lib, Crypt32.lib and cpprest120_2_3.lib (replacing the numbers with the correct Visual Studio and C++ REST SDK version numbers) to the Additional Dependencies option.
Build your project.
https://katyscode.wordpress.com/2014/04/01/how-to-statically-link-the-c-rest-sdk-casablanca/
Change is missing 2 library.
Tuesday, August 1, 2017
Tuesday, July 25, 2017
Mac os create group command line
list group.
list group.
dscacheutil -q group
sudo dseditgroup -o edit -a $username_to_add -t user admin
Mac group:
sudo dscl . -create
/Groups/groupname
sudo dscl . –create /Groups/groupname
name groupname
sudo dscl . –create /Groups/groupname
gid groupid
sudo dscl . –create /Groups/groupname
GroupMembership usershorname
list group members
dscacheutil -q group -a name
pam_idq
sudo dscl . –delete /Groups/groupname
GroupMemebership usershorname
sudo dscl . –delete /Groups/groupname
Friday, July 14, 2017
fiddler capture java application traffic
Create a keystore containing the fiddler certificate and use it:
keytool -importcert -file " fiddlerroot.cer" -keystore " fiddler.jks" -alias "fiddler"
java -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 -Dhttps.proxyPort=8888 -Dhttps.proxyHost=127.0.0.1 -Djavax.net.ssl.trustStore=<path to FiddlerKeystore> -Djavax.net.ssl.trustStorePassword=<password> -jar test.jar
If you use third party HTTP libraries, you need to set the connection proxies. Example with Apache Commons HttpClient:
HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setProxy("localhost", 8888);
keytool -importcert -file " fiddlerroot.cer" -keystore " fiddler.jks" -alias "fiddler"
java -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 -Dhttps.proxyPort=8888 -Dhttps.proxyHost=127.0.0.1 -Djavax.net.ssl.trustStore=<path to FiddlerKeystore> -Djavax.net.ssl.trustStorePassword=<password> -jar test.jar
If you use third party HTTP libraries, you need to set the connection proxies. Example with Apache Commons HttpClient:
HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setProxy("localhost", 8888);
Subscribe to:
Posts (Atom)