Skip to main content

Posts

Showing posts with the label linux

Install VLC in Centos or Unix

Step 1:  Open linux console in root . Step 2: Go to the yum directory by - cd /etc/yum.repos.d/ Step 3: Get the yum repository for VLC by the following command - wget http://pkgrepo.linuxtech.net/el6/release/linuxtech.repo Step 4: Now install by yum --           yum install vlc . You are done!

How to copy file from and to remote PC in linux, centos

Case 1: How to downloading or copying file from remote PC? Ans: Do it by the following  command -- scp -r user@remote_pc_ip:/path/to/downloadable/file  /your/pc/path After that the command line will ask for password. Give it and download the file. Case 2: How to upload or copy file to remote PC? Ans: Do it by the following  command -- scp -r  /your/pc/path/for/file  user@remote_pc_ip:/path/to/upload/a/file After that the command line will ask for password. Give it and upload the file.

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

Multithreading in C in Different CPU core

# define _GNU_SOURCE # include <stdio.h> # include <math.h> # include <stdlib.h> # include <pthread.h> # include <stdlib.h> pthread_mutex_t mux = PTHREAD_MUTEX_INITIALIZER; struct p2p{ int st; int en; }; void *primeChk(void* val); int main() {   pthread_t thread1,thread2,thread3,thread4;   struct p2p valu1,valu2,valu3,valu4;   int j,ret1,ret2,ret3,ret4;   cpu_set_t cpuset; // pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);   valu1.st = 1;   valu1.en = 5000;   valu2.st = 5001;   valu2.en = 10000;   valu3.st = 10001;   valu3.en = 15000;   valu4.st = 15001;   valu4.en = 20000;    // initialization    CPU_ZERO(&cpuset);    CPU_SET(0,&cpuset);    pthread_setaffinity_np(thread1, sizeof(cpu_set_t), &cpuset);    ret1 = pthread_create(&thread1,NULL,&primeChk,(void*)&valu1);    //CPU_ZERO(&cpuse...