w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Can I use Amazon Elastic Transcoder to only create thumbnails?
No. There are no functions for creating only thumbnails. It also is not possible to create a new transcoding job without actually transcoding anything. The input parameters require, at minimum, the name of an input video. The output parameters require, at minimum, the name of the output file and a preset ID. Parameters are checked prior to starting the job, and there are no options which would prevent the job from executing while creating a thumbnail. You can read about all of the available functions here: http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html Give ffmpeg a look. It can be a little bit of a hassle to install, but it can create thumbnails from videos.

Categories : Ruby On Rails

Copying/using Python files from S3 to Amazon Elastic MapReduce at bootstrap time
If you are using boto, I recommend packaging all your Python files in an archive (.tar.gz format) and then using the cacheArchive directive in Hadoop/EMR to access it. This is what I do: Put all necessary Python files in a sub-directory, say, "required/" and test it locally. Create an archive of this: cd required && tar czvf required.tgz * Upload this archive to S3: s3cmd put required.tgz s3://yourBucket/required.tgz Add this command-line option to your steps: -cacheArchive s3://yourBucket/required.tgz#required The last step will ensure that your archive file containing Python code will be in the same directory format as in your local dev machine. To actually do step #4 in boto, here is the code: step = StreamingStep(name=jobName, mapper='...', reducer='...', ... cac

Categories : Amazon

Unable to connect to MySQL Amazon RDS from Java app on Elastic Beanstalk, java.sql.SQLException: No suitable driver
The issue was that Elastic Beanstalk was adding quotes around the JDBC_CONNECTION_STRING environment variable that I was passing in. The issue and solution is described in this thread: https://forums.aws.amazon.com/thread.jspa?threadID=115043 (Adding the following to my .ebextensions config fixed the issue): commands: patch_tomcat: command: sed -i.bak s#"/usr/sbin/tomcat7"#"/usr/sbin/tomcat7-elasticbeanstalk"#g /etc/init.d/tomcat7

Categories : Java

How do I access servlets after deploying to AWS Elastic Beanstalk?
Actually I think you don't need to export your project to a .war file. Are you using Eclipse IDE? Because I could deploy my web application easily through eclipse. Here is the reference link Suggestion: Use Java 1.6 version for you web application. I think EB support JAVA 1.6 pretty good, while I'm not sure whether it works for Java 1.7. Because while I use JAVA 1.7 it works well locally, but I cannot deploy that version on EB.

Categories : Java

Set thrift output directory without Java style directory structure
You can customize this in the thrift file by using the namespace function: namespace java com.example.plot.gen namespace rb foo Now for files for Ruby will be in: - (out directory) -foo - my generated files

Categories : Dotnet

What errors do I have in my php code to create a new directory and then save a file in that new directory
Compare, what you assign to $dirStructure and $file. You can notice lack of leading / in fopen parameter. Nevertheless, echo('folderName/'.$trimmedInputA.'/'.$trimmedInputA.$inputB.$inputC.$inputD.'.csv'); would certainly help you to debug.

Categories : PHP

Android unable to create new directory on external storage
File.mkdir() will only create the directory if its parent exists. In this case, the directory you want to create is "videos" and its parent is "NewFolder". "videos" will not be created if "NewFolder" does not exist. If you want to create both directories at once, you should use File.mkdirs() instead.

Categories : Java

How to save , read and write files in android in external storage?
Please read the Android documentation regarding External Storage. Pay attention to the getExternalFilesDir(). You can retrieve the path to the external storage using this method. When you have the path, you can use the File object to create the data folder on the external storage like this: File dataDirectory = new File(getExternalFilesDir() + "/data/"); Then create the folder by applying the mkdirs()-method on the File object: dataDirectory.mkdirs(); To write to external storage, you will indeed have to declare this in the manifest: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Categories : Java

