Explore

Loading

Friday, March 30, 2012

Linux Powered Real Star Trek Tricorder

If using a Star Trek Tricorder in real life is in your all time wish list, then probably its time to put a check mark in front of it. Peter Janson, a PhD student of cognitive science, McMaster University, Hamilton, Ontario has created his own Tricorder device which much or less works same as the Star Trek Tricorder. It is an open source project, so you can also make your own Tricorder!

 Peter started the tricorder project in 2007 and he has developed several models till now under TAPR non-commercial hardware license. First model named Tricorder Mark 1 was the preliminary experiment whose domain was limited to take atmospheric, electromagnetic and spatial measurements. The next model i.e. Tricorder Mark 2 was more sophisticated as it was powered by Debian Linux which runs on ARM920T based Atmel micro controller. It also featured OLED resistive touchscreen panel and a rechargeable lithium polymer battery. Reportedly plan for Mark 3 was dropped due to some reasons and currently Peter is working on Tricorder Mark 4. On the official website of “the Tricorder Project”, Peter wrote, “I think for me, it’s really about curiosity.  And helping to find ways to see and intuitively visualize the world around us, to help share that curiosity, and get folks excited about science.”

Full story:http://www.crazyengineers.com/linux-powered-real-star-trek-tricorder-it-is-so-real-2011/

Second Edition Linux Book Released

TSTC Publishing announces the release of the second edition of the Guide to the Secure Configuration of Red Hat Enterprise Linux 5, which provides security recommendations for the RHEL 5 operating system for system administrators. Readers may also want to buy the book bundled with Introduction to Linux: A Hands-On Guide. 

Guide to the Secure Configuration of Red Hat Enterprise Linux 5 made its second edition debut on March 21. The book provides security recommendations for the Red Hat Enterprises Linux (RHEL) 5 operating system for system administrators. The guidance provided is applicable to all variants of the system including desktops, servers and advanced platform. The book includes chapters on system-wide configuration and services. Screen shots are included with the majority of directions to help the reader to better understand.
The book also can be bundled with Introduction to Linux: A Hands-On Guide (also available separately), which offers an inside look at computing for those who are acquainted with the basic system administration skills for Unix-like systems, as well as those with some familiarity with documentation and administration conventions for the RHEL 5 operating system.
Introduction to Linux: A Hands-On Guide begins with a history of Linux and includes chapters on file systems, processes, networking, and sound and video. At the end of every chapter are exercises and chapter questions to assist in clarifying the material.
Features of the books include numerous screenshots, detailed instructions of everyday tasks and information written by a Linux audience for a Linux audience.

More on:http://www.prweb.com/releases/2012/3/prweb9347448.htm

 

Saturday, March 17, 2012

Android:Google nexus tablet with asus

A Google Nexus tablet is all set to go, an Android enthusiast site claims. And it's even cheaper than the Kindle Fire, so the story goes.

The latest scuttlebutt about the rumored Google tablet makes the case with a lot more certitude. In fact, an Android enthusiast site goes so far as to say it's a "done deal," citing sources. The Asus MeMo 370T which appears to be the template for the Google tablet--has been "scrapped after Google contracted with Asus to produce their 'Nexus tablet,'" the report begins.
"Earlier reports said the device would retail for $199-$249, but we are now told the target price is $149-$199." That of course lands it right in Amazon's wheelhouse: the Kindle Fire has been a hit due, in no small part, to its $199 price.

Credits:http://news.cnet.com/8301-13924_3-57399239-64/google-nexus-tablet-a-done-deal-claims-report/

Thursday, March 15, 2012

Trackpad Patent Hints Google May Bring Android to Desktop

Android on your desktop? That's what some are taking away from Google's latest patent application.
Google's already got a web-based desktop OS but is the search giant considering taking Android to the desktop too? A patent filed by Google recently indicates that this could be the case.
First spotted by Patently Apple, the patent filing details that, though certain applications or OSes have been designed around a touchscreen UI, it may be beneficial to allow such applications and operating systems to be implemented on more traditional devices, including a desktop, netbook, or laptop computer.
"Certain applications and operating systems (e.g., the Android.RTM. operating system) have been designed around a touchscreen user interface, but it may be beneficial to allow such applications and operating systems to be implemented on more traditional devices (e.g., desktop/netbook/laptop devices) that include physical keyboards and/or pointing devices, such as trackpad devices," Google said in the patent description.

