Thursday, December 20, 2018

Search to plant trees - Ecosia.org

Ecosia.org is nothing more than a search engine. I tried it and found it very easy to use. It’s not much different than Google, but there is one BIG difference. When you search the web with Ecosia, 80% of the profits from the search ad revenue goes to support tree planting programs.

By planting a tree, you can fight climate change, restart water cycles, turn deserts back into fertile forests and provide nutrition, employment, education, medical assistance and political as well as economic stability.

So basically Ecosia is a search engine you can use, and by using it you give a hand to help the nature, and the economy in some very poor countries.

So try it and help them to plant trees.




Wednesday, October 24, 2018

How does a blockchain work ?


What is Agile?


How to use SAR to troubleshoot linux box and generate reports.

SAR stands for System Activity Report, as its name suggest sar command is used to collect, report & save CPU, Memory, I/O usage in Unix like operating system. SAR command produce the reports on the fly and can also save the reports in the log files as well.
Now a days sar includes in general Linux installation. You can check if sar is installed by executing following command.



rpm -qa | grep sysstat


Incase if sar is not installed you can use following command or RPM package to install it.

yum install sysstat


Sysstat data collection is doing by sadc (system activity data collector). It saves the reports in log file “/var/log/sa/saDD”  where DD represents Current day and already existing files will be archived.


[root@localhost ~]# systemctl start sysstat
[root@localhost ~]# systemctl enable sysstat



It collects the data every 10 minutes and generate its report daily. Below crontab file is responsible for collecting and generating reports.


Generating CPU Report on the Fly 5 times every 2 seconds.


[root@localhost ~]# sar 2 5 

Linux 3.10.0-123.el7.x86_64 (localhost.localdomain)     Monday 26 October 2015     _x86_64_    (2 CPU) 01:43:55  EDT     CPU     %user     %nice   %system   %iowait    %steal     %idle 01:43:57  EDT     all      0.00      0.00      0.25      0.00      0.00     99.75 01:43:59  EDT     all      0.00      0.00      0.00      0.00      0.00    100.00 01:44:01  EDT     all      0.00      0.00      0.25      0.00      0.00     99.75 01:44:03  EDT     all      0.00      0.00      0.25      0.25      0.00     99.50 01:44:05  EDT     all      0.00      0.00      0.00      0.00      0.00    100.00 Average:        all      0.00      0.00      0.15      0.05      0.00     99.80 [root@localhost ~]#


Generating Memory Usage report using -r











Reading SAR log file using -f












[root@localhost ~]# sar -r -f /var/log/sa/sa26


Create Graphs using KSAR tool


You need download KSAR tool to create graphs using /var/log/sa/sar* files


https://sourceforge.net/projects/ksar/


You need to convert time format in sar file before loading to sar you can do it by using following commands


cd /var/log/sa

LC_TIME="POSIX" sar -A -f sa08 > /tmp/sar.data.txt


now download sar.data.txt file and load it in to KSAR


Tuesday, October 23, 2018

How Reset Root Password in RHEL 7 from 9 Simple st...

cyber-techno-lk: How Reset Root Password in RHEL 7 from 9 Simple st...:
 How Reset Root Password in RHEL 7 from 9 Simple steps =================================================

How to install Apache from source

Download and copy Apache source to local Linux machine

cd /opt/software/httpd-2.4.33


./configure --prefix=/usr/local/apache LD_LIBRARY_PATH=/usr/local/ssl/lib/ LIBS=-L/usr/local/ssl/lib --with-included-apr --enable-ssl --enable-so --enable-http --enable-info --enable-cgi --enable-vhost-alias --enable-rewrite --with-mpm=prefork --enable-mods-shared --enable-deflate --enable-headers --enable-security --enable-reqtimeout --enable-so

make

make install

cp /usr/local/apache/bin/apachectl /etc/init.d/web.system chmod 777 /etc/init.d/web.system

change http.conf according to your settings.

Go to browser and open http://x.x.x.x/index.html

How to install PHP 7

Download and extract php source to /opt/software folder

cd /opt/software/php-7.2.7

yum install libjpeg-devel libpng-devel


./configure --prefix=/usr/local/apache/php --with-config-file-path=/usr/local/apache/php --with-apxs2=/usr/local/apache/bin/apxs --disable-cgi --with-zlib --with-gettext --with-sqlite3 --enable-mbstring --enable-calendar --with-curl=/usr/lib64 --with-gd --with-jpeg-dir=/usr/lib64/libjpeg.so --with-png-dir=/usr/lib64/libpng.so --enable-soap --with-libdir=/lib64 --enable-zip --with-mysqli --with-pdo-mysql --with-openssl-dir

