Tuesday, July 24, 2012

Sharing using SAMBA on fedora 17

  1. Install SAMBA in fedora 17:
    • $ sudo yum install system-config-samba samba-client samba-common samba system-config-samba system-config-users
  2. Set SElinux permissions:
    • $ sudo yum install policycoreutils-gui
    • in gnome go to Administration > SELinux Management and check (set) the following booleans
      • Allow qemu to share any file/directory read/write
      • Allow samba to share users home diectory 
      • Allow samba to export ntfs/fusersfs volumes
  3. Configure Firewall :
    • check the samba box in System > Administration > Firewall
  4. Configure SAMBA:
    1. Adding users:
      •  Go to System > Administration > Samba > Preferences > Samba Users > Add User
      •  Then to edit the Samba share that was created earlier, click on the share then > File > Properties > Access > Give access to users or choose to give access to everybody.
    2. Sharing user's HOME directory:Here is configuration file /etc/samba/smb.conf
      (NOTE: make changes in above file look as bellow and do not change other options, leave other settings as it is)

      ########## PART of smb.conf file #############
      #=======Global Settings=======
      [global] 
      workgroup = WORKGROUP
      server string = YOURSERVER
      netbios name = YOURSERVER
      interfaces = eth0 192.168.92.3/24
      # ----------------------- Standalone Server Options -------------------
      security = user
      #------------------------ Name Resolution -------------------------------
      wins support = yes
      #========= Share Definitions ===========
      [homes]
          comment = Home Directories
      ;   browseable = yes
          writable = yes
          valid users = %S

      [your_share]
          path = /path/to/your_share
          read only = no
          browseable = no
          valid users = username
      #######################################
       
    5.  Accessing share:
    • Access users HOME sharing:

      In windows go to Run> \\YOURSERVER\samba_username

      Enter your username and password of samba user.
    • Auto mount as Network drive:
      Right-click on computer>Map network drive

      choose Drive from drop down (e.g. L:)

      At Folder enter \\YOURSERVER\samba_username to access home directory share or enter \\YOURSERVER\your_share to access shared directory.

Monday, July 23, 2012

Installing openGL on Fedora 17

Steps to install openGL on fedora 17:
Installing:
 $sudo yum install freeglut-devel build-essential  
Compiling sample program:
  1. Get sample programs from SAMPLE  PROGRAMMS
  2. Makefile:
 LDFLAGS=-lglut -lGL -lGLU -lX11 -lm  
 INCLUDES=-I/usr/include  
 LIBS=-I/usr/lib  
 CC=gcc  
 SOURCES=wave.c teapot.c logo.c  
 TARGETS=$(SOURCES:.c= )  
 DEPS=  
 OBJS=$(SOURCES:.c=.o)  
 %.o: %.c $(DEPS)   
  $(CC) -c -o $@ $< $(INCLUDES) $(LIBS) $(LDFLAGS)  
 wave: $(OBJS)  
  $(CC) $@.o -o $@ $(INCLUDES) $(LIBS) $(LDFLAGS)  
 teapot: $(OBJS)  
  $(CC) $@.o -o $@ $(INCLUDES) $(LIBS) $(LDFLAGS)  
 logo: $(OBJS)  
  $(CC) $@.o -o $@ $(INCLUDES) $(LIBS) $(LDFLAGS)  
 .PHONY: clean  
 clean:  
  rm -f $(OBJS) $(TARGETS)  
E.g. Compiling  wave.c
 $make wave  
Running program:
E.g. To run wave.c program
 $./wave  
             

Tuesday, April 24, 2012

Grep excluding .svn directories


  1. Temporary/one-time  solution:
grep -Rin "what r u looking for" *|grep -v "\.svn/*"
     2. Permanent solution (for Ubuntu/Linux) - add following line to ~/.bashrc
export GREP_OPTIONS="--exclude=*\.svn*"

Monday, April 16, 2012

Linux Kernel Cross-compilation for ARM based systems

Here is the link for small presentation regarding cross-compilation of Linux kernel for arm based systems. Presentation also includes guide for how to edit existing Linux drivers to adapt to your application.


link : Linux Kernel Compilation-ARM

Sunday, April 8, 2012

Download Youtube Videos on Linux (Behind Proxy)

  • Install youtube-dl
    • Ubuntu: sudo apt-get install youtube-dl
    • Fedora: sudo yum -y install youtube-dl
  •  Open terminal and export http_proxy
    • export http_proxy=http://username:passwd@proxy.com:port_num/
              ( escape spacial characters in password by '\')
  • Download videos
    • youtube-dl  --all-formats url-of-video

Wednesday, November 30, 2011

C Program to find endianness ...


#include stdio.h

typedef union s{
int i;
char c[4];
} Utype;

int main()
{
Utype u;
char c;
u.i = 0x12345678;
printf(" %p - 0x%X\n", &u.i, u.i);
printf(" %p - 0x%X\n", &u.c[0], u.c[0]);
printf(" %p - 0x%X\n", &u.c[1], u.c[1]);
printf(" %p - 0x%X\n", &u.c[2], u.c[2]);
printf(" %p - 0x%X\n", &u.c[3], u.c[3]);

c = (u.i & 0x00000078);

if(c == u.c[0])
printf("\n***LITTLE ENDIEN***\n");
else
printf("\n***BIG ENDIEN***\n");
}

Friday, November 11, 2011

Python Digital Circuit Simulator

             If anyone is looking for the digital circuit simulator in python can refer to my project on google code hosting Pydlcs. It provides basic digital elements like AND, OR gates, some combinational  elements (e.g. half/full adder, mux/demux) and sequential elements (e.g. D-flipflop). You can create and simulate any digital circuit using this basic elements in this simulator.


HAVE FUN  :)