Skip to main content

Posts

Showing posts with the label windows

Make CentOS 6.x an AD member of Windows IIS 2012 R2

Making a CentOS 6.x PC a domain member of an active directory is a tiresome work. I came across this painful task for several time and comes in a conclusion that atleast I will make a document which will be helpful to me in near future. On the meantime if anybody take this step for their use, I wouldn't mind. So I will go to the task step now -- i) First of all we need some basic (latest) software for making this task possible. They are -- 1. Samba 2. Samba-client 3. Samba-winbind 4. Krb5-workstation 5. Policycoreutils-python command for the task on console -- yum install -y ntpdate samba samba-client samba-winbind krb5-workstation policycoreutils-python   ii) Now it's time to make the windows active directory reachable from the centos PC. For that we need to add the active directory FQDN and IP address on resolv.conf So do it by opening file  /etc/resolv.conf and add the following --     domain ad.local     nameserver...

How to make your laptop as wifi hotspot

Requirement: System: Wifi Supported System. OS: Windows 7 (Virtual wifi router available on only >= 7 OS) How: Step 1: Click Start, type cmd , right-click the cmd.exe link and select "Run as Administrator". Step 2:  Now type the following command -- netsh wlan set hostednetwork mode=allow ssid=MyWifi key=Password Password must be  (8 <= length) Step 3: Now enable your virtual wifi by -- netsh wlan start hostednetwork  Step 4: Now share your current networks' internet to the virtual wifi. For this go to -- control panel --> Network and Sharing Center -->Change Adapter Settings Step 5: Now Select your current local area connection and by double clicking on the icon go to the status window .                                          ...

Samba Centos root share error - You do not have permission to access in windows

Description: You have a Centos PC and trying to access the root user's Desktop from a Windows PC. You can see the shared folder in the \Network\Centos_PC_IP, but can't access the folder when you double click. The pop window arise with a error - You do not have permission to access in windows \\CENTOS_IP\\root. Contact your network administrator to request access.   Solution:   First you need to check you samba settings in your centos pc by command -   testparm   After that you need to do a little change o your /etc/samba/smb.conf file. Find the folder you shared from root in this file. It will be like -- [root] path = /root/Desktop read only = No Change it to - [root]   force user = root force group = root  path = /root/Desktop read only = No  And restart the samba by -- /sbin/service smb restart   And you are d...

How to share (read/write) any folder with root permissions in centos 6 or linux

Question: Now a days many people like software developers uses 2 or more OS. So the people who have multiple PC's with different OS need to share the files or folder between them. So how? Solution: Requirement: i.  Samba ii. LAN connection Step 1. Install samba by giving command in centos console -    yum install samba Step 2. Configure samba by opening smb.conf  vi /etc/samba/smb.conf i. Create a workgroup in which you are going to share the files/folders. by default it is like - workgroup = MYGROUP change it to -                                  netbios name = your_host_name workgroup = workgroup because windows system has default group named as WORKGROUP . ii. Now create a shared resource , wher...

Best design for windows multi thread in a c++ class

ISSUE: How to create windows multi-threaded program in  c++ ? SOLUTION:   Now a day maximum project or software has multiple process running at a same process.Or a gui application needs to do some work on background which is blocking. Or may be you are going to design or create a network application ,so it becomes mandatory to be an expert of Threading now a days. Here is  the template which I follow. In header file add the followings -- #include <Windows.h> static UINT __cdecl CallingFunctionForThread ( LPVOID pParam ); UINT WorkingFunction ();   In CPP file add the followings -- UINT __cdecl My Class :: CallingFunctionForThread ( LPVOID pParam ) { My Class * pMy Class = reinterpret_cast < My Class *>( pParam ); UINT ret = pMy Class -> WorkingFunction (); return ret ; } UINT My Class :: WorkingFunction () { // You can do anything as a class member function and run it on your thread. } Start ...

How to compile or Run lucene Indexer source code in windows.

1.First extract lucene 1.9.0 src.zip. 2.Then Create class by Jcreator pro.Which is Indexer.java. 3.Save this file to \lucene-1.9-final\src\java folder of lucene. 4.Add these things to import-----> import org.apache.lucene.analysis.standard.*; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.queryParser.ParseException; import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.*; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import java.io.FileReader; import java.io.IOException; in .java top. 5.Now run it or compile it so class is create. 6.This is comand based code,so compile it from cmd. for cmd compilation >>> 1.Go to the disc it contain by   C:\Documents and Settings\sharma>D: 2. D:\>  cd D:\lucene-1.9-final\src\java       ...