"Trackpad operations may be directly mapped to touchscreen events, which may be processed by applications that may be configured to process such events. In such fashion, a computing device may be capable of processing touchscreen-based events ... regardless of whether the computing device includes or is coupled to a touchscreen."
Though this patent seems to suggest Google is taking Android closer to the desktop/laptop area, judging by the patent, we'd say it's more likely Google's focus with this patent is on laptop-dock type devices that would see an Android phone dock to a companion notebook with the phone itself as a trackpad or input device.
It's thought that Android 5.0, also known as Jelly Bean, will be unveiled at Google I/O this summer, so perhaps we'll hear more about Google's plans for Android and the desktop/laptop then.

Credits: http://www.tomshardware.com/news/Google-Patent-Desktop-Laptop-Multitouch-Trackpad,14785.html

Anonymous Releases Its Own Linux-based Operating System

Anonymous has released an operating system based on Ubuntu 11.10 called Anonymous-OS.

We "expect" Anonymous to launch coordinated DDoS attacks on sites that fall within their wrath. We "expect" Anonymous to be vocal about beliefs on political corruption and the rights of everyday people. But what we didn't expect to see was an actual operating system from the hactivist group, yet it seemingly makes perfect sense given their view of governments and corporations worldwide.
Called Anonymous-OS Live, the 32-bit platform is built on top of the open-source Linux-based Ubuntu 11.10 operating system. It uses the Mate desktop and comes packed with pre-installed software including the Tor browser, Hash Identifier, XChat IRC, SQL Poison, Find Host IP, ParolaPass Password Generator, Anonymous HOIC and more.
According to the Anonymous-OS website, the platform was created for "educational purposes" while also designed for checking the security of web pages. Users can boot with the new OS by creating a LiveUSB using Unetbootin which is located here. But given that the OS wasn't developed by any Genuine Source, curious downloaders should use the software with extreme caution, as it could be back-doored by any law enforcement company or hacker.

Credits:http://www.tomshardware.com/news/Anonymous-Ubuntu-Hactivist-operating-system-Tor-browser,15024.html

What's the Best Linux Server for You?

When it comes to clothes, I'm a normal guy. I just want to walk into a store, grab something that fits, buy it (What, try it on? Are you kidding!?), and head home. Well, that's what I want to do. I've learned over the years that just because something should fit doesn't mean that it will fit. It's the same with Linux servers. Sure, they're all built on the same code base and can run the same applications, but one may fit you perfectly while another may make you look like a clown.

So, how can you tell which is which? Well, let's start with that basic question you should bring to any computing decision: "What is it that you really want to do?"

Corporate Business Use

  • RedHat

  • Debian

Small Business Use

 

Monday, March 12, 2012

How Linux is changing lives in Zambia:Helping a small village to connect and communicate

Elton Munguya is the 28-year-old unit director of a moderately large residential and business ISP and network service provider.
His organisation counts many important institutions among its customers: the local bank, a hospital, several primary and secondary schools, the offices of the water administration board, a college and a bunch of cyber cafes.
The network has around 100 major nodes and access points (the exact number varies) and covers a geographical area of approximately 20km2.
Elton's role includes managing the roll-out of similar installations at other sites around the country. Like many young IT professionals, Munguya is laid-back, likeable and helpful to a fault. He's just bought his first car and he plans to get married early this year.

Sunday, March 11, 2012

Linux Mint 12 LXDE Officially Released

The team is proud to announce the release of Linux Mint 12 LXDE. Linux Mint 12 LXDE New features at a glance: LXDE Hybrid ISO images Search engines Upstream components For a complete overview and to see screenshots of the new features, visit: “What’s new in Linux Mint 12 LXDE“.

What is LWN.net?,LWN.net

What is LWN.net?

