w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
rsync -z with remote share mounted locally
It won't save you anything. To compress the file, rsync needs to read it's contents (in blocks) and then compress them. Since reading the blocks is going to happen over the wire, pre-compression, you save no bandwidth and gain a bit of overhead from the compression itself.

Categories : Linux

Copying files on mounted drive
Neither cp nor the smb protocol are smart enough to realize that the source + destination of the file are on the same remote server. cp will simply do its usual thing and slurp all the data from the source file (copying it to the client machine), then spit it back out in the target file on the server. So yes, it'll be a round-trip through the client. A better solution for this sort of thing is using an SSH remote command, turning it into a purely server-side operation: ssh imageuser@x.x.x.x 'cp sourcefile targetfile' You can still keep the fileserver mounted on your local machine to actually see what files you're dealing with, but do all the file copy/move operations via the ssh commands for efficiency. Since the server is a Windows machine, you'll probably have to install cygwin and g

Categories : PHP

mounted s3 bucket files not accessible through apache
s3fs is not a block device. Under the covers it copies files to your temp directory when you try to access them. It does not work like NFS. You can copy files to and from s3 with s3fs, but you should not be running your application directly from s3fs.

Categories : Ubuntu

How do I copy a mounted dmg's files to another location using a unix terminal?
Your error is because there isn't a file named * inside that folder. The single quotes are preventing the shell from evaluating * to find matching filenames. Try one of these instead: cp -r '/Volumes/Google Chrome/Google Chrome.app' /Users/$USER/Applications cp -r /Volumes/Google Chrome/Google Chrome.app /Users/$USER/Applications

Categories : Osx

Files created on external storage do not show up when device is mounted on Windows/Mac
I experienced similar problem with Android 4 and Mac os. I guess that you might be in the same situation. The solution was to rescan the sd storage using SDrescan. This is described here: Nexus 4 not showing files via MTP

Categories : Android

how to configure or edit wp-filebase plugin edit to show author of files
yes we can configure the plugin without touching the code. However, following link was very helpful to me. documentation for the templates

Categories : PHP

Edit a file outside the web root
Probably by bind mounts (assuming Linux), so that the file is in it's original location as well as in the web root. Or by priviledge separation. The web root sends a query to some worker job, that has access to all the needed files.

Categories : PHP

How do I open a file for edit as root with Aquamacs?
You can open a file as root using TRAMP (bundled with Emacs since version 22.1): C-x C-f /sudo:root@localhost:/path/to/file RET If you don't insert the username@host part, TRAMP defaults to root@localhost when using /sudo, so you can shorten the syntax to C-x C-f /sudo::/path/to/file RET

Categories : Osx

Linux: Move log files from a mounted dir to a local dir recursively while maintaining directory structure in local direcoty
How about something like rsync -azrR --include='*.log' -f 'hide,! */' /media/primary /backup If you use man rsync and type 2343g it should take you to the line where it explains this filter. Basically it will hide everything that's not a directory (every file) from the pattern matching; however, since I've used the --include='*.log' flag as well it will override that and the pattern will match only .log files. You can also use the -nv flag to do a dry run and see what would happen.

Categories : PHP

How do I make a file permanently read-only on Linux so even root can not edit it?
There is an "immutable" bit for files: http://www.aboutlinux.info/2005/11/make-your-files-immutable-which-even.html Programs (even running as root) won't be able to tamper with the file. Of course, root can un-do the bit, but most programs (especially non-malicious ones) won't get past it.

Categories : Linux

Different files for different branches only locally
One way of doing this is to put your db_config.php in .gitignore and create an file called db_config.php.example. Then when you deploy or send to your customer he/she would only need to copy the example to db_config.php file and insert correct credentials. We often use similar behavior in our company where every developer has his own database settings.

Categories : GIT

Edit multiple lines of a file locally and then rename multiple times- Linux
You can try something next: LC_ALL=C for i in {1..6} do r=$(printf "%.1f" $i) theta=$(printf "%.1f" $(($i*15)) ) sed "s/theta = 0.0/theta = $theta/;s/r = 1.0/r = $r/;s/visual_1_0/visual_r_theta/" < n2o.inp >n2o_${r}_${theta}.inp done You should don't have spaces between = in the assignment. Calculation (integer only) in bash can be done with $(( expression )) syntax. The printf formats the number as floating point number with one decimal precision, and finally the 'LC_ALL=C' sets the locale to C - so, the printf prints decimal point and not a comma as in many international setting. (if you're has C or us and like, don't need the LC_ALL line). The above script produces from the input file: theta = 0.0 deg r = 1.0 put, molden, visual_1_0 ; the next 6 files theta =

