Posts

Showing posts from December, 2015

Installing Chef server in your CentOS 6.7 easily.

I have tried to install chef in my CentOS 6.7 but it was like complicated thing till today. So many problems I have faced and I am giving them as precautions to you. 1. You should have minimum 1 Mbps unlimited connection. Atleast 5 GB data you are going to download. 2. Always you have to choose your current OS version builds, If you choose other version builds you will be stopped with library issues. 3. Atleast 6 - 7 GB of freespace and Lot of patience. I will give you in a simple way. Just open your terminal and turn into root user if you were not. Then Download files from below links. Open them via browser and get the final link and download in your way. 1. https://packagecloud.io/chef/stable/packages/el/6/chef-server-core-12.3.1-1.el6.x86_64.rpm/download 2.https://packagecloud.io/chef/stable/packages/el/6/opscode-reporting-1.5.5-1.el6.x86_64.rpm/download 3.https://packagecloud.io/chef/stable/packages/el/6/opscode-push-jobs-server-1.1.6-1.x86_64.rpm/download 4.

Extract log efficiently by using sed

Modification of Log pulling command by using sed Old command That I use to do log extraction sed -nre '/12:23:12/,/12:24:12/ p' logfile > /tmp/somelog.txt But this will take match of given two time stamps at any where in log file.And sometimes from middle of the line which gives obviously wrong log that I need. So , Now we are modifying sed to look after only at lines starting with timestamp. It will pull the logs if timestamp exists at beginning of the lines else It wont pull any log. sed -nre '/^12:23:12/,/^12:24:12/ p' logfile > /tmp/somelog.txt Note: If you want to make sure that given timestamp existed or not at line starting you can use grep -m 5 12:23:12 server.log The above command ran for 5 first matching of grep and so you can conclude the availability of given time-stamp in logfile. For more information please refer sed man page Hope it will help you.

Reset Gnome 2 panel to default applets

If you ever accidentally remove your Gnome Panel in any Gnome 2.X default DE Linux then,  you can reset it to default with mv ~/.gconf/apps/panel ~/.gconf/apps/panel.bak Now restart your Linux and re login. Your gnome panel will be back 🔙. Hope it helps you.

Changing hostname in CentOS ,Redhat Linux OS

Hello , Today lets see an article about changing hostname in CentOS and Redhat. We have to change hostname in 3 locations to apply changes globally in all locations.  Configuration filenames : 1. /etc/sysconfig/network 2. /etc/hosts 3. hostname command  1. Open /etc/sysconfig/network with any editor.                                                   # vim /etc/sysconfig/network And write/modify line as                                     HOSTNAME= Ex: HOSTNAME=centos.virt02.com close and save file. 2. Open /etc/hosts file  and add as                                                                   # vim /etc/hosts and add as                             192.168.56.101 centos.virt02.com centos close and save file. 3. Now type command hostname to see current hostname . To assign new hostname                                   # hostname=centos.virt02.com after doing all those steps , restart network with service network restart Hope it

How to avoid ambiguous redirect error in Bash ?

Hello , Today I was trying to take Threaddump for my Java process in single command with date and hostname like this $  jstack - l `pgrep java` > / tmp / TD_ `hostname` _ `date` _ `pgrep java` But I am getting error like  -bash: /tmp/TD_`hostname`_`date`_`pgrep java`: ambiguous redirect Then I posted at   unix.stackexchange.com  and a friend named  Muru  helped me in fixing that issue with very simple way $ echo foo > /tmp/TD_`hostname`_`date`_`pgrep java` bash: /tmp/TD_`hostname`_`date`_`pgrep java`: ambiguous redirect $ echo foo > /tmp/"TD_`hostname`_`date`_`pgrep java`" $ ls /tmp/TD* /tmp/TD_muru-arch_Sat 26 Dec 16:14:29 IST 2015 Summary : Command   jstack  - l  `pgrep java`   >   / tmp / TD_ `hostname` _ `date` _ `pgrep java` is wrong  and right way of using this is  j stack  - l  `pgrep java`   >   / tmp /" TD_ `hostname` _ `date` _ `pgrep java` " Hope it will help you. 

Installing latest Git in CentOS 6.7

Hello , I am Raja. Today I am writing this article on installing latest Git in CentOS 6.7 via source. Actually in CentOS 6.7 , we are getting only 1.7.1 version but the latest Git version is git-2.6.3. And while installing I've been through lot of R&D. Here I am providing you everything in a single article. Here the avalibale version of git in CentOS 6.7. [ localserver@dhcppc2 ~ ] $ yum list git Loaded plugins : fastestmirror , refresh - packagekit , security Loading mirror speeds from cached hostfile * base : mirrors . vonline . vn * extras : mirrors . vonline . vn * updates : mirrors . vonline . vn Available Packages git . i686 1.7 . 1 - 3. el6_4 . 1 base [ localserver@dhcppc2 ~ ] $ Lets begin with install 1. Create a directory and change into that directory. mkdir git cd git 2. Get git downloaded using wget and unrar it wget https : // www.kernel.org/pub/software/scm/git/git-2.6.3.tar.gz tar -

Install Google Chrome in CentOS 6.X

Hello , In CentOS 6.X , installing Google Chrome webbrowser is not easy task. We have dependencies issues with  "libstdc++.so.6(GLIBCXX_3.4.15)". On searching I came to know about  Chrome Richardlloyd  . By using his script we can install Chrome very easily with in CentOS. To install it , open your terminal and turn into root user and paste these lines one after one wget http : //chrome.richardlloyd.org.uk/install_chrome.sh chmod u + x install_chrome . sh . / install_chrome . sh It will install Google Chrome in your CentOS. Note : Google announced , dropping support for 32-Bit google chrome from March 2016.

How to solve "An unknown FastCGI error occured" error in IIS7 and IIS 7.5 ?

PHP does not work with "An unknown FastCGI error occured" error in IIS 7 / 7.5 / 8     Symptoms   With PHP  domains shows the following error:   HTTP Error 500.0 - Internal Server Error An unknown FastCGI error occurred Error Code 0x800736b1  From CommandLine the following error occur:   C:\Windows\system32>"C:\Program Files\HSphere\3rdparty\PHP\PHP53\php-cgi.exe" -v The application has failed to start because its side-by-side configuration is in correct . Please see the application event log for more detail.    In the EventViewer we could see:   Activation context generation failed for "c:\program files\hsphere\3rdparty\php\php53\php-cgi.exe". Dependent Assembly Microsoft.VC90. CRT,processorArchitecture ="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.    Cause   Windows System M