make

make install

Add following lines in httpd.conf to enable php

LoadModule php7_module        modules/libphp7.so
AddType application/x-httpd-php .php
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

Restart httpd

/etc/init.d/web.system restart

What is Machine Learning ?


What is DevOps?


Facebook Hacked ?????

Facebook May Buy A Cybersecurity Company To Prevent Another Major Hack

AWS In 10 Minutes


Monday, October 22, 2018

Installing nagios NRPE on AWS EC2

yum install nagios-plugins-all nagios-plugins-nrpe nrpe

chkconfig nrpe on
update the config by checking allowed_hosts and
vi /etc/nagios/nrpe.cfg
sudo /etc/init.d/nrpe start

How to install Nagios on AWS

Prerequisites
=========

* Apache
* PHP
* GCC compiler
* GD development libraries

Steps
====

sudo yum install httpd php
sudo yum install gcc glibc glibc-common
sudo yum install gd gd-devel

Create Users
=========

sudo adduser -m nagios
sudo passwd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd apache

Download Nagios Core
=================

mkdir ~/downloads
cd ~/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz


Compile and Install Nagios
====================

tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8
./configure --with-command-group=nagcmd

make all

sudo make install
sudo make install-init
sudo make install-config
sudo make install-commandmode


Customize Configuration
==================

Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.

sudo vim /usr/local/nagios/etc/objects/contacts.cfg

Configure the Web Interface
====================

Install the Nagios web config file in the Apache conf.d directory.

sudo make install-webconf

Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.

sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Type the new password twice. Restart Apache to make the new settings take effect.

sudo service httpd restart

Compile and Install the Nagios Plugins
============================

cd ~/downloads
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3

Compile and install the plugins.

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
sudo make install

Start Nagios
=========

sudo chkconfig --add nagios
sudo chkconfig nagios on

Verify the sample Nagios configuration files.

sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If there are no errors, start Nagios.

sudo service nagios start


Enable 80 port in AWS
=================

* From the EC2 console select Security Groups from the left navigation pane.
* Select the Security Group applicable for the instance that Nagios was installed on and open the Inbound tab
* If there is no rule to allow HTTP traffic on port 80 then click edit in the Inbound tab to add a new rule
* Click on New Rule button
* Scroll down to select HTTP from the list under Type
* If you want to be able to access nagios from anywhere then select Save, otherwise enter the IP address or range of IP address you want to be able to access it from then select Save.

Access Nagios
===========

http://ec2-xx-xxx-xxx-xx.ap-southeast-2.compute.amazonaws.com/nagios/

Monday, September 8, 2014

How to install Redmine

===============================================================
Install the dependencies packages
===============================================================
yum -y install nano zip unzip libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA

===============================================================
Install Apache and MySQL
===============================================================

yum -y install httpd mysql mysql-server

chkconfig httpd on
chkconfig mysqld on
service httpd start
service mysqld start

/usr/bin/mysql_secure_installation

===============================================================
Turn off SELinux
===============================================================
vim /etc/selinux/config
SELINUX=disabled

===============================================================
Set up the Hostname
===============================================================
vim /etc/hosts

===============================================================
Disable IPTALBES
===============================================================
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
chkconfig iptables off
chkconfig ip6tables off

reboot

===============================================================
Install PHP and phpMyAdmin
===============================================================
yum -y install php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap

service httpd restart


rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum -y install phpmyadmin


vim /etc/httpd/conf.d/phpmyadmin.conf
change "Allow from 127.0.0.1" to "Allow from all"


vim /usr/share/phpmyadmin/config.inc.php

Replace text :
$cfg['Servers'][$i]['auth_type'] = 'cookie';

To :
$cfg['Servers'][$i]['auth_type'] = 'http';

service httpd restart


vim /etc/httpd/conf.d/phpmyadmin.conf

<VirtualHost *:8081>
    DocumentRoot /usr/share/phpmyadmin/
    ServerName costi02
</VirtualHost>

vim /etc/httpd/conf/httpd.conf

add

Listen 8081

service httpd restart


http://localhost:8081

==================================================================
Install Ruby
==================================================================
curl -L https://get.rvm.io | bash
source /etc/profile.d/rvm.sh
rvm list known

