Posts

Showing posts from 2016

List of virtual adapters your Virtual Linux can access

Hello , Its me again Raja and this time I came up with one more new post. I have been through interesting problem. As many of you know Virtual Box , sometimes even though we enable new adapter and configured IP in conf file it wont comes up. Everything seems fine , we have enabled adapter and configured name and IP for it but still it wont come up. Simple solution : How many adapters your VM able to access can be easily know by using command ls /sys/class/net   In my case I have 3 adapters so it will display them root@fresh:~# ls /sys/class/net enp0s3  enp0s8  lo root@fresh:~# If you come across errors like device not found errors , try to found out how your VM identified the adapters that you have enabled. Hope it helps. Thank you.

Linux : full path of a file

Hello , Sometimes we need to have full or absolute path of file. And most of the times we used to pwd + filename manually. But with google search I came across a command named as readlink. readlink -f filename.txt that will print complete path of filename along with filename append to it. linuxmen@linuxmen-fresh:~/test/test1$ readlink -f ex4.js /home/linuxmen/test/test1/ex4.js linuxmen@linuxmen-fresh:~/test/test1$   Note : make sure you are same directory where file resides else give relative path to file. Hope it helps

Install R Programming Language in Ubuntu

This post describe about installation steps for R- Programming Language. For Windows we have direct exe file but for Linux its in a single click way but you can still do it below commands easily. Open your terminal and type below commands as root user. echo " deb https://cloud.r-project.org/bin/linux/ubuntu xenial/ deb https://cloud.r-project.org/ trusty-backports main restricted universe" >> /etc/apt/sources.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9 sudo apt-get update sudo apt-get install -y r-base r-base-dev sudo apt-get install r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-cran-rodbc If any questions please dont hesitate to ask. Thank you.

JVMMON help commands

Hello , jvmmon is an excellent tool for JBOSS administrators and please find below list of commands for jvmmon  Print commands: __________________________   print arenastat                             - Prints brief arena statistics   print arenastat full                        - Prints detailed arena statistics   print class statistic                       - Prints class statistics of a VM   print cluster memory information            - Prints information about the memory consumption of the cluster   print codeblobs                             - Prints information about code blobs with specified name   print debugging information                 - Prints information about the debugging state of a VM   print detailed class statistic              - Prints detailed class statistics of a VM   print dll info                              - Prints information about the loaded shared libraries of a VM   print flight recorder                       - Prints part of the flight rec

Python Object reference well explained with list

Assume you have a list and you want to make exact copy of the list. What command you will use in python to copy a list from another list. I used List1=List2 and List1 got copied as exactly as List2 but what happen internally is they have shared command object reference location. Dont believe ? then lets try and try to see both lists location with id function id() I mean do as  id(List1) and id(List2) , you will find command location for these two which means they are sharing common location and what ever operations you do they will reflect on both lists.And this is completely harmful and dangerous. So to avoid this list copying can be done in other methods where two list will have two different object locations. They are list2=copy.copy(list1) (or) list2=list1[:] (or) list2=list(list1) and for more information about object reference understanding in python I recommend you to read these http://stackoverflow.com/questions/36244451/how-to-program-python-variable-to-

How to get full application propery reports by using jvmmon ?

Hello , Let come straight to the point. If you want to see right now with what properties your Jboss application servers are running , Please type jvmmon and choose current PID of your JBOSS process. Then type print system properties It will flood your stdout , copy and paste it in a file and you can use to analyse. else you can save it to a file in your system. $ print to file file = /tmp/fromjvmmon $ print system properties -- printed to local file /tmp/fromjvmmon $ exit and to take thread dump use  jvmmon $ print to file file =/tmp/threaddump $print stacktrace it will autosave threaddump in the above location and similarly to take heap dump.  type jvmmon $dump heap it will dump heap automatically into location as mentioned in run.conf Thank you. Regards Raja

Suspended Jobs vs Running jobs in Linux

Background Job : A job which is running background in the same shell. You can use bg command to see any background jobs. Foreground job : A Job which is running in the same shell right before your eyes. Suspended Job : Its a stopped/pause job but you can resume their running. Let me explain with example very clealy virt00 # sleep 180 ^ Z zsh : suspended sleep 180 virt00 # jobs [ 1 ] + suspended sleep 180 virt00 # bg [ 1 ] + continued sleep 180 virt00 # fg [ 1 ] + running sleep 180 ^ Z zsh : suspended sleep 180 virt00 # jobs [ 1 ] + suspended sleep 180 virt00 # I have started a Job named  sleep 180  then I stopped with CTRL+Z . right now my job is in suspended mode. I see it by typing  jobs  command. Now I want to resume its running in background so I typed  bg command then it will move from suspended state to running state but in background it will run. now I typed command  fg  to bring it foreground , now job wont get stepped but it will

