w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android - Mount a Samba share in code
Probably smbfs/cifs are currently not supported by your kernel. As Delyan said, ensure your kernel can mount these filesystem : $ cat /proc/filesystems nodev sysfs nodev rootfs nodev bdev nodev proc nodev cgroup nodev tmpfs nodev debugfs nodev sockfs nodev usbfs .... If they are not listed, you should try to do a modprobing (sometimes the module you want just have to be activated), get root access then : # modprobe <modulename(without.ko)> e.g. : # modprobe cifs If it doesn't work you will have to change or recompile your kernel (including appropriate modules).

Categories : Android

Apache/php cannot access remote cifs/samba share
have you tried //ip/foleder/ /mnt/name cifs username=user,password=passwd,nounix,noserverino,defaults,users,auto,gid=33,uid=33 0 0 change gid and uid to the apache user u can find it out like this: cat /etc/passwd | grep www-data

Categories : Apache

Unable to access Samba folder from Windows (Using Raspberry Pi XMBC as a Samba Server)
That may depend on the directory and file rights. If the us who runs smb have no access rights, you can't read or write files. You can find out file permissions with ls -la you will also see owner and owner group. You can try to set read and write permissions for all (chmod 777 directory -R). If this was the problem, then you should give read and write permissions only to the user that runs smb. Set permissions for all back to 0 (770) because of security reasons. Here you find a tutorial on set up samba for Rasapberry Pi.

Categories : Windows

I'm trying to connect from windows to Samba Shared folder on linux using php
i found solution for connection using this code $sharename = '\\LinuxIPAddressShared_folder'; $username = 'username'; $password = 'password'; $letter = 'Z:'; if (!is_dir($letter . "/TMP")) { $WshNetwork = new COM("WScript.Network"); $WshNetwork->MapNetworkDrive($letter, $sharename, FALSE, $username, $password); } and is working perfect

Categories : PHP

Loading large amount of text files from a share drive to search for a world. C#
My suggestion would be to do any file system work in a separate thread. If you do the file searching in the same thread as your form, Windows has no chance to update the form. You won't be able to update any of your form controls (like listBox1) directly from the new thread, but you can look into delegates and C# threading in general for ways to work around this. Also, if you just need to search files for a specific word, have you looked into existing tools like grep?

Categories : C#

how to search for a word in multiple pdf files using pdftext in linux
The following should list the files matching the pattern: for i in `find . -type f -name "*.pdf"`; do pdftotext "${i}" - | grep -lq "search-word" && echo $i; done The -q option for grep prevents any output to STDOUT. -l lists matching files.

Categories : Linux

Share Serial Port on Linux
I believe it is possible for multiple applications to access a TTY device simultaneously. The fact that you are performing read operations from one userspace application and write operations from another means you are unlikely to encounter a problem. To verify this you can read from a serial into a serial device using the console: cat /dev/ttyS0 If you open another terminal, you can write to the device without any problem: echo "stuff" > /dev/ttyS0

Categories : C++

multiple search key for binary search tree in linux C
Well, in a binary tree, key's only make sense in relation to each-other. Meaning that key1_a makes sense in the left branch only if key1_b is larger/smaller in the right branch (depending how you structure it). If you had a tree of two set of keys, hypothetically they could be in the same tree data-structure if they had the same proportions. As in, if each key in key2 was exactly 50 above key1. But that wouldn't really be useful at all. The only idea I have is making it so there are some null value keys. So that if you're traversing your tree and you're at a leaf of key1 but not key2, you just keep going, and the rest of the tree lower down will have a null value (maybe -1?) in the key, or will have a boolean trigger making it so key1 is no longer present in this branch of the tree. It's

Categories : C

What g++/ld options make it safe to share STL containers across DSO's on Linux?
My google-ability returned to me, and thus I found http://gcc.gnu.org/wiki/Visibility, which I think tells me everything there is to know. It won't tell me about gory internals of STL, but I don't think it has to.

Categories : C++

How to share searchText between vim search and vim substitute?
You can simply omit the pattern in the substitution command, e.g. :%s//new string/ This is documented in :help last-pattern (emphasis mine): The last used pattern and offset are remembered. They can be used to repeat the search, possibly in another direction or with another count. Note that two patterns are remembered: One for 'normal' search commands and one for the substitute command ":s". Each time an empty pattern is given, the previously used pattern is used.

Categories : Search

