w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I make Jetty 9 ignore keypass while accesing keystore?
There are two passwords involved: the keystore password (KeyStorePassword) and the key password (KeyManagerPassword). For PKCS#12 store, they are the same. Since you've imported the key from the PKCS#12 store into the JKS store using the keystore's password, that doesn't mean that the password of the key itself was changed, and it's probably not "keypwd" (Jetty's default). Try to replace the value of KeyManagerPassword with your PKCS#12 store's password. (Note that in general, you don't need to convert the keystore, you could have used PKCS12 as the KeyStoreType.)

Categories : Ssl

Generate the .bat file that will copy the selected lines from the .bat file (within .bat file) to another text file
Use the lines as below Echo The land is beautiful >> %_file% echo I wanna stay here >> %_file% echo etc........ >> %_file% echo etc........ >> %_file%

Categories : Batch File

Generate a word document in the server's file system in PHP
PHPWord can do this: http://phpword.codeplex.com/releases/view/49543 I have tried Examples/BasicTable.php, it creates the file on the server and doesn't download it. Here's the code used: <?php require_once '../PHPWord.php'; // New Word Document $PHPWord = new PHPWord(); // New portrait section $section = $PHPWord->createSection(); // Add table $table = $section->addTable(); for($r = 1; $r <= 10; $r++) { // Loop through rows // Add row $table->addRow(); for($c = 1; $c <= 5; $c++) { // Loop through cells // Add Cell $table->addCell(1750)->addText("Row $r, Cell $c"); } } // Save File $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter->save('BasicTable.docx'); ?>

Categories : PHP

How to save QRCode image file I've just generate to server?
Just use a FileOutputStream to write the content of your ByteArrayOutputStream to. The same way you wrote that content to the response output stream. Write the file to some location available via HTTP (e.g. the document root of an apache installation, etc.) and you can refer to it from HTML. Another approach you could try would be to inline the image directly into your HTML code (new browsers support this via data URIs)

Categories : Java

Use keystore file to run client for a SOAP WS
An excellent blog to help you understand the keystores and certificates imports required for HTTPS SSL handshake: http://ruchirawageesha.blogspot.in/2010/07/how-to-create-clientserver-keystores.html Hope it helps you to setup ur client keystore correctly in order to call the web services. Good Luck!

Categories : Java

how to create a properties file for keystore?
When you create a Properties object using new Properties(), you don't have any data stored in that object yet. So it doesn't make sense to do properties.getProperty("PRIVATE") because that will always return null. You claim that you've made a .properties file, but I don't see you loading into the Properties object anywhere: properties.load(new FileInputStream(readerForProperties)); Whichever properties you've defined in the .properties file (see API documentation to find out how to create such a file) using a Reader that can read that file, will now be accessible using the getProperty() method. You are using the path variable to create a FileInputStream that is used to load a KeyStore. In that case, path needs to be the path to your key store. It seems as if you copy/pasted an exampl

Categories : Java

Is android debug.keystore file valid for 30 years
There is no predetermined limit for expiration of certificates. Granted, most certificated issued by certification authorities are only valid for 1 year (365 days), but it does not have to be the case. Most certification authorities have expiration dates for their own CA certificates that are valid for 25 and more years. If you are using self-signed certificate (which can be created using keytool or openssl), you can specify pretty much any expiration time. If we are talking about android debug.keystore, it most likely has some self-signed certificates which may default to 1 year expiration. What you have seen (expiration in 2042) was most likely Android Test CA certificate.

Categories : Android

How can I edit keystore File? expand expiry date of certificate?
The time you enter there is the expiry date in years. Google play store only allows you to use a certificate that is signed for AT LEAST 25 years. Check this link for more information: http://developer.android.com/tools/publishing/app-signing.html

Categories : Android

why Eclipse generate .class file if there is a syntax error in my java source file?
Because you can run and debug a class that has only been compiled partially, as long as you only move through the code parts which compiled without error. If your control flow comes to the place with the compilation error, an exception will happen at runtime. Just remember if you have ever changed code directly during debugging (hot code replacement): Many IDEs will even warn you that under some conditions you are partially removing existing code, but you still want to continue that exact same debugging session, so this feature is really needed.

Categories : Java

How can apportable build to generate a share object(.so) file instead of api file?
The apportable build process Creates an archive file of your app - lib{appname}.a Links it along with some system objects into an so - libverde.so Packages and zips libverde.so, other .so's and various Android resources into - {appname}.apk You can modify this process by changing the python scripts in ~/.apportable/SDK/site_scons

Categories : Misc