A client error occurred: Could not create storage directory: /tmp/Google_Client/00
I was having a similar issue. I am on a shared hosting. I was working on youtube api which was asking me to create Google_Client folder under the main mp on the server. Due to restriction that was not happening so I went into the google-api-php-client/src/conifg.php and changed the following line. /***********************************Shared server therefore cannot write to server's /tmp drive therefore using an alternate location*************************************************/ //'ioFileCache_directory' => (function_exists('sys_get_temp_dir') ? sys_get_temp_dir().'/Google_Client' : '/tmp/Google_Client'), 'ioFileCache_directory' => 'tmp/Google_Client', Then I created a tmp directory under google-api-php-client/src Then I created a Google_Client directory under go

Categories : PHP

Maven : copy directory structure without the files
You can use the maven-resource-plugin for such purposes like this: <project> ... <build> <plugins> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <executions> <execution> <id>copy-resources</id> <!-- here the phase you need --> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/target/extra-resources</outputDirectory> <resources> <resource> <directo

Categories : Maven

How to jar files in maven whose directory structure is not similar to sourceDirectory?
Maven uses different folders for source and other files (so called ressources). From srcmainjava it compiles all .java files and packages the resulting .class files into the jar. All other files in that directory are getting ignored to my knowledge. Now if you want other files to be packaged too, put them in srcmain esources instead. EDIT To manually specify a resource directory add <resources> <resource> <directory>D:Windchill_MarketERP ConnectorSourceCodeBuildsrc1srcmain esource</directory> </resource> </resources> to your <build> section

Categories : Maven

Create a svn branch from git when directory structure differs
Okay, so I changed .git/config from: [svn-remote "svn"] url = svn://host/path/to/repo/PROJECT/trunk fetch = trunk:refs/remotes/git-svn to: [svn-remote "svn"] url = svn://host/path/to/repo/PROJECT fetch = trunk:refs/remotes/git-svn branches = branches/*:refs/remotes/* This worked, but I ran into problems trying to access the branch from a git repo on another machine. In the end, I pushed my changes to svn, then deleted my local git repo and cloned it properly this time: $ git svn clone --standard-layout --prefix=svn/ svn://host/path/to/repo/PROJECT

Categories : Misc

Java Directory Structure
-d classes command line switch tells the compiler to store compiled code in classes folder. See documentation of javac: -d directory Set the destination directory for class files. The destination directory must already exist; javac will not create the destination directory. If a class is part of a package, javac puts the class file in a subdirectory reflecting the package name, creating directories as needed. For example, if you specify -d /home/myclasses and the class is called com.mypackage.MyClass, then the class file is called /home/myclasses/com/mypackage/MyClass.class. If -d is not specified, javac puts the class file in the same directory as the source file.

Categories : Java

Basic Grunt.js usage: How to create the correct directory structure
For those interested, I found the answer here: https://github.com/gruntjs/grunt-contrib-copy. You need to use the CWD to set the base dir: expand: true, cwd: 'dev/', src: ['img/*'], dest: 'dist/img/', flatten: true, filter: 'isFile',

Categories : Javascript

Why can't I save files to my iOS apps /Documents directory?
You're calling [self.filePath writeToFile:], thus writing the contents of the filePath variable to a file. You should do something like: [contents writeToFile:...]

Categories : IOS

How to configure grunt-contrib-uglify to minify files while retaining directory structure
Set the flatten property to false. There is a clear explanation on the grunt copy github readme https://github.com/gruntjs/grunt-contrib-copy Excerpt: $ grunt copy Running "copy:main" (copy) task Created 1 directories, copied 1 files Done, without errors. $ tree -I node_modules . ├── Gruntfile.js ├── dest │ └── src │ ├── a │ └── subdir └── src ├── a └── subdir └── b 5 directories, 4 files Flattening the filepath output: copy: { main: { expand: true, cwd: 'src/', src: '**', dest: 'dest/', flatten: true, filter: 'isFile', }, }, $ grunt copy Running "copy:main" (copy) task Copied 2 files Done, without errors. $ tree -I node_modules . ├── Gruntfile.js ├──

Categories : Javascript