Merge two files on Linux keeping only lines that appear in both files
Provided both of your two input files are lexicographically sorted, you can indeed use comm: $ comm -12 fileA fileB > fileC If that's not the case, you should sort your input files first: $ comm -12 <(sort fileA) <(sort fileB) > fileC

Categories : Linux

Is it possible to add search/share contracts on my windows phone apps?
i think this link might help you.. http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286414%28v=vs.105%29.aspx this is walkthrough to use and search in contacts. i hope it might help.

Categories : C#

Extending Orchard's search/indexing module to search in uploaded Word, Excel, Powerpoint and PDF files
It's not available out of the box, but possible to implement on your own, especially with upcoming Orchard 1.7 which will make uploaded Media files content items. There are a few extension points for this, with OnIndexing<T> content handler method being the easiest and most straightforward to use. This is the place where extracting keywords and adding them to index should happen. Look at existing implementations for examples. Speaking of keyword extraction - I used iTextSharp for PDFs and MS OpenXML SDK 2.0 for handling Office documents (although it will work only for the new formats - DOCX, PPTX and XLSX). For legacy, non-XML Office formats you'd need some other library - there are lots of those on the web.

Categories : Pdf

How to share files between different web application
If it's for a website, is there a reason you couldn't just directly reference them through http? So on Domain 1: <a href="domain1/doc1.pdf">Document 1 on domain 1</a> And then on your second domain (domain 2): <a href="domain1/doc1.pdf">Document 1 on domain 2</a> Either way, are there so many of these resources that it's worth the trouble not to just upload separately to each app? That way you wouldn't be creating dependencies.

Categories : C#

How Should I Debug Samba with GDB
Download samba source code from http://www.samba.org and compile it (without source code, it will be impossible to do symbolic debugging). Stop or kill any other samba instances. Start samba under gdb: gdb <path/to/compiled/smbd> Specify smbd parameters: set args -i -M single Parameters -i -M single force smbd to start as single process, do not daemonize and print all messages and errors to stdout/stderr. Now, you can set breakpoints and trace your source code as you normally would with any other program. Note: instead of using gdb, you might find more convenient to use gdb-tui (gdb text user interface), or use other debuggers like ddd.

Categories : Debugging

How to share files/folders across git repo?
Using Submodules for this task looks like overkill Using submodules is the right solution, especially since they now can follow the latest commit of a branch (since git1.8.2, March 2013). In that aspect, they act as svn:external.

Categories : GIT

