w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Create a symbolic link (or other NTFS reparse point) in Windows Driver
There isn't direct API to create reparse points. You need to use ZwFsControlFileZwFsControlFile() to send FSCTL_SET_REPARSE_POINT ioctl with appropriate input buffers and parameters. Don't have example though!

Categories : Windows

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

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

Mount Windows shared filder to AIX
Two options 1) The easiest would be to install the bos.cifs fileset and use smit to mount the share as a filesystem: http://www-01.ibm.com/support/docview.wss?uid=isg1fileset-1244257370 2) I would not recommend this for "newbies", but you may have better luck getting this to work by installing samba: www.samba.org

Categories : Unix

mount remote windows share from centos
The mount.cifs file is provided by the samba-client package. This can be installed from the standard CentOS yum repository by running the following command: yum install samba samba-client Once installed, you can mount a Windows SMB share on your CentOS server by running the following command: Syntax: mount.cifs //SERVER_ADDRESS/SHARE_NAME MOUNT_POINT -o user=USERNAME SERVER_ADDRESS: Windows system’s IP address or hostname SHARE_NAME: The name of the shared folder configured on the Windows system USERNAME: Windows user that has access to this share MOUNT_POINT: The local mount point on your CentOS server I am mounting to a share from \10.11.10.26snaps Make a directory under mount for your reference mkdir /mnt/mymount Now I am mounting the snaps folder from indiafps02, User

Categories : Linux

How to rename a MOUNT (mounted shared folder from Windows named mnt)
Follow these steps: Unmount: umount /mnt Create another folder /my_new_mount Mount again: mount -t cifs -o username=myusername,password=mypassword //10.80.50.50/Share /my_new_mount Update in /etc/fstab

Categories : Linux

git - dual boot ubuntu and windows with separate data partition
I'm guessing there's an issue with line endings. You probably have commited your code with windows line endings and when you checked out the code in ubuntu git converted those to unix style line endings. Take a look at this page Dealing with line endings

Categories : Windows

Write C++ on Windows but use Linux System calls through a Linux emulator
You've already tagged your question with Cygwin. That seems like the best solution for what you want. Cygwin is basically a collection of programs which emulate a GNU/LInux environment through the use of a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality. Here's the link to the documentation for its API Edit: Most of the Cygwin source code that I've looked at is written in C++ and makes system calls using MS Windows API to do provide the *nix emulation. The source is well written and very readable (even to to a non-C++ programmer such as myself). I think using Cygwin would be a good transition from programming on Windows to a GNU/Linux environment.

Categories : C++

Hoare partition : is this implementation more/less efficient than the standard partition algorithm?
I always prefer the standard Hoare's implementation. If you look at it, it is not very intuitive, but it has a visible advantage: Less number of swaps. While your implementation effectively always does exactly N comparisons and N swaps, the Hoare's implementation does only N comparisons, but it does not swap anything if it is not needed. The difference is significant in some scenarios. At first in a case you use environment where swaps or assignment of variables/objects is a costy operation. For example if you use C/C++ with arrays of objects. Another typical examples where Hoare's partition implementation performs better if when many of the items in your array are of the same value or when the array is almost sorted and needs just to swap a few items. In that cases Hoare's version perfor

Categories : Matlab

After new partition gets created insert partition info in another table through trigger
You can do it with DDL Trigers. Check out this link One important note from the author you should consider adding a partition is not DDL if Oracle decides to do it internally, it’s only DDL if it’s an end-user statement Implicit partition creation is a new feature of 11g and it reffers to the interval partition option.

Categories : Oracle

How to get to last NTFS MFT record?
The MFT location isn't always fixed on the volume. You should get the starting MFT offset from the boot sector (sector 0 of the volume, you can find the structure online). The first file in the MFT is the "$MFT" file which is the file record for the entire MFT itself. You can parse the attributes of this file like any other file and get it's data run list. When you know the size of each fragment in clusters, parse the last cluster for each 1024 byte record of the last fragment (although I believe a fragmented MFT is rare). The last record in the MFT is the last record in that particular cluster marked "FILE0", if you encounter a null magic number that would be 1024 bytes too far. Or you can just get the file size from it's attributes and calculate the offset to the end of the MFT based o

Categories : Windows