Copy-item Files in Folders and subfolders in the same directory structure of source server using Powershell
This can be done just using Copy-Item. No need to use Get-Childitem. I think you are just overthinking it. Copy-Item -Path C:MyFolder -Destination \ServerMyFolder -recurse -Force I just tested it and it worked for me.

Categories : Powershell

Traversing subdirectories & create simillar directory structure to process each file in sub directories
You might try something like this: @echo off for /r "c:adt_folder_root" %%a in (*.adt) do "C:Program FilesABC Amber Advantage Converterabcadv.exe" "%%a" "%%~dpna.csv" 0 The /r switch will traverse the folder structure starting from the folder specified.

Categories : Windows

Java Script get data from server (asp.net) and save it in local storage (client side)
You are trying to throw in an object into localStorage Change localStorage.setObject("teamworkGantDemo", prj); to localStorage.setItem("teamworkGantDemo", JSON.stringify(prj)); or simply localStorage["teamworkGantDemo"] = JSON.stringify(prj) But if you are insistent on using a wrapper around this, you could do this : Storage.prototype.setObject = function(key, value) { this.setItem(key, JSON.stringify(value)); } Storage.prototype.getObject = function(key) { return JSON.parse(this.getItem(key)); } Then use it this way : localStorage.setObject("teamworkGantDemo", prj);

Categories : Javascript

Watching a Directory and sub directory for create, modify and Changes in java
So what you want is listing the files/subdirectories within a directory? You can use: File dir = new File("c:/java/newfolder/"); File[] files = dir.listFiles(); listFiles() gives you the Files in a directory or null it it's not a directory. Then you can do: for (File file: files){ if (file.listFiles != null){ //It's a subdirectory File [] subdirFiles = file.listfiles; } }

Categories : Java

Setting up Amazon Elastic Beanstalk app under VPC
This is almost certainly an issue with not being able to communicate with the NAT. The documentation is a little ambiguous when it comes to configuring your .ebextensions config files. Don't mess with the Network ACLs for the VPC. The infrastructure needs to be able to talk to itself. The NAT instance & Beanstalk ELB need to be in the Public subnet ( The Beanstalk instances themselves need to be in the Private subnet ( The Security Group that you apply to the instances needs to also apply to the NAT. That Security Group also needs to be on its own Inbound list so that everything inside that SG can talk to each other. Using curl, try to make outbound calls. First on the Bastion Host, then on the NAT, then on a Beanstalk instance. Are any of them unable to make

Categories : Amazon

Psycopg2 on Amazon Elastic Beanstalk
Need postgresql-devel in your container. Create a file '.ebextensions/packages.config' with the contents: packages: yum: postgresql94-devel: [] Replace 94 in postgresql94-devel with whatever version of postgres you need. For example, postgresql93-devel for postgres 9.3. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages

Categories : Python

is there any kind of Web storage viable for storage of video game save data?
The storage type relies on the characteristics of the data. If you want to store small amount of data in key-value standards, you can use Key-Value Sets. If you want to store structured data, you should consider to use a SQLite Database. You can also use the Internal Storage to keep files. Since you want an approach more user-proof, I prefer the SQLite approach. Be aware that no method is 100% guaranteed, since rooted phones can grant access to physical data. At least, consider to encrypt sensitive data before sending to the database. You also have the option of hosting a web service that is consumed by the app to gather information. It can be a lot safer, it is easier to be accessed by all instances of the application, but introduces internet dependecy. Hope it helps.

Categories : HTML

Installing Worklight Server v506 with Oracle and Liberty does not create the expected directory structure
When you install Worklight Server 5.0.6.x on Windows 7/8, with administrator permissions, and make the application server choice "Install WebSphere Application Server Liberty Profile", a directory C:ProgramDataIBMWorklightWAS85liberty-server will be created. It will contain the data portion of a WebSphere Application Server Liberty Profile installation; the program portion is under <WORKLIGHT_INSTALL_DIR>/server. Possible reasons why the directory is not there: If you are on Windows XP, the expected location is at C:Documents and SettingsAll UsersApplication DataIBMWorklightWAS85liberty-server. If you made the choice "Use a pre-installed application server", Worklight Server will not create an application server by itself, but instead use the one you indicated. If you don't have a

