w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to remove file permissions on linux from an external hard drive?
To make the partition accessible under Linux run: sudo chmod -R 777 /media/<drive-name>/ this should make the mac drive accessible for you. Changing ownership would do about the same, but you need not worry about it.

Categories : Linux

Remove files from a NetBeans project but not the hard drive
Solution working with Netbeans 7.3.1: right click on your project in the "Projects" window, click on "Properties", click on "Ignored folders" in the left panel called "Categories", click on "Add folder" and select the folders you want to ignore.

Categories : Misc

how to shrink KVM hard drive image
Images can be sparsed, and your cp might not respect that for various reasons. I would: check the real file usage (du -sh vm.img or qemu-img info vm.img) use qemu-img convert -S to recreate a sparse image convert to qcow2 to have growing and versatile image instead

Categories : Misc

Methods for tracking changes to hard drive
For realtime tracking when file or directory changes you can use inotify on Linux or FileSystemWatcher on Windows. Combine with rsync to get delta.

Categories : Svn

Is there a way to read directly from the hard drive to the GPU
The GPU is not directly connected to the system RAM. There's a bus inbetween, in current generation computers a PCI-Express bus. ATA storage has a controller inbetween. There is no direct connection between memories. BUT there is DMA, which allows certain periphials to directly access the system memory through DMA channels. DMA on PCI-Express also works between periphials. Theoretically a GPU could do DMA to the ATA controller. Practically this is of little use! Why? Because of filesystems. Even if there was some kind of driver support to let the GPU access a storage periphial directly, it'd still have to do all the filesystem business, which doesn't parallelize to the degree as GPUs are designed for. Alas regarding your question: In my OpenGL program I read from the header file t

Categories : Opengl

Adding a new hard drive to xampp
If you want to sort of "span" the drive, Windows has this handy feature (similar to linux's symlinking) called mklink which you can create a folder in the current directory that is just a symbolic link to the drive. Quick and easy way to span it. I am not sure of any downsides to do doing this, other than if the drive letter changes (if external drive). That way you should not have to add or change any of your paths in the config etc. Not sure if that is what you were looking for, but hopefully it helps. Also, did you try your 3rd config you pasted? Did it not work? From what I can see, as long as permissions are fine it should work that way.

Categories : PHP

Accessing a file on the server's hard drive
You cannot reach the file that is "above" the wwwroot folder by design. The way to do this is to a) copy the file there, b) setup a symbolic link (if on linux) or c) preferably, move / setup another web root folder. Alternatively, write a server script to dump the file contents.

Categories : Javascript

Unmount my external hard drive in bash
Searching for "Unmount Hard Drive Terminal" yields http://ubuntuforums.org/showthread.php?t=842698 as the first result. >.> russlar provides a solution: open terminal, and run df -h. this will tell you all the hard drives mounted. then, run sudo umount /dev/something, where somethign is the name of the hard drive that you want to unmount. Nothing wrong with asking, but when a solution is on the first Google result, it's a little... odd.

Categories : Misc

How to identify system hard drive using Win32_DiskDrive
The documentation you linked has the answer: string SerialNumber; uint32 Signature; Your management object will have those properties in it. If you're getting null for those values then the problem is that you're using a version of Windows that doesn't support them. SerialNumber ... Windows Server 2003 and Windows XP: This property is not available. In which case you have to use the Signature property, but this requires XP SP3 I believe.

Categories : C#

Save Work Done In MS Word To A Database Not On A Hard Drive
The method you are using is extremely inefficient and I wouldn't recommend the process, but the reason that you code is failing is your length.... when you are saving your MemoryStream you are setting the length int len = Application.ActiveDocument.Content.StoryLength; but when you try to retrieve it, you are setting it int len = int.MaxValue; which would be far past the end of the data stream.

Categories : C#

Is three a way for a Chrome App to reach user's file on hard drive with permission?
Streaming can be done using HTML5 Video tag. Please check : http://html5doctor.com/the-video-element/ Also, you can use plugins like : http://www.videojs.com/

Categories : HTML

google drive api - copyfile working only with permission for accessing all files in drive (but jst need to copy)
According to the documentation, Files.copy() requires at least one of the following three permissions: https://www.googleapis.com/auth/drive: "View and manage the files and documents in your Google Drive" which is the one you want to avoid https://www.googleapis.com/auth/drive.file: "View and manage Google Drive files that you have opened or created with this app." Which means you can freely create any file but only open the files your app created. You can only copy a file you created, but you cannot copy any other files even if it is public. https://www.googleapis.com/auth/drive.appdata: "View and manage its own configuration data in your Google Drive" Which only lets you control your application-specific Appdata folder which is probably not what you want. You can only copy a file with

