Skip to main content

Posts

Showing posts from September, 2013

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...

How to start or open new activity or window from one window on button click

Requirement: You want to make an "app", which displays a login screen, and users can log in. If the login is correct,  open a new window, where users can do other staff. Then how can you do this? Ans: Step 1. Create a layout xml for the new window. In my case I have created one named newwindow.xml . The entry are as follows -- <?xml version="1.0" encoding="utf-8"?> <Gallery xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="#9999FF" >    </Gallery> Step 2. Create a class with extending Activity . Step 3. On that new class add -- public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.newwindow);     } Here newwindow is the lay...

How to add button action for multiple button in android

In android it is extreme necessary to use button and do many thing on click or touch of this button. So how you can do this ? Ans:   It's pretty simple! Just find out the -- findViewById(R.id.dummy_button).setOnTouchListener( mDelayHideTouchListener ); It is generated by default in new android sdk. The bold portion is the touch listener for button which is implemented on bellow of your main activity class. You can do your thing on overriden function OnTouch . If you want to do it for click and many button here is the way -- findViewById(R.id.dummy_button).setOnClickListener( ButtonListener ); View.OnClickListener ButtonListener = new View.OnClickListener(){         public void onClick(View view) {             switch (view.getId()) {                 case R.id.dummy_button:     ...