How to share css and js files across projects in the same solution?
Have one common project, call it something like Shared or Utilities (make sure it's a web project). Put your files in that project, then use the URL of that project + the path to the file to reference them in your other projects, something like: http://mysharedproject.co.uk/content/site.css

Categories : Jquery

Best way to share a function between two class files
Put the method in a static class: public static class Utils { public static string fn() { //code... } } You can then call this in A.cs and B.cs without creating a new instance of a class each time: A foo = new A(); foo.Property = Utils.fn(); Alternatively, you could create a BaseClass that all classes inherit from: public class BaseClass { public BaseClass() { } public virtual string fn() { return "hello world"; } } public class A : BaseClass { public A() { } } You would then call fn() like so: A foo = new A(); string x = foo.fn();

Categories : C#

Share files with Google Drive SDK
I am running into exactly the same issue. My app is requesting the full drive scope (so the app should have access to all files). But sharing only works if the file has been opened by the user from the drive before. There seems to be some magic "while-listing" of files that have been opened from drive. When accessing a file that has not been opened from drive before I get... Refused to display htps://drive.google.com/share?id=0534534543iTEhYamxfUnc2MnM&foreignServi…ent=postMessage&appId=46459361793&embedOrigin=http%3A%2F%2Fwww.editey.com' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. ...which obviously is misleading as the share button is not in a frame. Opening the give url in a new browser tab gives a hint to the real root-cause: Application '34534593617

Categories : Javascript

Share old knitr cache with new .Rnw files
It is possible to reuse a cache but IMHO you have to replicate you simpleExample chunk in your example2.Rnw file. It have to be exactly the same as in example1.Rnw (no different spaces, no different options, ...). example2.Rnw: documentclass[a4paper, 11pt]{article} egin{document} <<setup>>= opts_chunk$set(cache.path = "~/DirectoryOfExample1/cache") @ <<simpleExample, cache=TRUE>>= z<-1+1 @ <<simplePrint, dependson = 'simpleExample'>>= print(z) @ end{document}

Categories : R

How to share files between Grunt targets?
You can pass config into grunt, I havn't tested the below code but it should work I think. I just havn't used the config for keys before, only values. Hopefully it's a start at least. "use strict"; module.exports = function (grunt) { grunt.loadNpmTasks("grunt-contrib-stylus"); var buildConfig = { output: "www/bundle.css", files: ["stylus/*.styl"], }; grunt.initConfig({ config: buildConfig, stylus: { dist: { files: {<%= config.output%>: <%= config.files %>}, options: { compress: true, linenos: false } }, dev: { files: {<%= config.output%>: <%= config.files %>}, options: { compress: false, linenos: true } } } }); grunt.registerTask("dev", ["stylus:dev"]

Categories : Javascript

How to share files and folders with batch
you mixed "net share" and "net use": On the "Server side" you will need net share sharename="c:path oshare" /UNLIMITED on the "client side" you will have to use net use m: \192.168.1.103sharename

Categories : Batch File

How to search for few files out of hundred files in UNIX and if not find replace with 0 byte file
Assuming by shell u mean bash: Skeleton to start with: luk32:~/projects/tests$ cat ./process_files.sh #!/bin/bash DEST=./copies for num in "$@"; do file="AllResponses_"$num"_6_20_2013.txt" if [ -f $file ]; then cp $file $DEST else touch $DEST/$file fi done; It takes numbers as arguments, then tries to find a file with given pattern in current working directory. If found copy to destination folder, else touch the file. You will probably have to tinker a little bit to get friendlier than hard-coded date handling. Example: luk32:~/projects/tests$ ls -l total 40116 -rw-r--r-- 1 luk32 luk32 4 cze 21 11:33 AllResponses_1_6_20_2013.txt -rw-r--r-- 1 luk32 luk32 5 cze 21 11:33 AllResponses_3_6_20_2013.txt -rw-r--r-- 1 luk32 luk32 0 cze 21 11:32 AllResponses_4_6_20

Categories : Unix

Search through directories for specific Excel files and compare data from these files with inputvalues
In answer to the first question "How come I only get one result when I am printing excelfiles()" this is because your return statement is within the nested loop, so the function will stop on the first iteration. I would try building up a list instead and then return this list, you could also combine this with the issue of checking the name e.g. : import os, fnmatch #globals start_dir = os.getenv('md') def excelfiles(pattern): file_list = [] for root, dirs, files in os.walk(start_dir): for filename in files: if fnmatch.fnmatch(filename.lower(), pattern): if filename.endswith(".xls") or filename.endswith(".xlsx") or filename.endswith(".xlsm"): file_list.append(os.path.join(root, filename)) return file_list file_list = ex

Categories : Python

Perl: Read 7 files and search for a word (the name of the files change constantly)
Added loop around file processing, and collecting all log files before that, #!/usr/bin/perl use strict; use warnings; use POSIX 'strftime'; # my $current_date = strftime "%Y%m%d", localtime; # my $filename = "/home/ado/log/log.$current_date"; my @filenames = reverse sort glob("/home/ado/log/log.*"); if (@filenames > 7) { $#filenames=6; } for my $filename (@filenames) { my %output; open my $file, "<", $filename or die("$!: $filename"); while (<$file>) { if (/item_id:(d+)s*,s*start/) { $output{$1}++; } } close $file; for my $item(keys %output) { print "$item->$output{$item} "; } }

Categories : Perl

Automount samba folder on Mac
I followed https://discussions.apple.com/thread/3221944?start=15&tstart=0 The key is setting the mount point in your home directory is by following three steps. Add this line to the end of /etc/auto_master: /- auto_smb Created /etc/auto_smb with the following line: /Users/user/mount -fstype=smbfs,soft smb://domain;user:password@server/folder Run automount: automount -vc The troubleshooting points are: If you encounter "Too many users" you need to review your SMB path for syntax errors. Also be careful of incorrect username / passwords, or passwords with special symbols. e.g. @ would need to be replaced with %40.

Categories : Osx

How to create a bash script that will lower case all files in the current folder, then search/replace in all files?
Something like this should work: #!/bin/bash for file in *.html do lowercase=`echo $file | tr '[A-Z]' '[a-z]'` mv "$file" "$lowercase" for f in *.html do sed -i "s/$file/$lowercase/g" "$f" done done Change *.html to *.<extension> if you're working with something other than html files.

Categories : Bash

Ruby cannot copy files from a remote share
Use cp_r instead of cp: FileUtils.cp_r(remote_path, destination)

Categories : Ruby

samba shares seen in windows, but cannot connect
Add the following to your [global] section: guest account = nfsnobody map to guest = bad user And your public share could look something like: [Backups-Rhonda] path = /raid1/rhonda writable = yes guest ok = yes public = yes force user = root force group = root create mask = 666 directory mask = 666 security mask = 666 force create mode = 666 Make sure to restart the samba service.

Categories : Misc

authenticate against with Active Directory via samba
I recommend you this article http://technet.microsoft.com/en-us/magazine/2008.12.linux.aspx from Microsoft. The configure file seems OK.

Categories : Misc

Alternative for file access in windows share files
The Samba suite provides windows file server functionality for unix systems. Also you might like to look at NFS. Even OCFS2 might be an alternative.

Categories : Linux

How can I share module-private data between 2 files in Node?
I'd like some vars from one file to be accessible from other file, but not from the files external to the module Yes, it is possible. You can load that other file into your module and hand it over a privileged function that offers access to specific variables from your module scope, or just hand it over the values themselves: index.js: var foo = 'some value'; module.exports.additional = require('./additional.js')(foo); module.exports.extra = require('./extra.js')(foo); extra.js: module.exports = function(foo){ // some magic here var bar = foo; // foo is the foo from index.js // instead of assigning the magic to exports, return it }; additional.js: module.exports = function(foo){ // some magic here var qux = foo; // foo is the foo from index.js again // instead of a

Categories : Javascript

How to block uploading executable files in to Alfresco Share?
In the client-side upload.js like flash-upload.js there is a setFileFilters method, which reads from the this.showConfig.filter and from the object itself. The description from the file: * filter: {array}, // limits what kind of files the user can select in the OS file selector I've used this method so a client could upload another type on the action upload new version. Add the .exe to the filter array (read it out first, don't know the exact notation anymore) There is some more info here. But still this doesn't fully prevent users from uploading executable files. They can still use * in their query or if they use drag-drop or webdav/cifs or another client. If you fully want to disable it, just create a Java Behaviour which fires on onCreateNode Policy. Check the mimetyp

Categories : Javascript

How to include multiple class files and .Jar files in class path which exist in sub folders in linux?
Use below command: export CLASSPATH="$CLASSPATH:xyz.jar**:**path_to_abc.jar.jar" You basically have to append to the classpath, all the new entries that you want. To do so, just make use of ':' in linux and ';' in windows.

Categories : Java

qt transfer a file from local to a samba shared
You can not do that QFile just spports local files but you can mount it to a posix folder and access to that folder. You can find a guide about how to mount a samba shared folder here

Categories : C++

iOS file sharing with SAMBA / CIFS protocol
If I understood you correctly you want to connect with your app files via WiFi . Basically you need to open a local server within your app. CocoaHTTPServer may be help you with this issue.

Categories : Iphone

Ho can I copy files from mutible pcs to network share and create a folder?
$branch = 1 Get-Content list.txt | ForEach-Object { if(Test-Connection $_ -Quiet -Count 1){ $branch2 = $branch.ToString() $folder = $_ + $branch2 Copy-Item "\$_c$windows*.ini" "\Networkshare$folder" } $branch = $branch + 1 } The way I understand your question, that should solve your problem. EDIT: Look at this: PS C:> $v1 = "hello" PS C:> $v2 = "world" PS C:> $v3 = $v1 + $v2 PS C:> echo $v3 hello world EDIT 2: Look at the String conversion

Categories : Powershell

python modules: share variables and enable running files
You can create package for game itself and create bin script which will run either client or server. I think such data as default host and port could be stored in settings module settings.py or config.py which will be imported in both client.py and server.py

Categories : Python

Linux Shell .sh, Search Database
I think you are looking for the "-v" option to grep. From the grep man page : -v, --invert-match Invert the sense of matching, to select non-matching lines. So you would have to change your grep command to : grep -il -v 'A' -v 'B' -v 'C'

Categories : Linux

Search for a pattern in a filename in linux
Here's a Perl script (let's call it match7th.pl) that will print out any lines where the 7th field matches the pattern given (e.g. 11A): #!/usr/bin/perl -w use strict; my $pat = qr/$ARGV[0]/; while (<STDIN>) { my (undef, undef, undef, undef, undef, undef, $seventh) = split /_/; print if defined($seventh) && $seventh =~ $pat; } Run it like this: find . -name '*.png' | perl match7th.pl 11A

Categories : Linux



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