rvm install 1.9.3
ruby -v

==================================================================
Install Rubygems
==================================================================

yum -y install rubygems

==================================================================
Install Passenger
==================================================================
gem install passenger
passenger-install-apache2-module

vim /etc/httpd/conf.d/passenger.conf

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p545/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
   PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p545/gems/passenger-4.0.37
   PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p545/wrappers/ruby
</IfModule>

service httpd restart

=================================================================
Create Database for Redmine
=================================================================

mysql --user=root --password=omnibis
create database redmine_db character set utf8;
create user 'redmine_admin'@'localhost' identified by 'redadmin';
grant all privileges on redmine_db.* to 'redmine_admin'@'localhost';
quit;

================================================================
Install Redmine
================================================================

cd /var/www
wget http://www.redmine.org/releases/redmine-2.5.0.tar.gz

tar xvfz redmine-2.5.0.tar.gz
mv redmine-2.5.0 redmine
rm -rf redmine-2.5.0.tar.gz

cd /var/www/redmine/config
cp database.yml.example database.yml
vim database.yml

================================================================
Setting up Rails
================================================================

cd /var/www/redmine
gem install bundler
bundle install
rake generate_secret_token

RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

================================================================
Activate FCGI
================================================================

cd /var/www/redmine/public
mkdir plugin_assets
cp dispatch.fcgi.example dispatch.fcgi
cp htaccess.fcgi.example .htaccess


================================================================
Setting up Apache and FastCGI
================================================================

cd /var/www/
rpm --import https://fedoraproject.org/static/0608B895.txt
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install mod_fcgid
rm -rf epel-release-6-8.noarch.rpm


=================================================================
Creating Files Directory
=================================================================

mkdir -p /opt/redmine/files
chown -R apache:apache /opt/redmine
cd /var/www/redmine/config
cp configuration.yml.example configuration.yml
vim configuration.yml

Enter the directory path containing the data files you just created in the previous step into the line "attachments_storage_path".

Note: You must add a space at the begin of the path "/opt/redmine/files" after character ":"

=================================================================
Configuring Email
=================================================================

vim /var/www/redmine/config/configuration.yml

email_delivery:
   delivery_method: :sendmail
 
For GMAIL

email_delivery:
   delivery_method: :smtp
   smtp_settings:
        enable_starttls_auto: true
        address: "smtp.gmail.com"
        port: 587
        domain: "smtp.gmail.com"
        authentication: :plain
        user_name: "your_email@gmail.com"
        password: "your_password"


=================================================================
Create Virtual Host for Redmine
=================================================================

vim  /etc/httpd/conf.d/redmine.conf

<VirtualHost *:80>
        ServerName your_domain
        ServerAdmin your_domain@domain.com
        DocumentRoot /var/www/redmine/public/
        ErrorLog logs/redmine_error_log
        <Directory "/var/www/redmine/public/">
                Options Indexes ExecCGI FollowSymLinks
                Order allow,deny
                Allow from all
                AllowOverride all
        </Directory>
</VirtualHost>

==================================================================
Running Redmine
==================================================================

cd /var/www
chown -R apache:apache redmine
chmod -R 755 redmine
service httpd restart

==================================================================
Install Subversion
==================================================================

mkdir -p /opt/repositories/svn
chown -R apache:apache /opt/repositories/
chmod 0755 /opt/repositories

yum install mod_dav_svn subversion subversion-ruby


mkdir /usr/lib64/perl5/vendor_perl/Apache
ln -s /var/www/redmine/extra/svn/Redmine.pm /usr/lib64/perl5/vendor_perl/Apache/Redmine.pm

vim /etc/httpd/conf.d/subversion.conf

PerlLoadModule Apache::Redmine
<Location /svn>
        DAV svn
        SVNParentPath "/opt/repositories/svn"
        SVNListParentPath on
        Order deny,allow
        Deny from all
        Satisfy any
        LimitXMLRequestBody 0
        SVNPathAuthz off
        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
        AuthType Basic
        AuthName "Subversion Repository"
        Require valid-user
        RedmineDSN "DBI:mysql:database=redmine_db;host=localhost:3306"
        RedmineDbUser "redmine_admin"
        RedmineDbPass "your_password_database_redmine"
</Location>


==================================================================
Install Sample DATA
==================================================================

cd /var/www/redmine

RAILS_ENV=production bundle exec rake generate_session_store
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:load_default_data



If you change any db keep mind to do following

