Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, January 30, 2014

Unable to create new native thread and max user processes

very often i have seen "Unable to create new native" error when i am writing Multi threaded programming in Java on Linux box


The error stack usually shout like below!
ava.lang.OutOfMemoryError: unable to create new native thread 
        at java.lang.Thread.start0(Native Method) 
        at java.lang.Thread.start(Thread.java:691) 

One of the reason for this is number of Max User Processes for given user in your Linux box is very low!
you can check the number of Max User Processes by typing the command ulimit -a



[vanji@myMachine area51]$ ulimit -a

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 95153
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 32768
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024 
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

So how do we increase the max user processes ?


Follow the step:

vi /etc/security/limits.conf  and add below the menstioed

*          soft     nproc          65535
*          hard     nproc          65535
*          soft     nofile         65535
*          hard     nofile         65535

Save and Exit check the user max processes ulimit



[vanji@myMachine area51]$ ulimit -a

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 95153
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 32768
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 65535 
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited





Thursday, April 4, 2013

Cool Terminal Commands to identify your OS detail

I want get the details about my current Ubunutu OS that has been installed in my machine!
as a result of google search. I found few cool commands!


1) uname -a

This command will retrieve you, full detail of the OS that install in your computer.

Linux vanjikumaran-ThinkPad-T530 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux



2) lsb_release -d


This command should give you the the description including the OS name ("Ubuntu" on an Ubuntu system) and the release number.

Description:    Ubuntu 12.10
 

3) lsb_release -c

This will give you just the codename.

Codename:    quantal

 
4) lsb_release -r

This will give you just the release number only.

Release:    12.10


5) lsb_release -a

This will provide you full lsb detail.

No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:    quantal

Sunday, March 31, 2013

Activate and use laptop Fingerprint Reader in ubuntu

This post will guide you step by step, how to Activate and use laptop Fingerprint Reader in Ubuntu.

Tested in Lenovo T530


for Further Information Please follow this link https://launchpad.net/~fingerprint/+archive/fprint


Step 1

Add this PPA to your sources:


  sudo add-apt-repository ppa:fingerprint/fprint
  sudo apt-get update
  sudo apt-get upgrade






Step 2

Install the Software:

 sudo apt-get install libfprint0 fprint-demo libpam-fprintd gksu-polkit




Important Note:

If you have experimented with fingerprint authentication before and have changed your /etc/pam.d/common-auth, you may be presented with a screen asking whether you want to override those changes. Select Yes. Under very special circumstances, you may get an error saying

   pam-auth-update: Local modifications to /etc/pam.d/common-*, not updating.
   pam-auth-update: Run pam-auth-update --force to override.

In this case, run “sudo pam-auth-update --force”, exactly as suggested, and enable the fprintd profile manually. Leave the standard system profiles (Unix, Keyring and ConsoleKit) enabled as well.



Step 3

Launch “fprint project demo” and check that you can enroll and verify your fingerprints and that your reader is indeed supported.







Step 4

Run “fprintd-enroll” in terminal to save your fingerprint.


system will request you to enroll the finger  print.




That's All :)

Now lock your screen and unlock by fingerprint reader :)


security Alert 


Image is taken from http://www.navigantresearch.com/research/smart-meter-security

if you consider more about your laptop's data protection, you should disable the guest account otherwise anyone can simply access your computer as a guest and they have read access to your home folder by default.

How to Disable Ubuntu’s Guest Session Account
** Edit following file
sudo vim /etc/lightdm/lightdm.conf

** Append following line under [SeatDefaults]
allow-guest=false

** Reboot the computer or restart your graphical environment by following command
sudo restart lightdm





Upgrade Ubuntu 12.04 to Ubuntu 12.10

This Post will explain, how to upgrade Ubuntu 12.04 to Ubuntu 12.10 in step by step Order.

Author assume that, user currently having 12.04 version in his/her machine.


Step 1

Open up Update manger, you can achieve it by typing "Update manger" in "Dash Home".

Step 2

In the Update Manger, user can find "Settings" Button, Click it.

Step 3

Select "Updates" Tab.




 Step 4

Select "For any new version" option form drop down available in "Notify me of a new Ubuntu version" and close the settings.


 Step 5

Now it is possible to see, New option in "Update Manger". 

Click "Upgrade" in order to upgrade your system to "Ubuntu 12.10"