MySQL table Partition with FLOOR function (partition function not allowed)?
MySQL documents the partitioning functions here. The floor() function appears to have some special considerations. In this case, I think the issue might be that the division is returning a float/double result rather than a decimal result. This is easily fixed in your case because you do not need to do the division: CREATE TABLE `fact_events` ( `event_key` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `event_type_key` tinyint(3) unsigned NOT NULL, `analytic_file_id` bigint(20) unsigned NOT NULL, `sdk_session_id` bigint(20) unsigned NOT NULL, `virtual_button_create_id` bigint(20) unsigned NOT NULL, PRIMARY KEY (`event_key`), KEY `idx_events_event_type` (`event_type_key`) ) PARTITION BY RANGE(event_key) ( PARTITION p0 VALUES LESS THAN (0), PARTITION

Categories : Mysql

NTFS vs. File Share
Short answer: No. In Windows each file and directory has an ACL controlling access to it. Each file share also has an ACL controlling access to the share. When you access a remote file through a share you are doing so using the credentials used to login to the local computer. (You can connect using different credentials by entering a username/password when connecting). The remote computer tests the supplied credentials against the ACL on the share. Once you are past that, then every file you attempt to access on the remote machine through this connection will be checked using your credentials against the ACL on the file and the share. This allows a file share to offer more restricted access to some files than if the same user were attempt to access them locally. (So you could share file

Categories : Misc

NTFS - file record size
It's not actually that much of a waste. You should try to look at what happens when the number of attributes stored in the file record exceeds 1 KB. (by adding additional file names, streams, etc.) It is not clear (to me at least) for different versions of NTFS if the additional attributes are stored in the data section of the volume or in another File Record. In previous versions of NTFS the size of a MFT File Record was equal to the size of a cluster (generally 4KB) which was a waste of space since sometimes all the attributes would take less than 1 KB of space. Since NT 5.0 (I may be wrong), after some research, Microsoft decided that all MFT File Records should be 1KB. So, one reason for storing that number may be backwards compatibility. Imagine you found an old hard drive which stil

Categories : File

What is the difference between HDFS and NTFS and FAT32?
... Because NTFS and FAT aren't Distributed. The advantage of HDFS is that it is. See the HDFS Introduction.

Categories : Hadoop

NTFS Journal USN_REASON_HARD_LINK_CHANGE event
As always with the USN, I expect you'll need to go through a bit of trial and error to get it to work right. These observations/guesses may, I hope, be helpful: When the last hard link to a file is deleted, the file is deleted; so if the last hard link has been removed you should see USN_REASON_FILE_DELETE instead of USN_REASON_HARD_LINK_CHANGE. I believe that each reference number refers to a file (or directory, but NTFS doesn't support multiple hard links to directories AFAIK) rather than to a hard link. So immediately after the event is recorded, at least, the file reference number should still be valid, and point to another name for the file. If the file still exists, you can look it up by reference number and use FindFirstFileNameW and friends to find the current links. Comparin

Categories : Windows

Viewing Ciphertext of Encrypted File on NTFS (EFS)
The way you open an encrypted file in order to read its raw encrypted contents (e.g. for a backup/restore application) is to use the: OpenEncryptedFileRaw, ReadEncryptedFileRaw, WriteEncryptedFileRaw, and CloseEncryptedFileRaw api functions. Writing the code on the fly, in a hypothetical hybrid language: void ExportEncryptedFileToStream(String filename, Stream targetStream) { Pointer context; res = OpenEncryptedFileRaw("C:UsersIanwallet.dat", 0, ref context); if (res <> ERROR_SUCCESS) RaiseWin32Error(res); try { res = ReadEncryptedFileRaw(exportCallback, null, context); if (res != ERROR_SUCCESS) RaiseWin32Error(res); } finally { CloseEncryptedFileRaw(context) } } function ExportCallback(pbData: PBYTE, pvCallbackCo

Categories : Windows

NTFS sparse file data runs ($UsnJrnl)
No, it means that $UsnJrnl occupies 2576 clusters on disk. Sparse clusters don't occupy any space on disk, if you'd try to read sparse cluster, e.g. cluster 10 in your example, NTFS just returns zeros. Generally, you can't determine start and end cluster of the file, since files can be fragmented - your example says that first 1408 clusters are not allocated on disk at all, then 128 clusters of that file occupy disk clusters 510119 - 510247, then 2448 clusters of the file occupy disk clusters 256 - 2704; so in this case you can't say that file begins by cluster X (on disk) and ends by cluster Y (on disk) - it's possible only if file is not fragmented (when it uses only one cluster run).

Categories : Windows

access to ntfs stream for a very long filename fails
As the very helpful page on CreateFile says referring to the lpFileName parameter which specifies the filename: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "?" to the path. Since you are contemplating BackupRead obviously you are wanting to access this stream programatically. If so, test things programatically. Trying all these operations from the command prompt is a crap-shoot and will not establish anything more than the ability to perform such operations from the command prompt. With that in mind, let's try this simple program - boilerplate code removed: #include "stdafx.h" int APIENTRY _tWinMain(HINSTANCE, HINSTAN

Categories : Windows

How does NTFS handle the conflict of short file names?
NTFS won't create two short names like that. The first will be THISIS~1.txt and the second will be THISIS~2.txt. For example, open a command prompt and from the root of C: drive type C:>dir prog* /x /ad<Enter> On a Windows 7 64-bit system you will see output similar to this 03/28/2013 12:24 PM <DIR> PROGRA~1 Program Files 07/31/2013 11:09 AM <DIR> PROGRA~2 Program Files (x86) 12/10/2012 05:30 PM <DIR> PROGRA~3 ProgramData

Categories : Windows

How to make Gradle stop trying to chmod MANIFEST.MF on an NTFS drive
Gradle is trying to set default permissions for that file, and I can't see a way to stop it from doing that. (You could make it set different permissions, but I guess that won't help.) Under Windows/NTFS this normally works just fine, so it might be a problem with you Linux NTFS driver or configuration.

Categories : Linux

getaddrinfo() - Linux VS Windows
There are these magical things called man pages. For example, man 3 getaddrinfo clearly says that If the AI_PASSIVE flag is specified in hints.ai_flags, and node is NULL, then the returned socket addresses will be suitable for bind()ing a socket that will accept() connections. The returned socket address will contain the "wildcard address" (INADDR_ANY for IPv4 addresses, IN6ADDR_ANY_INIT for IPv6 address). The wildcard address is used by applications (typically servers) that intend to accept connections on any of the hosts's network addresses. If node is not NULL, then the AI_PASSIVE flag is ignored. The purpose of the getaddrinfo() function is simple: it tries its best to convert user-specified strings into numeric data an application can use to create a socket, eit

Categories : C

Native windows Linux
As wine demonstrates, the PE format isn't really the problem with compatibility. PE only defines how the program is pieced together at load time. Under windows, RUNDLL interprets it, loads all the program sections to memory, loads all the supporting dlls to memory and patches up the function pointers so that there is a program sitting in memory ready to go. (See http://msdn.microsoft.com/en-us/library/ms809762.aspx for more details. Its a good read!) There is little stopping you writing a kernel module to do all of this. With the details in the page linked above it may not be to hard and someone may already have done it. The real issue is the fundamentals of the operating system. Even if linux could load a PE, there would be problems around the fundamental difference in file names

Categories : Linux

How to get windows size from Linux
The issue has nothing to do with PuTTY per se, and everything to do with SSH clients and pseudoterminals in general. To avoid this issue, configure your PuTTY to use a pseudoterminal. (In the TTY panel, there is a "Don't allocate a pseudoterminal" checkbox. Make sure it is not checked.) With ssh, you need to use the -t option to tell ssh to use a pseudoterminal. Here is a simple example program you can use in Linux to obtain the terminal size. It does not require curses: #include <unistd.h> #include <sys/ioctl.h> #include <errno.h> #include <stdio.h> static int get_size(const int fd, int *const rows, int *const cols) { struct winsize sz; int result; do { result = ioctl(fd, TIOCGWINSZ, &sz); } while (result == -1 &&

Categories : C

XOR Crypt with Linux & Windows different
I'd guess this is an encoding issue: the charset might be different on windows and linux. I'd suggest byte[] bytes = s.getBytes(charset); ... return new String(bytes, charset) , where charset is some explicit charset.

Categories : Java

Windows and linux max threads
Linux, it's pretty easy. cat /proc/sys/kernel/threads-max Windows, less so. Basically it depends on how much ram you have / how much you allocate on each thread's stack - see What's the maximum number of threads in Windows Server 2003?; but basically <1000

Categories : C++

Use C#.Net Windows application on other platforms like Mac and Linux
Well for cross-platform .NET you can look at the Mono project. Mono is a software platform designed to allow developers to easily create cross platform applications. Sponsored by Xamarin, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of Linux applications.

Categories : C#

Detect OS and Java on Windows and Linux
You can use profiles for such purposes like this: <profiles> <profile> <activation> <os> <name>Windows XP</name> <family>Windows</family> <arch>x86</arch> <version>5.1.2600</version> </os> </activation> ... </profile> </profiles>

Categories : Maven

Difference in files on windows and linux
I think this has something to do with the encoding. On your server try to run with -D parameter and setting the file.encoding property. (java -Dfile.encoding=Something ...)

Categories : Java

qt linux "QMAKE_CXXFLAGS += -std=c++11" equivalent for windows?
For my qt project on Windows I have used "QMAKE_CXXFLAGS += -std=c++0x" for new-standard features. MinGW 4.8 (supports many c++11 features) you may download here.

Categories : C++

convert charset in windows and linux
It seems the encoding of the output is controlled by the encoding of the source file. Unless specified at compile time (How can I specify the encoding of Java source files?), the default encoding is inherited from the OS. I am guessing the Windows machine you used had a default encoding that caused the output you are expecting, while the Linux machine did not. See this question for a similar issue reported - Charset of Java source file and failing test. I was able to reproduce the behavior. Also found a fix - changing the encoding of the source file. Read on for details. I ran the following code in two different encodings. System.out.println(Charset.defaultCharset().toString()); byte[] data = new byte[] {9, 22, 9, 65, 9, 54, 9, 22, 9, 44, 9, 48, 9, 64}; System.out.println(Arrays.toStri

Categories : Java

Send command via FTP from windows to linux
ftp is just for file transmission. If you want to execute commands on the box you'll have to use ssh If you are on windows putty would be an interactive approach for that. If you are searching for an automated solution, you could install cygwin (+ ssh client)

Categories : Linux

A single makeFile-Windows/Linux/Mac OS
You can use cmake - it's a cross platform tool which generates makefiles or projects files with respect to your platform. So instead of writing Makefile you write CMakeLists.txt, then you run cmake and it will generate Makefiles. When you want to compile your program on another platform you just ru-run cmake with different target project system.

Categories : C++

Syntax error on Windows and not on Linux
Accessing an array index directly from a return value was added in PHP 5.4 hence why you are getting a syntax error with version 5.3. You'll need to save the return value from the function to a temporary variable and then access the index you want. Something like: $tmp_array = array_reverse( explode( '/' , $dir_widgets ) ); $tmp_array[1] ...

Categories : PHP

PHP Connect to MSSQL From Both Linux and Windows
No, there is not a single way however it would be trivial to do something like this: if ('Linux' === PHP_OS){ $pdo = new PDO("dblib:dbname=$database_name;host=$database_server", $username, $password); }else{ // $pdo = whatever you're using on your Windows box now. } You will need to set up your odbc.ini, odbcinst.ini and freetds.conf files on the Linux server as well.

Categories : PHP

Function chmod in windows os no like in linux
This function returns the permission bits from the input in octal, so if file permissions on Windows worked the same as on Unix this would work for you: function convertperm($num) { return 0777 & decoct($num); } However, Windows is not Unix: The execution permission you get from stat depends on the file name extension. The Windows version of chmod can only be used to make a file read-write or read-only; you can't remove the "read" permssion. Also, there are no separate permissions for "owner", "group", or "other" since the Unix concept of user groups does not exist on Windows. For example, for 33060 the above function return 444, indicating read-only permissions. If you had set the permissions to 777 in theory you should get back 666 (Windows chmod ignores the execute bit), so

Categories : PHP

Connecting iOS app to Windows/Linux apps
Without any details of the application or frameworks its hard to be more than vague and point you in the right direction. If you have already explored Bonjour/Zeroconf to connect the iPhone to the server, I'd keep looking down that path. The first place to look is PyBonjour for how to broadcast the server from Python. Although there are a few issues in how to configure this on Windows vs. Mac vs. Linux, this will be slight. For example, for windows the user will need to install Bonjour for Windows, where as Linux users will need Avahi, but most of this can be setup durin install. Secondly, look at the Bonjour documentation for iOS, which will be much easier as its all built into the system and APIs. From here both server and client are discoverable to each other. The last issue is deter

Categories : Python

Serial communication between linux and windows
If you are using the ReadFile and WrietFile on Windows and read and write in Linux, it shouldn't really matter what the line-endings are, other than "you have to translate it at some point after receiving it. This doesn't look right: while(read(_fd_port_no,buffer+_buffer_len,sizeof(buffer))>0) { _buffer_len = _buffer_len+sizeof(buffer); } You should take into account the size of the read returned by read. And if sizeof(buffer) is the actual buffer you are reading into, adding +_buffer_len, when _buffer_len >= sizeof(buffer) will write outside the buffer. Also slightly worried about this: options.c_iflag |= (IXON | IXOFF | IXANY); options.c_cflag &= ~ CRTSCTS; Are you SURE you want a XOFF/CTRL-S (0x13) to stop flow? Usually that means that data with CTRL-S

Categories : C++

Moving from Qt 4.x (Ubuntu Linux) to Qt 5.1 (Windows 7)
Use this in your .pro file. QT += ... greaterThan(QT_MAJOR_VERSION, 4): QT += widgets The Qt modules have been rearranged somewhat in Qt5. Also this will teach for leaving Linux!

Categories : C++

TideSDK packaging on mac for windows or linux
The Service Platform described in above comment is the upcoming product TideKit (http://tidekit.com) It is a brand new product which is specifically designed with keeping interest of all developers in mind. Checkout the teaser video for TideKit at http://www.youtube.com/watch?v=aE7gN-d0GhU The registrations of TideKit are starting soon. Regarding your question from the log you have pasted you are trying to build a network installer. Currently only Bundled Installer (Package With Runtime) option is supported. You should be able to generate the installer using "Package with Runtime" option.

Categories : Windows



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