Categories : Linux

Close all locally opened files in a given directory
you might try this with handle on the command line: for /f "tokens=2 delims=:" %a in ('handle "c:folder"') do @for /f %b in ("%~a") do @echo handle -c %~b Remove echo if the output looks good.

Categories : Windows

Including HTML files locally / templating?
There are a few ways you could do this: Client-side Templating - check out Moustache and Handlebars AJAX - You could load the header/footer asynchronously and render them around your content (or vice-versa, create your site as a single-page application, loading the wrapper first, then loading the page content asynchronously and inserting that into the wrapper). iFrames / Framesets - Old-school, but it will do what you want, more or less.

Categories : Javascript

Image Files Loading Locally But Not Online?
Actually you can't, because think of it, it'll be a security risk. Your friend would send you and HTML file, and there it is, it accesses all the files on your C drive and deletes them. However, you can serve files (including image files) locally. All you need is to install a local web server, and host your site in that server, and change the DNS settings, so that user would access a locally installed website using names in the browser, just the way they surf the Internet.

Categories : HTML

Loading multiple HTML files(LOCALLY)
If I understand correctly, each row in the master table has an associated number in your numbers array. When the row is tapped, you need to navigate to a detail view that will display the HTML file associated with the selected number. Is that right? A simple way to do this is by generating the file name programmatically using [NSString stringWithFormat:]: NSNumber *n = numbers[indexPath.row]; NSString *name = [NSString stringWithFormat:@"forArray%d", [n integerValue]]; NSString *pathHTML = [[NSBundle mainBundle] pathForResource:name ofType:@"html" inDirectory:NO]; NSURL *URLreq = [NSURL fileWithPath:pathHTML]; NSURLRequest *loadURL = [NSURLRequest requestWithURL:URLreq]; [webview loadRequest:loadURL];

Categories : Objective C

Mounting sshfs on unreliable connection
You can play a little bit with the options of sshfs, for example, enabling the compression, the automatic reconnect and nodelay flag for tcp: -C equivalent to '-o compression=yes' -o reconnect -o workaround=LIST [no]nodelaysrv set nodelay tcp flag in ssh (default: off) sshfs server:/srv/homes /mnt/mountpoint -C -o reconnect -o workaround=nodelaysrv But what has give me better results is using NFS, I don't have the lags that I had with sshfs and is pretty standard in the *nix environment, you can export your directory with the read-only option giving you an extra speed. Server: # File: /etc/exports /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) Client: mount server:/srv/homes /mnt/mountpoint

Categories : Misc

Does a Trigger.io reload delete all locally saved files?
I've not been able to recreate any saveURL problems with Reload - what I did: create a new app use file.saveURL and prefs module to download a file and remember its location (https://gist.github.com/goodgravy/6539470) run the app - image is shown in app make a small change to the app (e.g. some text in index.html) push out Reload update switch away from app, wait for Reload to be downloaded, switch back to app index.html change has been made, and image is still shown from original saved location I tried that out on Android 4.2 and iOS 7. Could you try that stripped-down app I linked to to see if you're seeing the same thing? If it is still a problem, please let us know what device and OS version you're on there.

Categories : Misc

autofs/sshfs not adhere to remote permissions
sshfs by default does not allow the kernel to check permissions you need to use sshfs -o allow_other,default_permissions Im not sure how to use that with autofs as I only ever use sshfs direct but it should be able to slot in somewhere

Categories : Linux

Grails Files in Root not found
you can use the UrlMappings.groovy to map an Url to a view like "/robots.txt" (view: "/robots") and in the "/views/" directory is your robots.gsp, then yoou shouldn´t have any environment specific-problems

Categories : Tomcat

Linking to ROOT files in xCode
This has nothing to do with ROOT. To link against a library named libSomething.so in your library search path you can use a linker flag -lSomething. You want to link against e.g. libTree.so, so the correct flag to use would be -lTree, not -llibTree which would look for liblibTree.

Categories : C++