Categories : Oracle

Socket Server in Amazon Elastic Beanstalk
I think, I got this covered. However, I couldn't deploy the Windows Service without errors stand-alone, but only as part of a Web application. Not a real problem in my scenario, though. I have two projects for this scenario; a Web Application and a Windows Service application. On the build server, I create a ZIP file of the Windows Service executables (using zip.exe) On the build server, I upload the ZIP file to an S3 bucket (using s3.exe) On the project of the web application, I create a .ebextensions directory In the .ebextensions directory, I have a whatever.config file that Takes the ZIP file from S3 and unpacks it onto the C-Drive in my preferred directory Calls a batch file (part of the ZIP file) that uninstalls and reinstalls the Windows Service with the InstallUtil.exe utility

Categories : C#

Webdriver, PhantomJS and Amazon Elastic Mapreduce
EMR runs fairly standard AMIs, so this should not be too difficult. If you install dependencies in a bootstrap action, any changes you made to this system will stay until you stop the jobflow. There is no way to use your own AMI with EMR. The recommended way to install software on the cluster is using a bootstrap action.

Categories : Amazon

Configuring Amazon Elastic Beanstalk with PostGIS
If you want to use geodjango with Amazon Elastic Beanstalk you need to create a custom AMI where you can install PostGIS and then point your Elastic Beanstalk Application to that AMI when spinning up. Here is a good tutorial on how to customize an EBS AMI. There is also an AWS tutorial for that but I found the first one easier to understand. On my custom AMI I installed geos, gdal, proj4 and postgis from source, and postgres using yum install postgres. Below are the commands i used to install all libraries into the AMI. For the django app to find the libraries, I also set an additional environmental variable in the AWS EBS Console. In the menubar of my environment, I went to configuration --> software configuration and edited the Environment Properties by adding the property LD_LIBRARY_P

Categories : Amazon

Eclipse java project where directory structrure != package structure
This is not possible in Java, the runtime system always looks for a/b/c as directory structure for a specific class in package a.b.c. See http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.4

Categories : Java

VB.Net - List files & subfolders from a specified Directory and save to a text document, and sort results
These articles will help you http://social.msdn.microsoft.com/Forums/en-US/21151c3b-809f-4cb9-8a1a-ebb073d9227b/list-directories-in-treeview http://www.developerfusion.com/code/2084/treeview-filesfolder-lists-recursively/

Categories : Sorting

404 Errors with flask-restless and Amazon Elastic Beanstalk
Turns out I was running the wrong file on my configuration file. Since my app was setup like a module, I needed to have EC2 run the run.py file and not app/init.py.

Categories : Amazon

How do I force Amazon EC2 instance to use my Elastic IP when I FTP out to a remote server?
FTP has two modes of operation - active and passive. Quoting wikipedia: FTP may run in active or passive mode, which determines how the data connection is established.In active mode, the client creates a TCP control connection. In situations where the client is behind a firewall and unable to accept incoming TCP connections, passive mode may be used. In this mode, the client uses the control connection to send a PASV command to the server and then receives a server IP address and server port number from the server, which the client then uses to open a data connection from an arbitrary client port to the server IP address and server port number received To summarize, in active mode, the server will attempt to create a connection BACK to the client. Since you client's IP is a private o

Categories : Amazon

Daemonize PHP script (an SQS listener) on Amazon Elastic Beanstalk
Have you taken a look at the Fat Controller ? It can daemonise anything. There's documentation and examples on the website: http://fat-controller.sourceforge.net

Categories : PHP