LWN.net aims to be the premier news and information source for the free software community. We provide comprehensive coverage of development, legal, commercial, and security issues. The LWN.net Weekly Edition is our weekly summary of what has happened in the free software world; our front page offers up-to-the-minute coverage.

How did LWN get started?

When LWN was initially designed, at the end of 1997, it was intended to be an attention-getting side project of a new consulting company called Eklektix, Inc. The initial editors (Elizabeth Coolbaugh and Jonathan Corbet) wanted to share the results of their efforts to keep up with developments from all over the Linux community. Over the years LWN has grown with Linux and become one of the definitive Linux news sites.

Where does LWN get its information?

We spend an unbelievable amount of time wandering the net in search of interesting developments to cover for our users. We also depend heavily on tips from our users; see the next section on how to send in something you have seen. 

wine 1.4:How to run windows software in linux?

Run Windows applications on Linux, BSD, Solaris and Mac OS X.
  WINE is a free and open source  software that allows computer programs written for windows to run on linux platforms.The name Wine initially was an acronym for WINdows Emulator. Its meaning later shifted to the recursive backronym, Wine Is Not an Emulator in order to differentiate the software from other emulators.

 Wine benefits
Last but not least, Wine can provide benefits over Windows right now:

  • Wine makes it possible to take advantage of all the Unix strong points (stability, flexibility, remote administration) while still using the Windows applications you depend on.
  • Unix has always made it possible to write powerful scripts. Wine makes it possible to call Windows applications from scripts that can also leverage the Unix environment to its full extent.
  • Wine makes it possible to access Windows applications remotely, even if they are a few thousand miles away.
  • Wine makes it economical to use thin clients: simply install Wine on a Linux server, and voila, you can access these Windows applications from any X terminal.
  • Wine can also be used to make existing Windows applications available on the Web by using VNC and its Java client.
  • Wine is Open Source Software, so you can extend it to suit your needs or have one of many companies do it for you.
Latest Releases

credits:http://www.winehq.org/ 

Setting Up A Linux File Server Using Samba

A quick Google will show many ways to to setup a Linux file server running Samba, most of them however don't work! Some leave out important bits leaving you stuck and some will only work with one version of a specific Distro (but of course don't mention this). I struggled for ages getting Samba to work reliably and made quite a few wrong turns on the way. I was just trying to set up a simple Linux file server to store music, photos etc. but eventually found a foolproof (probably) way to do it. The following works and has been tested several times on fresh installations. This is not meant to be a high security setup, all folders are accessible to everybody for read, write and delete. If you have stroppy teenagers who want exclusive access to their own area on the server, then you can use this as a starting point. A few simple changes would achieve that level of security but it is beyond the scope of this tutorial.

full story
credits:http://www.howtoforge.com/setting-up-a-linux-file-server-using-samba

Thursday, March 8, 2012

NVIDIA joins Linux Foundation, doesn't mention driver development

It's a big day for open source fans now that NVIDIA, the last member of the "big three" chip makers with AMD and Intel, has signed on with the Linux foundation. The company has previously kept the system at arms length, with users relying on reverse-engineering to get things working nicely with Linus' baby. It's joining Fluenco, Lineo and Mocana, three companies who also became signatories to the foundation at the same time. Whilst there's no commitment to provide drivers for its chipsets, at least there's a glimmer of hope that the company will contribute -- especially given the growing popularity of its mobile platforms.

credits : http://www.engadget.com/2012/03/08/nvidia-linux-foundation/

Linux Foundation's Collaboration Summit Coming in April

The Linux Foundation, which has emerged as a true leader in encouraging technology companies, open source community members, developers and others to work together to brighten Linux's future, is holding its sixth annual Linux Foundation Collaboration Summit in April. The event will take place at the Nikko Hotel in San Francisco from April 3 to 5, and if you're able to make it, the roundup of speakers is particularly notable this time around.
Keynote speakers at the Collaboration Summit will include Facebook's Frank Frankovsky, Huawei's Timo Jokiaho, Intel's Imad Sousou and NYSE Technology's Feargal O'Sullivan. Among the keynote topics:

Full story:  http://ostatic.com/blog/linux-foundations-collaboration-summit-coming-in-april

A-Z Bash commands

A-Z Bash commands
 
  alias    Create an alias
  apropos  Search Help manual pages (man -k)
  apt-get  Search for and install software packages (Debian)
  aspell   Spell Checker
  awk      Find and Replace text, database sort/validate/index
b
  bash     GNU Bourne-Again SHell 
  bc       Arbitrary precision calculator language 
  bg       Send to background
  break    Exit from a loop
  builtin  Run a shell builtin
  bzip2    Compress or decompress named file(s)
c
  cal      Display a calendar
  case     Conditionally perform a command
  cat      Display the contents of a file
  cd       Change Directory
  cfdisk   Partition table manipulator for Linux
  chgrp    Change group ownership
  chmod    Change access permissions
  chown    Change file owner and group
  chroot   Run a command with a different root directory
  chkconfig System services (runlevel)
  cksum    Print CRC checksum and byte counts
  clear    Clear terminal screen
  cmp      Compare two files
  comm     Compare two sorted files line by line
  command  Run a command - ignoring shell functions
  continue Resume the next iteration of a loop
  cp       Copy one or more files to another location
  cron     Daemon to execute scheduled commands
  crontab  Schedule a command to run at a later time
  csplit   Split a file into context-determined pieces
  cut      Divide a file into several parts
d
  date     Display or change the date & time
  dc       Desk Calculator
  dd       Convert and copy a file, write disk headers, boot records
  ddrescue Data recovery tool
  declare  Declare variables and give them attributes
  df       Display free disk space
  diff     Display the differences between two files
  diff3    Show differences among three files
  dig      DNS lookup
  dir      Briefly list directory contents
  dircolors Colour setup for `ls'
  dirname  Convert a full pathname to just a path
  dirs     Display list of remembered directories
  dmesg    Print kernel & driver messages 
  du       Estimate file space usage
e
  echo     Display message on screen
  egrep    Search file(s) for lines that match an extended expression
  eject    Eject removable media
  enable   Enable and disable builtin shell commands
  env      Environment variables
  ethtool  Ethernet card settings
  eval     Evaluate several commands/arguments
  exec     Execute a command
  exit     Exit the shell
  expect   Automate arbitrary applications accessed over a terminal
  expand   Convert tabs to spaces
  export   Set an environment variable
  expr     Evaluate expressions
f
  false    Do nothing, unsuccessfully
  fdformat Low-level format a floppy disk
  fdisk    Partition table manipulator for Linux
  fg       Send job to foreground 
  fgrep    Search file(s) for lines that match a fixed string
  file     Determine file type
  find     Search for files that meet a desired criteria
  fmt      Reformat paragraph text
  fold     Wrap text to fit a specified width.
  for      Expand words, and execute commands
  format   Format disks or tapes
  free     Display memory usage
  fsck     File system consistency check and repair
  ftp      File Transfer Protocol
  function Define Function Macros
  fuser    Identify/kill the process that is accessing a file
g
  gawk     Find and Replace text within file(s)
  getopts  Parse positional parameters
  grep     Search file(s) for lines that match a given pattern
  groups   Print group names a user is in
  gzip     Compress or decompress named file(s)
h
  hash     Remember the full pathname of a name argument
  head     Output the first part of file(s)
  history  Command History
  hostname Print or set system name
i
  id       Print user and group id's
  if       Conditionally perform a command
  ifconfig Configure a network interface
  ifdown   Stop a network interface 
  ifup     Start a network interface up
  import   Capture an X server screen and save the image to file
  install  Copy files and set attributes
j
  join     Join lines on a common field
k
  kill     Stop a process from running
  killall  Kill processes by name
l
  less     Display output one screen at a time
  let      Perform arithmetic on shell variables
  ln       Make links between files
  local    Create variables
  locate   Find files
  logname  Print current login name
  logout   Exit a login shell
  look     Display lines beginning with a given string
  lpc      Line printer control program
  lpr      Off line print
  lprint   Print a file
  lprintd  Abort a print job
  lprintq  List the print queue
  lprm     Remove jobs from the print queue
  ls       List information about file(s)
  lsof     List open files
m
  make     Recompile a group of programs
  man      Help manual
  mkdir    Create new folder(s)
  mkfifo   Make FIFOs (named pipes)
  mkisofs  Create an hybrid ISO9660/JOLIET/HFS filesystem
  mknod    Make block or character special files
  more     Display output one screen at a time
  mount    Mount a file system
  mtools   Manipulate MS-DOS files
  mv       Move or rename files or directories
  mmv      Mass Move and rename (files)
n
  netstat  Networking information
  nice     Set the priority of a command or job
  nl       Number lines and write files
  nohup    Run a command immune to hangups
  nslookup Query Internet name servers interactively
o
  open     Open a file in its default application
  op       Operator access 
p
  passwd   Modify a user password
  paste    Merge lines of files
  pathchk  Check file name portability
  ping     Test a network connection
  pkill    Stop processes from running
  popd     Restore the previous value of the current directory
  pr       Prepare files for printing
  printcap Printer capability database
  printenv Print environment variables
  printf   Format and print data
  ps       Process status
  pushd    Save and then change the current directory
  pwd      Print Working Directory
q
  quota    Display disk usage and limits
  quotacheck Scan a file system for disk usage
  quotactl Set disk quotas
r
  ram      ram disk device
  rcp      Copy files between two machines
  read     read a line from standard input
  readonly Mark variables/functions as readonly
  reboot   Reboot the system
  renice   Alter priority of running processes 
  remsync  Synchronize remote files via email
  return   Exit a shell function
  rev      Reverse lines of a file
  rm       Remove files
  rmdir    Remove folder(s)
  rsync    Remote file copy (Synchronize file trees)
s
  screen   Multiplex terminal, run remote shells via ssh
  scp      Secure copy (remote file copy)
  sdiff    Merge two files interactively
  sed      Stream Editor
  select   Accept keyboard input
  seq      Print numeric sequences
  set      Manipulate shell variables and functions
  sftp     Secure File Transfer Program
  shift    Shift positional parameters
  shopt    Shell Options
  shutdown Shutdown or restart linux
  sleep    Delay for a specified time
  slocate  Find files
  sort     Sort text files
  source   Run commands from a file `.'
  split    Split a file into fixed-size pieces
  ssh      Secure Shell client (remote login program)
  strace   Trace system calls and signals
  su       Substitute user identity
  sudo     Execute a command as another user
  sum      Print a checksum for a file
  symlink  Make a new name for a file
  sync     Synchronize data on disk with memory