Apache mod rewrite all .zip files from my root to another domain
If you've moved all the zip files to the root of your new domain use RewriteRule ^.*?/?([^/]+.zip)$ http://myotherdomain.com/$1 [R=301,NC,L] If you've maintained the same folder structure (i.e. you want to move /files/*.zip to newdomain.com/files/*.zip) use RewriteRule ^(.+.zip)$ http://myotherdomain.com/$1 [R=301,NC,L] Keep your current rule that redirects everything under /files/ at the top. RewriteRule ^files/(.*) http://myotherdomain.com/$1 [R=301,NC,L] Then when you only want to redirect the /files/*.zip simple turn it off with a # in front of it. [QSA] is not required because we haven't touched the query string here. EDIT : Okay, to redirect only mydomain.com/*.zip mydomain.com/files/*.zip Use the following rule RewriteRule ^(?:files/)?([^/]+.zip)$ http://myotherdomai

Categories : Apache

Sub Domain utilizing same application files as root (using PHP)
As it is on the same server, it should be no problem. You should use absolute paths for including, so for example /web/www/htdocs/config.inc.php instead of ../htdocs/config.inc.php, as it would get really confusing. It would be the best to have a simple pathConf.inc.php in api directory and root directory, containing this absolute path - so you will be able to easily change it afterwards. Then, use this path configured in pathConf.inc.php and include your classes, db configs etc.

Categories : PHP

Nginx: Serve Files from different Root Locations
First of all I advice you to take a backup of your conf file before starting all this. Anyway, you were doing great at first, but then you added stuff that didn't need to be added, like for example try_files $uri $uri/ @handler; This line doesn't really need to be split into two, you could just merge the rewrite into it try_files $uri $uri/ /index.php; But then it makes me wonder how it's working without the $request_uri, so if doesn't work i would try using this line instead: try_files $uri $uri/ /index.php$request_uri; Now this block i don't really understand what it's supposed to do location ~.php/ { rewrite ^(.*.php)/ $1 last; } I'd say it's safe to remove it entirely, cause it seems to be rewriting the request to the same thing it was. And inside the php conf, the w

Categories : Codeigniter

phonegap set the root directory for asset files
Maybe a solution is to use the base tag witch allow you to set a default base to all yours relatives links. So for android it will be: <base href="file:///android_asset/www/" target="_blank"> And all yours link will be: <img src="img/logo.png">

Categories : Cordova

python unzip files below the root folder
You have to use a more complex (and therefore more customizable) way to unzip. Instead of using the 'extractall' method, you must extract each files separately with the 'extract' method. Then you will be able to change the destination directory, omitting archive's sub-directories. Here is your code with the modification you needed : def unzip_artifact( local_directory, file_path ): fileName, ext = os.path.splitext( file_path ) if ext == ".zip": Downloadfile = fileName + ext print 'unzipping file ' + Downloadfile try: #zipfile.ZipFile(file_path).extractall(local_directory) # Old way # Open the zip with zipfile.ZipFile(file_path) as zf: # For each members of the archive for member in zf.in

Categories : Python

Open and edit SVG files using C/C++
Cairo's scale function scales the entire coordinate system, but you can use it on an individual shape if you translate first to the shape's origin; and if you bracket these changes with a save/restore pair it will only affect drawing done within this span. Resetting the matrix before stroking allows you to resize a drawing without changing the stroke-width (alternately, you can adjust the stroke_width by 1/scaling-factor). cairo_matrix_t m; cairo_get_matrix(cr, &m); cairo_save(cr); cairo_translate(shape_x, shape_y); cairo_scale(shape_w, shape_h); //cairo_move_to(cr, x, y); //perform the actual drawing //cairo_line_to(cr, x, y); //cairo_closepath(cr); cairo_set_matrix(cr, &m); cairo_stroke(cr); cairo_restore(cr); And if resetting the matr

Categories : C++

How to edit RTF files on MVC website?
Your RTF files most likely will have to be presented as HTML Please check out How to make your own RTF Converter which should be useful in your own project.

Categories : HTML

How to get relative path of files from defined root directory?
That would be os.path.relpath(): >>> import os >>> filename = "C:/test/media/blog_images/2013/06/15/yay.gif" >>> blog_images = "C:/test/media/blog_images/" >>> os.path.relpath(filename, blog_images) '2013\06\15\yay.gif'

Categories : Python

How can I add or remove any files into and from initramfs root file system?
How is your kernel/initramfs build ? Is it Buildroot or ptxdist or similar tool ? You need to know what is done during the compilation/build phase, maybe there is a skeleton elsewhere and you need to add your flash dir into this skeleton.

Categories : File

How can I edit jQuery files within WordPress
If you are using a plugin that has this js, then yes you have access to the files in the wordpress backend. Just go to Plugins - Editor. And on the right hand side you can select your plugin in the drop down. Select it and press Select button. It should list the plugin files on the right hand side, find the file you want to add and the editor on the left will populate with what ever is in the js file.

Categories : Wordpress

Windows batch script to name files after containing subfolder and copy to root
Here I made this my self. I created a similar situation to yours and it worked fine for me. However you have to specify the location to copy all the files to. for /d %%a in (*) do ( cd %%a for /r %%b in (*) do ( copy %%b C: [root] \%%a%%~xb ) cd.. ) pause Hopes this helps. Yours Mona.

Categories : Windows

Open root owned system files for reading with python
One option would be to do this somewhat sensitive "su" work in a background process that is disconnected from the web. Likely running via cron, this script would take the root owned log files, possibly change them to a format that the web-side code could deal with easily like loading them into a database, or merely unzipping them and placing them into a different location with slightly more laxed permissions. Then the web-side code could easily have access to the data without having to jump through the "su" hoops. From my perspective this plan does not seem to violate your contractual rules. The web server config, permissions, etc remain intact.

Categories : Python

HTML5 video fallback - can't play video files in flash player locally
If it's only for local access, you must choose in the FLA's Publish Settings the Option Access local files only for Local playbac security. For more information: http://www.senocular.com/pub/adobe/Flash%20Player%20Security%20Basics.html

Categories : HTML

How to enable reading C# Excel files on IIS (reading them locally on the machine where IIS is running works fine)?
Hi I am working with Excel at the moment in a project, from what I know adding the dll to the project is fine especially if you have no control over what you can install on the server. I know of a large project that does it like that. Microsoft recommend installing Excel on the deployment server and using Interops, which sound like what you are trying to do. I wasn't able to install excel onto our deployment server because we have to share it with other projects so I used EP Plus which is available on nuget and extremely easy to set up and use. It took less than an hour to have it generating Excel files. The only drawback with it is that it only generates xlsx files which are the newer type of excel files. This is an easier approach and it may be easier and suitable for your project. Th

Categories : C#

Maven: Not copying files from src/main/resources to the classpath root - Executable Jar
You can try replacing your Configuration as follows; <configuration> <archive> <manifest> <mainClass>xx.com.xxx.xxxx.xx.xxxx.InterfaceRunner</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <finalName>InterfaceRunner</finalName> </configuration> And then mvn package

Categories : Java

Batch Script to Delete Files with Unique Root Stem in Directory
The way i'd go about this is as follows, i will explain the logic and i'll leave you to do the coding. You will parse all the file names into variables, while increasing each time. Then you will set a limit to the number of loops to go through. Then you will search the first 13 characters of the file name and if the number of lines is equal to 1 then delete it. After you will increase the variable by 1 and go through the loop, at the end of each loop it will check if it has reached the limit aka the number of files in the directory, if it has reached the limit, end the loop, otherwise continue. hah, i finally decided to do it after a guy decided to use my idea i described into actual code, anyway this is way shorter and a lot faster than his, tested+verified to work: @echo off & setl

Categories : Batch File

Edit a configuration file w/o temp files
Looks like a case for sed -i since you're on Linux. Also, since this is system administration work, preserve a backup. sudo sed -i.bak -e '1i set eventqueue basedir /etc/monit/eventqueue/ slots 1000 set mmonit http://monit:monit@xxx.xxx.xxx.xxx:8080/collector set httpd port 2812 and use address ec2-xxx.xxx.xx.xx.com allow localhost allow 0.0.0.0/0.0.0.0 allow admin:swordfish ' /etc/monit/monitrc This says 'insert the following lines before line 1'...and the lines continue up to and including the one without a backslash at the end. You can also do the edit of the set daemon line too, even though you said it was out-of-scope: sudo sed -i.bak -e '1i set eventqueue basedir /etc/monit/eventqueue/ slots 1000 set mmonit http://monit:monit@xxx.xxx.xxx.xxx:8080/collector set httpd

Categories : Linux

How do i read and edit huge excel files using POI?
Assuming your memory size is large enough to use XSSF/SAX to read and SXSSF to write, let me suggest the following solution. 1) Read the file using XSSF/SAX. For each row, create an object with the row data and immediately write it out into a file using ObjectOutputStream or any other output format you find convenient. You will create a separate file for each row. And there will only be 1 row object in memory, because you can keep modifying the same object with each row's data. 2) Make whatever modifications you need to. For rows that need to be modified, read the corresponding file back into your row object, modify as needed, and write it back out. For new rows, simply set the data in your row object and write it out to a new file. 3) Use SXSSF to reassemble your spreadsheet by reading

Categories : Apache

How do I edit the system definition files for quicklisp
OK so you need to make these subfolders in your home directory. I'm guessing you installed under windows as I saw your comment on my video! Remember that part of the install was created a home folder and setting it's path in your environment variables. ~ is the symbol for the home directory so you need to create directories for this path ~/.config/common-lisp/source-registry.conf.d which for my setup would be c:home.configcommon-lispsource-registry.conf.d Inside that create directory creare a fuf.conf file and paste the lines from the instructions. I haven’t got a windows machine to hand but hopefully that's enough to get you going!

Categories : Emacs



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