cd /var/www/redmine
RAILS_ENV=production rake db:migrate









Sunday, April 22, 2012

ජාවා ඉගෙන ගමු.. Learn Java from sinhala..

ඔන්න  මට හොඳ බ්ලොග් එකක් හම්බ උනා. මේකේ මුල ඉඳලා JAVA පාඩම් තියනවා. සිංහලෙන්. කවුරු නමුත් සෑහෙන්න මහන්සි වෙලා තියනවා.

http://javaxclass.blogspot.com/

Saturday, December 3, 2011

Rules, copyright and FOSS

Information and Communication Technology (ICT) processes and change management for organizations in the beginning, hopefully, where (at least not in the development ofReferences), organizational processes and top-down decisions are. On the other hand, the adoption of ICT due to a variety of physical processes are not linearWith multiple rationalities references the free and open source software (FOSS) development and implementation have been well explored over the past decade, relevant literature is limited toLicense and the adoption of explicit and tacit criteria developed by the FOSS community, and most economically developed countries. Common assumptions aboutOpen and distributed development and adoption of FOSS movement focused on ease. More prominence, such beliefs are dispersed and mobilizable ICTCapabilities are generally not available in developing contexts, FOSS universally perceived reliability, credibility is not in the "people" can not be taken for granted,Rules relating to copyright and other FOSS-related rules may be not present, or not enforced.

Wednesday, October 5, 2011

Sahana FOSS development model

The original idea for a cooperative consisting of three types of organizations that build community:the Educational Computer Science Department,social service organizations (Gov), andthe computing and IT corporations.
Incentives for Different organizations have different but compatible.
First, academic departments are interested in finding ways Foss and Foss teach students about the skills their students are eager to achieve.
Second, Social Service Organizations To acquire or develop software that serves its mission are interested in getting help. Such as Organizations can not afford to buy or develop proprietary software, Sahana seems to be attractive to them.
Third, productive volunteer opportunities for corporations to provide their employees with and are interested in Recruit talented students. In addition to this set of different incentives, all three kinds of organizations Sharing human and the incentive to engage in socially beneficial activities.
When outline the general role model for students. Students work closely with faculty and computing Professionals design, build and maintain the Foss. During the academic year and are on the job
many of them in social service may be held within Agencies like Red Cross or Habitat for Humanity. Sahana can be developed in cross-functional capabilities Independent of location as well as teams on a local or neighborhood scale. For example, teams of developers can be Contribute to the Sahana project,
computing, IT and corporations to provide support through financial and technical resources to drive Development as well as marketing and advertising resources as Sahana - to promote FOSS movement. The portability of The fact that the participants easily academics (including a small community like Hanthana, can make the model stems from ) Students, social service organizations, and corporate sponsors in their places. As word spreads and community
And get involved. Stability of the community or communities derives from the fact that all participants .
Volunteer Almost every human development, including such organizations need to manage projects Sahana disaster relief community and will benefit from the development of inter-operable standards. Thus At volunteers. Similarly, assuming adequate corporate financial support, this model Rely solely on volunteer effort to save some of the problems are associated.

Friday, December 17, 2010

 Google Launches ebook Store
Google opens its own online electronic bookstore in a bid to enter the lucrative ebook market hogged by Kindle-maker Amazon. Google's ebooks will be stored in the "cloud" and be available for reading from any computer connected to the Internet, or via applications on mobile devices such as smartphones.
 Android 2.3 Details Revealed, Google Nexus S Unveiled
Google's Android 2.3 is finally released and comes packing with plenty of features. The first to come packing Android 2.3? The long rumored, newly announced Google Nexus S (that's made by Samsung).
 Facebook Conducts Facelift For Profile Pages
Facebook is redesigning the profile pages of its users to make it more of a reflection of their real lives and emphasize one of the site's most popular features, photos.
 Atlona Releases HDMI to Mini DisplayPort Converter/Scaler for Home Theaters Everywhere
DP300 is the new accessory for playing video games or watching blue-ray movies. For Apple's 24 and 27-inch LED Cinema Displays and iMacs.
 PlayStation Phone's Test Pictures of the 5.0-MP Camera Leaked
Didn't believe the rumors about the PS Phone? Well, here's more proof. Guess we can expect a reveal soon, probably at CES 2011 in January.
 Google Fails to Land Groupon
Google's attempt to land Groupon appears to have broken down, making it the search giant's second failed acquisition of a social startup.


Regards,
darshana

Every Action has a Reaction !