Deny SSH access to particular users

We all know SSH is very famous and the best service for remote access. Today I am going to tell you how to block or allow only particular users or group from SSH access. open sshd_config file as per your environment in Debian vim /etc/ssh/sshd_config Then add below line to enable access for only below users AllowUsers username1 username2 to deny access for only below users add a line as DenyUsers username1 username2 as in the same way AllowGroups group1 group2 and to deny groups DenyGroups group1 group2  But there is something very important you have to follow here. It is the order of mentioning. From manpage of SSH  The allow/deny directives are processed in the following order: DenyUsers , AllowUsers , DenyGroups , and finally AllowGroups . So first mention DenyUsers and then AllowUsers then only it will works and same for DenyGroups and AllowGroups Hope it helps.

How to see IOWAIT in Linux

Hello , You can use sar command. in Ubuntu you can install it with sudo apt-get install systat and enable data collecting sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat start service with   /etc/init.d/sysstat start To see I/O latency type command as sar 1 1 that means it will give two responses with 1 sec as interval. Example : root@virt01:~# sar 1 3 Linux 3.19.0-42-generic (virt01.ubuntu.com)     13/02/16        _x86_64_        (1 CPU) 12:26:23        CPU     %user     %nice   %system   %iowait    %steal     %idle 12:26:24        all      0.00      0.00      0.00      0.00      0.00    100.00 12:26:25        all      0.00      0.00      0.99      0.00      0.00     99.01 12:26:26        all      2.02      0.00      0.00      0.00      0.00     97.98 Average:        all      0.67      0.00      0.33      0.00      0.00     99.00 root@virt01:~# Hope that helps.

grep: unknown device method

Today while using grep command via rundeck I was through grep: unknown device method  error. And the reason is due to I am having ' - ' in my search pattern I was through this error. I mean search includes grep "-search.this" /path/to/file Then you may get error with grep. So remove ' - ' in pattern and repeat your search. grep "search.this" /path/to/file Hope that helps.

Uploading files to FTP/SFTP using CURL

Hello, Today I am writing below article which can help you to upload files to SFTP/FTP by using CURL. Ok why we need that ? Let me tell explain!! How we login into SFTP/FTP ? [root@virt03 test]# sftp 192.168.56.110 Connecting to 192.168.56.110... root@192.168.56.110's password: sftp> ls anaconda-ks.cfg       nodes                 post-install          post-install.log sftp> exit and uploading files with put command. Its a lengthy way. So recently I have gone through few articles and with some R&D I have modified it as script and command-line argument support.So you can call the script with filename as argument.  So Lets do this!!! Command 1 : This is for uploading a single to SFTP/FTP by using CURL.  SFTP curl -k  -u virt03:virt03 -T file4  sftp://192.168.56.110/home/virt03/ Syntax :  curl -k  -u username:password -T filename sftp://IP_Addreess OR Hostname:/path/to/upload  FTP curl -k  -u virt03:virt03 -T f

List the installed RPMs by date of installation in CentOS/RHEL 6.x

How to list  the installed packages on date wise Command is :  # rpm -qa --qf '%{INSTALLTIME} (%{INSTALLTIME:date}): %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -n

How To Configure VSFTPD With TLS/SSL On RHEL/CentOS 6.x and How To Connect Secure VSFTPD(TLS/SSL) in Heterogeneous Environments Using Client Programs. (Part..A)

Image
Traditional FTP is rather insecure. When you login, your username and password are transmitted in clear text, raising the possibility of your credentials  be ing  'sniffed' by a malicious person. Fortunately there's an easy answer to this. You can quite easily configure your vsftpd server to use OpenSSL encryption, so that usernames & password, and even data files, are encrypted during transfer. It takes just a few simple steps:   Vsftpd is already available under CentOS/RHEL   default repositories. We assume that CentOS/RHEL users have enabled default repositories  in his system. Now execute following command.   Note:-  This post works with  Security-Enhanced Linux ( SELinux ) is enabled    Installing and Configuring the Vsftpd in RHEL/CentOS 6.x   Step1 :-    Install VsFTPd   # yum install vsftpd   Step2 :-   Configure Basic VsFTPd Settings   Now Edit Vsftpd configuration file  /etc/vsftpd/ vsftpd.conf  in CentOS/RHEL  and do the some ba