Categories : Javascript

Google drive: Get (root) file and folders with javascript api (get only deleted files on drive)
Same situation as following question: google drive api, javascript list files returns nothing I needed to add to the scope the path 'drive' at authorizing, I had only drive.file which is intent to create/edit files only. The weird thing is that the API returns deleted files when you don't have permissions to view files, I think it's a bug in the API (a serious one). Post this bug on google drive: https://productforums.google.com/forum/#!searchin/drive/security$20issue$20permission$20view/drive/pupjKxTz9FU/cUarGIl_Ah0J

Categories : Javascript

Error while Retriving files from google drive using drive API. “Calling this from your main thread can lead to deadlock
You should do any code that could take a long time such as I/O or network activity on a different thread. In your situation your file retrieval would be best done within an ASyncTask. The reason for this warning is because when your code is being executed to retrieve the file from Drive, the code will block until the file retrieval has completed, this means that nothing else within the program will be able to respond, i.e. GUI will not update and input from the user trying to do stuff with the GUI will not be registered. After a few seconds, if the file retrieval still isn't complete, then the user will be presented with an ANR (Application Not Responding) message. This will either give the user the choice of waiting, if their patient, or most likely force closing your app.

Categories : Android

Change my current working directory in Python to my external hard drive.
You are correct. >>> 'E:CollegeProject3dlife-gc-2013-dataset-hhi3dlife-gc-2013-dataset-hhi' 'E:\College\Projectx03dlife-gc-2013-dataset-hhix03dlife-gc-2013-dataset-hhi' Double the backslashes, use forward slashes, or use a raw string.

Categories : Python