Vim c++ generate source file based on header file
Use the xptemplate plugin. Examples: http://www.derekwyatt.org/wp-content/uploads/2009/08/my.cpp.xpt.vim http://www.derekwyatt.org/vim/working-with-vim-and-cpp/cpp-snippets

Categories : C++

How do I generate my MD5 and SHA1 thumbprints using eclipse for debug keystore (Android)
get your sha1 and md5 thumbprint for debug keystore (also works for your other keystores). Go to you package exporler in eclipse (defaults to the left side) right click it>android tools>export signed application package Then navigate to your debug keystore normally in your .android folder and select it Then enter the password which is "android" with no quotes Next it will ask for an alias click the drop down list and select androiddebugkey and again, enter android as the password. Next if you scroll down it will show the MD5 and SHA1 thumb print if you scroll down then just cancel and use it how you want if you want your hash key just paste this under your onCreate REPLACE "com.you.name" to your application package name. PackageInfo info; try { info = getPackageMan

Categories : Android

Jetty Maven plugin - Put properties file in classpath
It was just a matter of configuration of the maven plugin <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <jettyXml>jetty/jetty.xml</jettyXml> <webApp> <extraClasspath>${basedir}/jetty/classpath</extraClasspath> </webApp> </configuration> to add a classpath folder to Jetty, it needs the extraClasspath folder in the webApp tag.

Categories : Misc

Run-Jetty-Run (RJR) with Jetty 8 and Servlet 3.0 scanns all JAR files ignoring WebInfIncludeJarPattern in jetty-web.xml
Here is a workaround for speeding up Jetty 8 with Servlet 3.x. Create a file (jetty.xml) Open the RJR configuration Click on "Show advanced options" Additional Jetty.xml: The file (jetty.xml) must have these lines: <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Get name="handler"> <Call name="setAttribute"> <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> <Arg>.*/mwa-web-.*.jar$</Arg> </Call> </Get> </Configure> Here, I'm telling Jetty that any file starting with mwa-web-* should be scanned for Servlet 3.x.

Categories : Eclipse

Use make file to generate database from .sql file
Use sqlite3_exec to run your sql file at runtime in your app. Of course you only want to do it once. You need to use sqlite2_open_v2 to open a new database file first, then execute the sql file. If you want to generate the database file in Xcode during a build, you can do this after some setup. I do this in one of my projects. Start by selecting your target in Xcode and going to the "Build Phases" tab. Then click on the "Add Build Phase" button and select "Add Run Script". Double-click on the "Run Script" title and rename it to something useful such as "Generate db file". Change the "shell" value to "/bin/bash". Use the following for the script: cd database if [ create.sql -nt data.db ]; then rm -rf empty.db fi if [ ! -e data.db ]; then sqlite3 data.db < create.sql fi cd -

Categories : IOS

Generate Jetty MD5 Password without Java
The class that does the lifting is here: http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-util/src/main/java/org/eclipse/jetty/util/security/Password.java

Categories : Java

Android: Sending file to server : PHP receive that file in server
I hope it will work // the file to be posted String textFile = Environment.getExternalStorageDirectory() + "/sample.txt"; Log.v(TAG, "textFile: " + textFile); // the URL where the file will be posted String postReceiverUrl = "http://yourdomain.com/post_data_receiver.php"; Log.v(TAG, "postURL: " + postReceiverUrl); // new HttpClient HttpClient httpClient = new DefaultHttpClient(); // post header HttpPost httpPost = new HttpPost(postReceiverUrl); File file = new File(textFile); FileBody fileBody = new FileBody(file); MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); reqEntity.addPart("file", fileBody); httpPost.setEntity(reqEntity); // execute HTTP post request HttpResponse response = httpClient.execute(httpPost); HttpEntity resEntity = respo

Categories : PHP

jarsigner error: keystore load: Invalid keystore format
I guess you need to specify the keystore format because the default is normally jks. Please try to add <storetype>pkcs12</storetype> to your maven configuration. If this did not help try to have look into your cert with: keytool -list -v -storetype pkcs12 -storepass **** -keystore src/main/resources/Cert.pfx If this did not work maybe something is wrong with the certificate like strange special chars.

Categories : Maven

Anyway to change Keystore or Keystore's Info on android without publish new app
Unfortunately, there is no way to change your certificate for a published app, you have to re-publish to do that. It is explained here.

Categories : Android

How to generate a xml or json mapping from xls file and then generate html table(structure) from that mapping?
So you can use: Apache POI for reading the file Jackson for writing a JSON file They are both mainstream and easy to use.

Categories : Java

My swf file in my web server can not load json file from another server
This is a security feature implemented by the Flash runtime. Cross-domain policy for Flash movies For security reasons, a Macromedia Flash movie playing in a web browser is not allowed to access data that resides outside the exact web domain from which the SWF originated. When you run locally, your SWF is executing in Flash Projector; therefore, operates differently than when embedded from your site. On the site you wish to connect, create a crossdomain.xml file, as in: http://example.com/crossdomain.xml Within that crossdomain.xml, add parameters, such as: <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="all"/>

Categories : Actionscript

Is there a way to determine the version of a file hosted on an HTTP server without downloading the entire file?
You can either: send the server a HEAD request and look at the response's Last-Modified and/or ETag header(s). If you are downloading the file for the first time, or if the header value(s) do not match what you have saved from a previous download, then send the server a GET command to download the latest file and save the new header value(s) for next time. If you have already downloaded the file once before, you can send the server a "conditional" GET request without sending a HEAD request first. To make the request "conitional, either: a. Include a If-Modified-Since header containing the value of the Last-Modified header from the previous download. b. Include a If-Match header containing the value of the ETag header from the previous download. In a "conditional" GET request, if the

Categories : C++

Extract content of Zip file after reading Zip file from Exchange server through JavaMail
Where do you extract the zip file? If it's in the same directory as your project, you can simply use relative path. Example: ZipFile a = new ZipeFile("zipefile.zip"); If you created a separate folder within the project directory, ZipeFile a = new ZipFile("filename/zipfile.zip");

Categories : Java

how to show a file chooser dialog in GWT with server-side file system?
GWT does not have an out-of-the-box widget+servlet doing that, and I dont know any 3party library doing that (but maybe you have some success searching in the web). So you have to create a service in server side to provide the info (folders and files list). In client side I would use a CellTree which is very appropriate to display a filesystem structure.

Categories : Gwt

How do I Transfer values from one Javascript file to another JS file without the need of server interaction nor cookies?
You can use HTML5 localStorage. The localStorage saves your data into the web browser. The difference with $_COOKIE is that data is accessible only via web browser with javascript and they are not sent in every HTTP request. Here is a link with examples.

Categories : Javascript

CFFILE not reading a file that's been manipulated by server's batch file?
By default, cfexecute fires off the process, but does not wait for it to finish. So you may be trying to read the file before it is updated. Add a timeout to your cfexecute call and it should fix the problem. timeout - Length of time, in seconds, that ColdFusion waits for output from the spawned program. 0 (default): equivalent to nonblocking mode. A very high value: equivalent to blocking mode.

Categories : Batch File

how to delete a file on the server and add a new file based on clients choice
Not the answer, but not suitable for a comment: if (file_exists("SIMxml/" . $_FILES["file"]["name"])){ Here you use a relative path, but if your script EVER changes its current working directory, you'll end up with no end of trouble because elsewhere: move_uploaded_file($_FILES["file"]["tmp_name"], "/var/www/jd/SIMxml/" . ... and unlink("/var/www/jd/SIMxml/" . $file); you use absolute paths. Not a good idea.

Categories : PHP

File in use by another process error when uploading a file using server but not localhost
maxRequestLength is specified in KB but requestLengthDiskThreshold specifies the limit for the input stream buffering threshold, in bytes. Therefore you need to change requestLengthDiskThreshold to 543744 (531KB x 1024) Also check any of the following settings that apply to your scenario <httpRuntime executionTimeout = "HH:MM:SS" maxRequestLength = "number" requestLengthDiskThreshold = "number" useFullyQualifiedRedirectUrl = "[True|False]" minFreeThreads = "number" minLocalRequestFreeThreads = "number" appRequestQueueLimit = "number" enableKernelOutputCache = "[True|False]" enableVersionHeader = "[True|False]" apartmentThreading = "[True|False]" requireRootedSaveAsPath = "[True|False]" enable = "[True|False]" sendCacheControlHeader = "[

Categories : C#

How to send mails by attaching a file (file should be taken from Sql Server Database)
Go through the bellow link http://www.c-sharpcorner.com/uploadfile/rahul4_saxena/send-email-in-Asp-Net-with-attached-file/ and http://www.codeproject.com/Articles/10828/Sending-Email-with-attachment-in-ASP-NET-using-SMT might help you..

Categories : Asp Net

Passing variables between batch file and .sql file for mssql server
sqlcmd with the -v command line -v var = "value" You can specify multiple variables in the list. See: http://msdn.microsoft.com/en-us/library/ms162773.aspx and http://msdn.microsoft.com/en-us/library/ms188714.aspx

Categories : SQL

Remote file access from PHP server side gives 301 instead of file, what to do?
HTTP Response Code 301 is a permanent redirect, not an error. Your code will have to follow that redirect in order to access the resource. For example, http://google.com/ returns a 301 in order to redirect users to http://www.google.com/ instead. $ curl -I http://google.com/ HTTP/1.1 301 Moved Permanently Location: http://www.google.com/ Content-Type: text/html; charset=UTF-8 Date: Sun, 11 Aug 2013 01:25:34 GMT Expires: Tue, 10 Sep 2013 01:25:34 GMT Cache-Control: public, max-age=2592000 Server: gws Content-Length: 219 X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN Alternate-Protocol: 80:quic You can see the 301 response on line 2, followed by the Location header which tells the web browser where to go instead. What likely happened was that during this major overhaul, th

Categories : PHP

File not found with .htaccess file on Apache server
I finally solved it but in a way that I am not sure I like. At least it works. If someone has a better solution I would be glad to see it. RewriteRule ^login/([0-9]+)/([0-9]+)$ http://host/webserv/login.php?par1=$1&par2=$2 The reason I don't like this solution is because I does not give a pretty url. It just redirects. I still do not understand why I get the root directory appended to the request if I instead write: RewriteRule ^login/([0-9]+)/([0-9]+)$ login.php?par1=$1&par2=$2

Categories : PHP

How jetty server can be integrated with apache server?
Yes, of course. Jetty is a servlet container similar to tomcat. There are instructions here: http://wiki.eclipse.org/Jetty/Tutorial/Apache#Configuring_Apache

Categories : Java

SQL Server : export from file.sql to a flat file
In SSMS go to Tools -> Options -> Query Results -> SQL Server -> Results to Text On this pane choose Output format: Customer delimiter, and enter '|' Return to your query and select Query -> Results to File (Ctrl+Shift+F) Execute your query, you will be asked to select the file path and name File will be saved with a .rpt extension, you can alter it to .txt

Categories : SQL

Batch file to identify 0 from a txt file which contain file name(e.g.ABCDE01)and trigger message display that 0 found together with the file name/path
Assuming format is always 0.0000, this should do it: @echo off find "0.0000" <"C:UsersUserDesktopoutcome.txt" >nul && echo ERROR:FOUND ZERO SIZE IN THE FILE!!! & pause

Categories : Batch File

Generate an xml file using DOM
Seen as you basically have every thing you need to get started, I'm only going to focus on the basics of generating a XML document and populating it with data... This example will output the result to String which I display, but you can supplement it with any OutputStream you need import java.io.ByteArrayOutputStream; import java.io.IOException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document; import org

Categories : Java

TCPDF - How to generate a TTF file from PHP?
I found the solution and record the process in my blog post below: http://alucard-blog.blogspot.hk/2013/06/tcpdf-how-to-display-chinese-character.html The key point is: I found the font that can display Traditional and Simplified Chinese.

Categories : Misc

Generate PDF file in an appropriate format
Your MIME type is incorrect for PDF. It should be application/pdf. Change response.setContentType("text/pdf"); to response.setContentType("application/pdf"); See http://tools.ietf.org/html/rfc3778 for the RFC for the PDF MIME type. Edit: Totally overlooked the "Save as .pdf" question. You'll also need to add something like: response.setHeader("content-disposition", "attachment; filename=yourFileName.pdf"); to tell the browser what the default file name should be.

Categories : Java

What can I use to generate a local XML file?
The Nokogiri gem has a nice interface for creating XML from scratch. It's powerful while still easy to use. It's my preference: require 'nokogiri' builder = Nokogiri::XML::Builder.new do |xml| xml.root { xml.products { xml.widget { xml.id_ "10" xml.name "Awesome widget" } } } end puts builder.to_xml Will output: <?xml version="1.0"?> <root> <products> <widget> <id>10</id> <name>Awesome widget</name> </widget> </products> </root> Also, Ox does this too. Here's a sample from the documenation: require 'ox' doc = Ox::Document.new(:version => '1.0') top = Ox::Element.new('top') top[:name] = 'sample' doc << top mid = Ox::Element.new('middle') mid[:

Categories : Ruby On Rails

How to generate .dll file with cmake?
I will make it as a response, not in comment. You problem here is that you are not compiling your solution, you are just generating it... It seems that you can build your project with the command line : cmake --build <dir> [options] [-- [native-options]] <dir> = Project binary directory to be built. --target <tgt> = Build <tgt> instead of default targets. --config <cfg> = For multi-configuration tools, choose <cfg>. --clean-first = Build target 'clean' first, then build. (To clean only, use --target 'clean'.) --use-stderr = Don't merge stdout/stderr. -- = Pass remaining options to the native tool But I didn't try it...

Categories : Windows



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.