t
  tail     Output the last part of files
  tar      Tape ARchiver
  tee      Redirect output to multiple files
  test     Evaluate a conditional expression
  time     Measure Program running time
  times    User and system times
  touch    Change file timestamps
  top      List processes running on the system
  traceroute Trace Route to Host
  trap     Run a command when a signal is set(bourne)
  tr       Translate, squeeze, and/or delete characters
  true     Do nothing, successfully
  tsort    Topological sort
  tty      Print filename of terminal on stdin
  type     Describe a command
u
  ulimit   Limit user resources
  umask    Users file creation mask
  umount   Unmount a device
  unalias  Remove an alias
  uname    Print system information
  unexpand Convert spaces to tabs
  uniq     Uniquify files
  units    Convert units from one scale to another
  unset    Remove variable or function names
  unshar   Unpack shell archive scripts
  until    Execute commands (until error)
  useradd  Create new user account
  usermod  Modify user account
  users    List users currently logged in
  uuencode Encode a binary file 
  uudecode Decode a file created by uuencode
v
  v        Verbosely list directory contents (`ls -l -b')
  vdir     Verbosely list directory contents (`ls -l -b')
  vi       Text Editor
  vmstat   Report virtual memory statistics
w
  watch    Execute/display a program periodically
  wc       Print byte, word, and line counts
  whereis  Report all known instances of a command    
  which    Locate a program file in the user's path. 
  while    Execute commands
  who      Print all usernames currently logged in
  whoami   Print the current user id and name (`id -un')
  Wget     Retrieve web pages or files via HTTP, HTTPS or FTP
  write    Send a message to another user 
x
  xargs    Execute utility, passing constructed argument list(s)
  yes      Print a string until interrupted
  .        Run a command script in the current shell
  ###      Comment / Remark

Different flavours of linux?

Debian
Debian is regarded as the largest Linux distribution to date in terms of users. It is renowned for its stability and quality and its interoperability with other software. It has a very large following and over 28,000 packages you can add to it. It is very stable and newbie friendly. The community is knowledgeable and helpful and most of the questions you may have will have been asked before on their forums. Debian seems somewhat over engineered to me, which isn’t a bad thing. It just means that it is never the latest and greatest, but is very, very stable. Currently on Debian Version 5, Lenny.
Ubuntu
Seemingly the most popular distro out in the world right now, since its release five years ago. Some suggest it has as much as 40% of Linux desktops. It is another good quality, stable release that is very newbie friendly. It even has a migration assistant for Windows refugees. This eases the pain a little by helping you in your first steps. Another distro that works with most hardware straight out of the box. Current version 9.04 Jaunty Jackalope.
Fedora
This is a distribution with a long history. Once part of Red Hat, Fedora was launched for the ‘Linux Hobbyist’. It is very secure and has a large number of packages available for it. This one seemed to be less newbie friendly than others, with not so many options for desktop users. If you want to run a web server or something then this would be ideal. Current version is Fedora 10, new version shortly
OpenSUSE
This is another distro with a rich history, now owned by Novell. It is a comprehensive package with some good documentation. The following is helpful and informative and there are lots of packages available for it. There is however some controversy over a deal it has with Microsoft, something about use of patents. This doesn’t detract from the usability of the product though. It does have graphical tools for an administrator. Current release is 11.1
Mandriva
Mandriva used to be Mandrake, and even as a Windows user back then I knew what that was. It is one of the distributions that offer both free and commercial versions of the software. The commercial version is regarded as one of the best distros for newbies. Although I don’t see that it has much that Ubuntu or Debian doesn’t offer and for free. Current version is Mandriva 2009.1.
Slackware
This is allegedly the oldest Linux distribution still around today. It is supposed to be the cleanest and most bug free edition available, but seems quite hard core. You definitely need skills to get into Slackware. It lags a little behind other distributions and doesn’t have all the cool bits to make your desktop smart. Current version 12.2
FreeBSD
Yes I know…it is not Linux but it is worth mentioning. It is primarily directed a server applications and is rated as one of the most stable. It doesn’t have all the bells and whistles that some of the more popular distros have but if you need something to run a server, you can’t go wrong with this. Current version 7.2.
Mint
This is my personal favorite, and not only for its cool name. It is based on Ubuntu, but is developed mainly ‘on demand’. The programmers have forums and feedback loops which they subscribe to. They listen and try to implement the best suggestions into the distribution. It has many specific tools, and to my mind is the most useable out of the box. Current version is Mint 6 Felicia.
PCLinuxOS
Despite the not so catchy name this distribution is supposed to be very good for the Linux newcomer. Another distro that works out of the box, natively supporting lots of hardware. The documentation and website are pretty good if a little disorganized. This one also seems to be English only, so if you speak something other, then you had best look elsewhere. Current version is PCLinuxOS 2009.

credits:beginlinux.wordpress.com/2009/05/13/the-many-flavors-of-linux/

Wednesday, March 7, 2012

Creating thread in linux.


THREADS, LIKE PROCESSES, ARE A MECHANISM TO ALLOW A PROGRAM to do more than
one thing at a time.As with processes, threads appear to run concurrently; the Linux
kernel schedules them asynchronously, interrupting each thread from time to time to
give others a chance to execute.
Conceptually, a thread exists within a process.Threads are a finer-grained unit of
execution than processes.When you invoke a program, Linux creates a new process
and in that process creates a single thread, which runs the program sequentially.That
thread can create additional threads; all these threads run the same program in the
same process, but each thread may be executing a different part of the program at any
given time.
We’ve seen how a program can fork a child process.The child process is initially
running its parent’s program, with its parent’s virtual memory, file descriptors, and so
on copied.The child process can modify its memory, close file descriptors, and the like
without affecting its parent, and vice versa.When a program creates another thread,
though, nothing is copied.The creating and the created thread share the same memory
space, file descriptors, and other system resources as the original. If one thread changes
the value of a variable, for instance, the other thread subsequently will see the modified
value. Similarly, if one thread closes a file descriptor, other threads may not read
from or write to that file descriptor. Because a process and all its threads can be executing
only one program at a time, if any thread inside a process calls one of the exec
functions, all the other threads are ended (the new program may, of course, create new
threads).
GNU/Linux implements the POSIX standard thread API (known as pthreads). All
thread functions and data types are declared in the header file <pthread.h>.The
pthread functions are not included in the standard C library. Instead, they are in
libpthread, so you should add -lpthread to the command line when you link your
program.
4.1 Thread Creation
Each thread in a process is identified by a thread ID.When referring to thread IDs in
C or C++ programs, use the type pthread_t.
Upon creation, each thread executes a thread function.This is just an ordinary function
and contains the code that the thread should run.When the function returns, the
thread exits. On GNU/Linux, thread functions take a single parameter, of type void*,
and have a void* return type.The parameter is the thread argument: GNU/Linux passes
the value along to the thread without looking at it.Your program can use this parameter
to pass data to a new thread. Similarly, your program can use the return value to
pass data from an exiting thread back to its creator.
The pthread_create function creates a new thread.You provide it with the following:
1. A pointer to a pthread_t variable, in which the thread ID of the new thread is
stored.
2. A pointer to a thread attribute object.This object controls details of how the
thread interacts with the rest of the program. If you pass NULL as the thread
attribute, a thread will be created with the default thread attributes.Thread
attributes are discussed in Section 4.1.5,“Thread Attributes.”
3. A pointer to the thread function.This is an ordinary function pointer, of this
type:
void* (*) (void*)
4. A thread argument value of type void*. Whatever you pass is simply passed as
the argument to the thread function when the thread begins executing.
A call to pthread_create returns immediately, and the original thread continues executing
the instructions following the call. Meanwhile, the new thread begins executing
the thread function. Linux schedules both threads asynchronously, and your program
must not rely on the relative order in which instructions are executed in the two
threads.

The program in Listing 4.1 creates a thread that prints x’s continuously to standard
error. After calling pthread_create, the main thread prints o’s continuously to standard
error.
Listing 4.1 (thread-create.c) Create a Thread
#include <pthread.h>
#include <stdio.h>
/* Prints x’s to stderr. The parameter is unused. Does not return. */
void* print_xs (void* unused)
{
while (1)
fputc (‘x’, stderr);
return NULL;
}
/* The main program. */
int main ()
{
pthread_t thread_id;
/* Create a new thread. The new thread will run the print_xs
function. */
pthread_create (&thread_id, NULL, &print_xs, NULL);
/* Print o’s continuously to stderr. */
while (1)
fputc (‘o’, stderr);
return 0;
}
Compile and link this program using the following code:
% cc -o thread-create thread-create.c -lpthread
Try running it to see what happens. Notice the unpredictable pattern of x’s and o’s as
Linux alternately schedules the two threads.
Under normal circumstances, a thread exits in one of two ways. One way, as illustrated
previously, is by returning from the thread function.The return value from the
thread function is taken to be the return value of the thread. Alternately, a thread can
exit explicitly by calling pthread_exit.This function may be called from within the
thread function or from some other function called directly or indirectly by the thread
function.The argument to pthread_exit is the thread’s return value.


New Open Tablet Will Come with Linux and KDE Preinstalled

Sure enough, that's just what came out over the weekend.
Specifically, KDE developer Aaron Seigo on Saturday revealed that a 7-inch Linux tablet named “Spark” will soon be available with KDE Plasma Active as its default user interface. Brought to market by the KDE Plasma Active community itself under the brand “Make-Play-Live,” it will be priced at 200 euros, or roughly $260.

 Along with Plasma Active, the Spark device will offer a 1GHz AMLogic ARM processor, Mali-400 GPU, 512 MB of RAM, 4GB of internal storage, an SD card slot, a 7-inch capacitive multitouch screen, and Wi-Fi connectivity.
credits:http://www.pcworld.com/businesscenter/article/248947/new_open_tablet_will_come_with_linux_and_kde_preinstalled.html

Which should I use, BSD or Linux?

What does this all mean in practice? Who should use BSD, who should use Linux?
This is a very difficult question to answer. Here are some guidelines:
  • “If it ain't broke, don't fix it”: If you already use an open source operating system, and you are happy with it, there is probably no good reason to change.
  • BSD systems, in particular FreeBSD, can have notably higher performance than Linux. But this is not across the board. In many cases, there is little or no difference in performance. In some cases, Linux may perform better than FreeBSD.
  • In general, BSD systems have a better reputation for reliability, mainly as a result of the more mature code base.
  • BSD projects have a better reputation for the quality and completeness of their documentation. The various documentation projects aim to provide actively updated documentation, in many languages, and covering all aspects of the system.
  • The BSD license may be more attractive than the GPL.
  • BSD can execute most Linux binaries, while Linux can not execute BSD binaries. Many BSD implementations can also execute binaries from other UNIX like systems. As a result, BSD may present an easier migration route from other systems than Linux would.

What is BSD?

BSD stands for “Berkeley Software Distribution”. It is the name of distributions of source code from the University of California, Berkeley, which were originally extensions to AT&T's Research UNIX operating system. Several open source operating system projects are based on a release of this source code known as 4.4BSD-Lite. In addition, they comprise a number of packages from other Open Source projects, including notably the GNU project. The overall operating system comprises:


  • The BSD kernel, which handles process scheduling, memory management, symmetric multi-processing (SMP), device drivers, etc.
    Unlike the Linux kernel, there are several different BSD kernels with differing capabilities.
  • The C library, the base API for the system.
    The BSD C library is based on code from Berkeley, not the GNU project.
  • Utilities such as shells, file utilities, compilers and linkers.
    Some of the utilities are derived from the GNU project, others are not.
  • The X Window system, which handles graphical display.
    The X Window system used in most versions of BSD is maintained by the X.Org project. FreeBSD allows the user to choose from a variety of desktop environments, such as Gnome, KDE, or Xfce; and lightweight window managers like Openbox, Fluxbox, or Awesome.
  • Many other programs and utilities.


    CREDITS:http://www.freebsd.org/doc/en/articles/explaining-bsd/

Monday, March 5, 2012

Sample android application:Quick Navigator

package com.android.qa;


import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class QuickAccessActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        navigate();
    }
    public void navigate(){
        Button google=(Button)findViewById(R.id.google);
        Button facebook=(Button)findViewById(R.id.facebook);
        Button youtube=(Button)findViewById(R.id.youtube);
        Button twitter=(Button)findViewById(R.id.twitter);
        Button myspace=(Button)findViewById(R.id.myspace);
        Button linkedin=(Button)findViewById(R.id.linkedin);
        Button flicker=(Button)findViewById(R.id.flicker);
        google.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.google.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

}
});
        facebook.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.facebook.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
        youtube.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.youtube.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
        twitter.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.twitter.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

}
});
        linkedin.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.linkedin.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
        myspace.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.myspace.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
        flicker.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String url="http://www.myspace.com";
Intent i=new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
    }
}

//XML code(Layout)
----------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >


    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />


    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.52" >




        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:text="@string/google" />




        <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/button1"
            android:layout_marginTop="18dp"
            android:text="@string/facebook" />




        <Button
            android:id="@+id/button3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/button2"
            android:layout_marginTop="26dp"
            android:text="@string/twitter" />




        <Button
            android:id="@+id/button4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:text="@string/orkut" />




        <Button
            android:id="@+id/button5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/button4"
            android:layout_marginTop="24dp"
            android:text="@string/linkedin" />



        <Button
            android:id="@+id/button6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/button5"
            android:layout_marginTop="32dp"
            android:text="Button" />


    </RelativeLayout>


</LinearLayout>