Search This Blog

Monday, May 28, 2012

Laser chess source code (c++ and cilk++)

Here is the source code of game named laser chess (computer vs human) written in c++ and cilk++ so as to run it on super computer. In order to run this code you should install cilk++. This program can also be run on normal pc where the code will be same as running it on single core of a computer. For running it on super computer you can refer to intel's cilk++ guide. To run it on normal pc, just install cilk++ on your machine and run it. More details can be found inside manual provided along with the source code.

Manual: Laser chess
Laser chess source code (parallel version)

Serial version of this game can also be found on git@github.com:sanketp123/Laser-chess.git .


Installing and Uninstalling ubuntu kernel


Steps for installing ubuntu kernel 

  • Get the source code  
          apt-get source linux-image-$(uname -r)
  • Perform this step only for the first time you build kernel.
          Downloading dependencies
          sudo apt-get build-dep linux-image-$(uname -r)
  • Building kernel 
  • Now move inside the downloaded kernel directory and type following commands.
    fakeroot debian/rules clean
    fakeroot debian/rules binary-headers binary-generic
After this step, 3 files with .deb extension would be generated in the parent directory of your current folder. Install them using this command
  •  sudo dpkg -i linux*2.6.38-7.37*.deb
  •  Now reboot. After rebooting you can do uname -r to check whether you have booted into new kernel.  


Steps for uninstalling ubuntu kernel   

  • Open the Synaptic package manager. If its not present you can at first install it.
  • Now check your current kernel version using uname -r . Or just make a note of the kernel version which you want to remove.
  • Now inside Synaptic package manager you will find "search". Inside that type 'linux-image'. 
  • After that you will see different kernel images which are installed in your pc.
  • Now select the one which you want to remove and mark it for removal.
  • After that apply the changes to remove that kernel version.

Sunday, July 31, 2011

Configure a system to use an existing LDAP directory service for user and group information

#system-config-authentication
Then select "ldap"
Enter base dn and ldap server name
Download certificate by entering given url.
select authentication method

Diagnose and address routine SELinux policy violations

Use either of the given below files to check logs
/var/log/audit/audit.log
/var/log/messages
#sealert

Use boolean settings to modify system SELinux settings

To find boolean selinux of a service
# getsebool -a | grep servicename
eg:
# getsebool -a | grep http

Change boolean
#setsebool -P [boolean = ]
eg:
# setsebool -P httpd_enable_homedirs=1

Restore default file contexts

#restorecon -R filename

List and identify SELinux file and process context

List file context
#ll -Z filename

SELinux uses three different contexts to enforce security: user, role, and domain

User context:
unconfined_u Unprotected user
system_u System user
user_u Normal user

Role context:
object_r File
system_r Users and processes

Domain context:
unconfined_r Unprotected file or process

To see Process context
#ps -Zl