Single git repo setup tracking multiple locations on hard drive
No, there is no mechanism in git for this. Git assumes that all files that it manages (the "working copy") live in a single directory (and subdirectories); there is no support for managing two separate directories in in repo. So you'll have to somehow keep everything in one directory, probably as subdirectories HTMLTemplates and theme or similar. You could use two git repos, but I'd strongly advise against this. A single repo should contain a whole "project", i.e. everything needed to build one piece of software (excluding things like external libraries). If you split your project across two repositories, you cannot usefully branch and merge (because you'd have to do it in both repos simultaneously), you cannot easily check out old versions etc.. To solve your problem, I see a few poss

Categories : Wordpress

Monitoring changes in Google Drive files for whole domain using Drive API
Domain-wide delegation simplifies the authentication portion for your app but you'll still need to auth as each user to get their files and changes. It may be possible for your app to "grab" all files and make itself (or a special user) the owner, then you just have one user account to scan but the "grab" process would still need to run at regular intervals to find new files created or uploaded by end users. I believe most apps that need to scan content at this level do it via cron jobs or AppEngine task queues which make it easy to chunk up the scans throughout the day. Generally they expect to scan each user account once every 24 hours or so.

Categories : Google App Engine

How do I bind a WPF Image element to a PNG on the local hard drive using a relative filepath derived from a DB?
You need to use custom value converter to convert strings to images if you want to load files from the file system. Image.Source, when a string is passed, expects a file name from resources. You can find implementation of a such converter here: Display an image in WPF without holding the file open.

Categories : C#

My Apple MacBook hard drive crashed - provisioning profiles lost, is there a way I can still update my app?
Create a new certificate if needed then create a new set of provisioning profiles. Install the updated profiles and update your apps to use the new profiles. That's it. Not that big of deal other than spending 30 minutes redoing this stuff.

Categories : IOS

Python upload an Image form my hard drive and show it on a canvas wideget.
There's a handy module for that: tkFileDialog! import tkFileDialog tkFileDialog.askopenfilename() The function will return the path to the file for you and theres a variety of options you can set here

Categories : Python

Linux Shell Script: How to detect NFS Mount-point (or the Server) is dead?
"stat" command is a somewhat cleaner way: statresult=`stat /my/mountpoint 2>&1 | grep -i "stale"` if [ "${statresult}" != "" ]; then #result not empty: mountpoint is stale; remove it umount -f /my/mountpoint fi Additionally, you can use rpcinfo to detect whether the remote nfs share is available: rpcinfo -t remote.system.net nfs > /dev/null 2>&1 if [ $? -eq 0 ]; then echo Remote NFS share available. fi Added 2013-07-15T14:31:18-05:00: I looked into this further as I am also working on a script that needs to recognize stale mountpoints. Inspired by one of the replies to "Is there a good way to detect a stale NFS mount", I think the following may be the most reliable way to check for staleness of a specific mountpoint in bash: read -t1 < <(stat -t "/my/m

Categories : Linux

Serial Communication gets back wrong answer when something is running in the background (like browsing the hard drive)
Note: serialPort.Write(string) is a non-blocking store into the output buffer. That means the following won't guarantee you've even finished writing your request before you stop listening for a response: serialPort.Write(request); Thread.Sleep(50); _shouldStop = true; You could add: while( serialPort.BytesToWrite > 0 ) Thread.Sleep(1); // force blocking but it's ill advised. One thing I'm wondering. There is only a single serial port here. Why do you want many different threads to work with it when you could manage the entire serial port interaction with a single thread? (Or at worse, 1 thread for input 1 thread for output) To me it makes a lot more sense to store up requests into a queue of some kind and then peel them off one at a time for processing in a single threa

Categories : C#

Need Apps Script to Copy a File(s) from my Local Hard Drive to a Google Sites Folder
You have to write an UI to that allows the visitor to the site to upload the file. See https://developers.google.com/apps-script/reference/ui/file-upload for an example.

Categories : Google Apps Script

linux: running self compiled kernel in qemu: VFS: Unable to mount root fs on unknown wn-block(0,0)
maybe your system image file is bad and can not be mounted. You may try these command to mount the image file and check if it is a valid root file system for linux. losetup /dev/loop0 /var/lib/libvirt/images/Debian.img kpartx -av /dev/loop0 mount /dev/mapper/loop0p1 /mnt/tmp

Categories : Linux

Serving static files with CherryPy ignores mount point?
This is how I solved it: [/] tools.staticdir.root: os.path.abspath("public/") tools.encode.on: False tools.gzip.on: True tools.gzip.mime_types: ['text/html', 'text/plain', 'application/json', 'text/javascript', 'application/javascript'] [/static] tools.etags.on: True tools.staticdir.on: True tools.staticdir.dir: "public" [/js] tools.staticdir.on: True tools.staticdir.dir: 'js' [/css] tools.staticdir.on: True tools.staticdir.dir: 'css' [/images] tools.staticdir.on: True tools.staticdir.dir: 'images'

Categories : Python

Mount S3 (s3fs) on EC2 with dynamic files - Persistent Public Permission
In my php script that PUT files to S3 using AWK SDK for PHP, I had to add in the meta data, as shown below, which did the trick: $response = $s3->create_object('bucketname', 'mountpoint/'.$filename, array( 'body' => $json_data, 'contentType' => 'application/json', 'acl' => AmazonS3::ACL_PUBLIC, 'meta' => array( 'mode' => '33188', // x-amz-meta-mode ) )); The mode "33188" defined the permissions "rw-r--r--" instead of "---------" in S3 bucket (but reflected only in the EC2 mounted folder), which was later inherited by the EC2 mounted drive. Hope this helps someone. Let me know!

Categories : Amazon

[Qt][Linux] List drive or partitions
You need to use platform specific code. And, please, read the docs! Returns a list of the root directories on this system. On Windows this returns a list of QFileInfo objects containing "C:/", "D:/", etc. On other operating systems, it returns a list containing just one root directory (i.e. "/").

Categories : C++

How can we use Linux from a small storage pen drive? Does it work on micro-controllers also?
I generally hear that LINUX OS can be downloaded on flash, pen drive (floppy disk?) etc. How > we can do that? If you can't get it to work on your own, you can buy a ready made Linux on a USB drive from a site like http://www.osdisc.com or http://www.cheapbytes.com Not all PCs, especially older PCs, can boot from the USB Drive. Even some newer PCs are beginning to ship with security features that can interfere with booting code. When it does work, you have to find out the proper way to boot the USB drive. You might have only a few seconds during reboot to enter the right key, or it will boot Windows (if Windows is installed). The key to get to the BIOS Boot Menu might be delete or escape or F10 or some other key (varies with PC motherboard manufacturer). A message on the screen

Categories : Linux

Deleting files using vbs without hard coding variables
Your cscript command looks ok. Then, add this to your vbscript to capture the arguments location = WScript.Arguments.Item(0) date-stamp = WScript.Arguments.Item(1) extension = WScript.Arguments.Item(2) Note, they are all strings, so you will need to parse your date value to an actual date.

Categories : Vbscript

How can i add some bat files to my project so i will not need them anymore on the hard disk?
// create the dxdiag.bat file using (StreamWriter sw = new StreamWriter("dxdiag.bat")) { sw.WriteLine("........."); // ...... } Process proc = new Process(); proc.EnableRaisingEvents = true; proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = "dxdiag.bat"; proc.StartInfo.CreateNoWindow = true; proc.Start(); proc.WaitForExit(); proc.Close(); //delete the file File.Delete("dxdiag.bat");

Categories : C#

How to replace duplicate files with hard links using python?
Why not compare the files byte for byte instead of the second checksum? One in a billion two checksums might accidentally match, but direct comparison shouldn't fail. It shouldn't be slower, and might even be faster. Maybe it could be slower when there are more than two files and you have to read the original file for each other. If you really wanted you could get around that by comparing blocks of all the files at once. EDIT: I don't think it would require more code, just different. Something like this for the loop body: data1 = fh1.read(8192) data2 = fh2.read(8192) if data1 != data2: return False

Categories : Python

What will happen to uncommited and unstaged files after git reset --hard?
In the first case, file_2 is not tracked as you just added it to your working directory without staging or embed it into a commit. Executing git reset --hard will then have no impact on these file as it's not tracked by git. In the second case, you started tracking file_2 (by staging it) which means that running git reset --hard will then reset your working directory including file_2, it's then removed from both your staging area and your working directory. I would also advice you to take a deeper look at this well explained article (full of examples) on the role of reset.

Categories : GIT

Write files into randomly non-contiguous hard disk positions
I think that the only way to do this is using some low-level OS commands No... RandomAccessFile has .seek(): final RandomAccessFile f = new RandomAccessFile(someFile, "rw"); f.seek(someRandomLong); f.write(...); Now, it is of course up to you to ensure that writes don't collide with one another. Another solution is to map the file in memory and set the buffer's position to some random position before writing.

Categories : Java

Website files wont update (even after hard refresh and cleared cache)
The path for an image used as a CSS background is relative to the CSS file, not relative to the website root. So if your CSS file is in the website/css directory, double check that you are saving the background image to the website/css/images directory Good luck! EDIT If you place your updated background image in the http://www.impendingreview.com/wp-content/themes/filmstar/images directory you should be good. When you've done that you should find the file at http://www.impendingreview.com/wp-content/themes/filmstar/images/back-top2.png and edit the stylesheet at http://www.impendingreview.com/wp-content/themes/filmstar/style.css to something like body { color: #5c5858; position: relative; font-family: 'tahoma'; background: url(images/back-top2.png) repeat-x; } as y

Categories : HTML

How can I resume connection between SQL Server and physical files after hard disk disabling?
Lets start saying that you are in a very bad shape and you should check your physical server ASAP. IMO, the best thing to do is backup the files as-is just in case you can't do anything else then one of the following options restart SQL Server service delete the broken database restore restore back ups to the latest transaction point If the above is impossible. restart SQL Server service hope that things will work

Categories : Dotnet

getting size of multiple files located inside the hard disk using python
if item < 1000: size = str (item) + 'K' if item > 1000: #this will never execute #since you have already asserted that item < 1000

Categories : Python

To find duplicate files on a hard disk by technique other than calculating hash on each file
You may want to use multiple levels of comparisons, with the fast ones coming first to avoid running the slower ones more than necessary. Suggestions: Compare the file lengths. Then compare the first 1K bytes of the files. Then compare the last 1K bytes of the files. (First and last parts of a file are more likely to contain signatures, internal checksums, modfication data, etc, that will change.) Compare the CRC32 checksums of the file. Use CRC rather than a cryptographic hash, unless you have security measures to be concerned about. CRC will be much faster.

Categories : File

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

Saving Files to Google Drive
Yes, if you set up a common Drive account and use Drive API such as Files.insert(), you can let user upload file without login. Actually, there is a quickstart for php which does almost same thing for you. You may want to start from this quickstart to upload a file from your server to Drive and integrate it with form to let any users upload file to your Drive.

Categories : PHP

Save files to unmapped drive vb.net
If the drive is not mapped then yes, you need to access it via a UNC path. However, you should bear in mind that simply not mapping it will not completely stop them accessing it. By default, the app will run under their credentials; therefore anything the app can do, they can also do and vice versa. Even so, if it's not mapped, it will not be immediately visible and this may be sufficient.

Categories : Vb.Net



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