Amazon Elastic Mapreduce : Bootstrap Actions issue?
Bootstrap actions are just standard unix scripts. Ensure the shebang points to an interpreter on the machines in your cluster and you're good to go. When you say source files do you mean your pig scripts? These can be ran directly off s3. If you are talking about data, you should read these directly off s3 unless you have a use case for copying to the cluster first(like scanning the same data multiple times)

Categories : Hadoop

Amazon Elastic Beanstalk .config for node 64bit & env
I've run into this problem as well. I believe there are 2 ways to solve it. Run "eb update" this should update your environment and hopefully grab the variables. Create a new env and deploy your code into that environment. Once everything is good then point dns at the new env and delete the old one. Also I read somewhere (aws forum I believe) that if you update the env in the elastic beanstalk gui interface that those values will take precedence over anything you put in the source code.

Categories : Node Js

Java - Get metadata of files in a directory with million files in it
Many filesystems are not efficient at handling directories with that many entries in them. There's very little you can do, codewise, to fix that. You need to try to move those files into multiple directories, to get better speed. Other possible reasons for slowness are that you're either using a data structure that takes O(n) for each entry (resulting in O(n²) total runtime), or you're running out of heap space (so that GC dominates runtime).

Categories : Java

Amazon Elastic Beanstalk node and npm non-standard install locations
You can add the most recent node and npm binaries to $PATH with a command like this: PATH=$PATH:`ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin I couldn't figure out how to prevent beanstalk commands from resetting the $PATH back again. If you are so inclined you can probably create a symlink with a command similar to the above and use that as your reference point in cron scripts etc. Agreed, it is very very annoying.

Categories : Node Js

Why am I getting a 502 bad gateway when sending a redirect from behind amazon elastic load balancer?
It turns out that ELB is very picky about what it considers a 'valid' response and will return 502 Bad Gateway if it isn't happy. I fixed it by making sure the response from my server had the following headers: eg. if I was listening at http://example.com I send back the following response: HTTP/1.1 301 Moved Permanently Content-Type: */*; charset="UTF-8" Location: https://example.com/ Content-Length: 0 This makes ELB happy and everything works. For interest, here's the code (Java, using Simpleframework): private static void startHttpsRedirector() throws IOException { org.simpleframework.http.core.Container container = new org.simpleframework.http.core.Container() { @Override public void handle(Request request, Response response) { Path path = reques

Categories : Http

Amazon Elastic Load Balancer (ELB) url not resolved by instance attached to it
This is normal, if I correctly understand your testing framework. The way that ELB is scaling, it starts out running on a very small machine, and as traffic increases, it's directed to even larger and larger machines. However, ELB is not configured to handle flash traffic, especially from a small number of hosts, as is the case with a load testing scenario. This is because the DNS record is changed whenever ELB scales, and it sometimes takes a while to propagate. Load testing frameworks sometimes cache the DNS lookup, making things even slower. The official ELB documentation (http://aws.amazon.com/articles/1636185810492479) states that traffic should not be increased by more than 50% every 5 minutes. I found that scaling takes even longer if you're looking to get over 150-200k RPM.

Categories : Wcf

which are the files uri on GAE java emulating cloud storage with GCS client library?
You can see how this is done here: https://code.google.com/p/appengine-gcs-client/source/browse/trunk/java/src/main/java/com/google/appengine/tools/cloudstorage/dev/LocalRawGcsService.java As of today this mapping is being maintained by the using the local datastore. This may change in the future, but you should be able to simply call into this class or one of the higher level classes provided with the GCS client to get at the data.

Categories : Google App Engine

Amazon Elastic beanstalk : Use nginx/apache to forward subdomains to subfolders
you can use Configuration File to customize your nginx configuration. Create an .ebextensions directory in the top-level of your source bundle. Create a configuration file, /your_app/.ebextensions/custom.config. Type the following inside the configuration file to configure forward settings. (I have created a gist) files: "/etc/nginx/conf.d/custom.conf" : content: | server { listen 8080; server_name foo.chief-motp.com; location / { proxy_pass http://nodejs/foo/; proxy_set_header Connection ""; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Categories : Htaccess

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