2016/09/03

Linux Command Backup Part 1

Check System Memory Usage...
free -h

Check System Disk Usage...
df -h

Clean System Memory Cache...
sync; sudo echo 3 > /proc/sys/vm/drop_caches

List TCP Port 80
netstat -an | grep :80 | sort

Count TCP Port 80 Connection
netstat -n | grep :80 | wc -l

List Client IP TCP Port 80 Connection
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1

Openfire JVM Heap Memory Configuration List

128GB
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -Xms128g -Xmx128g -Xmn8g -Xss256K -XX:SurvivorRatio=8"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:PermSize=4g -XX:MaxPermSize=4g"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:LargePageSizeInBytes=512m -XX:+UseFastAccessorMethods"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:+DisableExplicitGC"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSParallelRemarkEnabled"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:SoftRefLRUPolicyMSPerMB=1 -XX:CMSInitiatingOccupancyFraction=80"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:/var/tmp/openfire-gc.log"

2016/08/06

MySQL Remote Connect

mysql -uroot -p
use mysql;
update user set host='%' where user='root' and host='localhost';
exit
service mysql restart

2016/06/21

How to install VirtualBox Guest Additions on Ubuntu Server 14.04

sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)
sudo mount /dev/cdrom /media/cdrom
ls -l /media/cdrom/
sudo /media/cdrom/VBoxLinuxAdditions.run

2016/06/17

How to install Docker Bugzilla on Ubuntu 14.04

[user@localhost ~]$ sudo su
[root@localhost ~]$ apt-get update
[root@localhost ~]$ apt-get install -y python-pip
[root@localhost ~]$ curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
[root@localhost ~]$ pip install -U fig
[root@localhost ~]$ git clone https://github.com/dklawren/docker-bugzilla-fig.git docker-bugzilla
[root@localhost ~]$ cd docker-bugzilla
[root@localhost ~]$ fig up

Open web browser and type URL "http://localhost/bugzilla" to login.

ADMIN_EMAIL = admin@example.com
ADMIN_PASSWORD = password

2016/06/12

How to install Redmine 2.4.2 on Ubuntu 14.04

-------Install Prerequisites-------
sudo su
apt-get update && apt-get -y upgrade
apt-get -y install apache2 libapache2-mod-passenger mysql-server mysql-client
apt-get -y install redmine redmine-mysql

-------Edit passenger.conf-------
nano /etc/apache2/mods-available/passenger.conf

PassengerDefaultUser www-data
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby

ln -s /usr/share/redmine/public /var/www/redmine
gem install bundler

2016/06/11

How to install Ruby 2.2 on Ubuntu 14.04

apt-get -y install rbenv
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.2.0
rbenv global 2.2.0
ruby -v

2016/06/09

How to install Nagios Core Server and Client Agent on Ubuntu Server 14.04

-------Install Prerequisites-------
[user@localhost ~]$ sudo su
[root@localhost ~]$ apt-get update
[root@localhost ~]$ apt-get -y install build-essential libgd2-xpm-dev apache2 apache2-utils unzip
[root@localhost ~]$ useradd -m nagios
[root@localhost ~]$ passwd nagios
[root@localhost ~]$ groupadd nagcmd
[root@localhost ~]$ usermod -a -G nagcmd nagios
[root@localhost ~]$ usermod -a -G nagcmd www-data

-------Install Nagios Core Server-------
[root@localhost ~]$ wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
[root@localhost ~]$ tar xzf nagios-4.1.1.tar.gz
[root@localhost ~]$ cd nagios-4.1.1
[root@localhost ~]$ ./configure --with-command-group=nagcmd
[root@localhost ~]$ make all
[root@localhost ~]$ make install-webconf
[root@localhost ~]$ /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-enabled/nagios.conf
[root@localhost ~]$ ls -l /etc/apache2/sites-enabled/

2016/06/07

How to change Hostname and add new user on Ubuntu

[user@localhost ~]$ sudo nano /etc/hostname
[user@localhost ~]$ sudo nano /etc/hosts

ubuntu-vm

[user@localhost ~]$sudo hostname

[user@localhost ~]$ sudo useradd -m newuser
[user@localhost ~]$ sudo passwd newuser

2016/06/03

How to install Openfire 4.0.2 on Ubuntu Server 14.04

-------Install OpenJDK 7 and MySQL 5.6-------
apt-get update
apt-get install -y openjdk-7-jre
apt-get install -y mysql-server-5.6
mysql -u root -p
CREATE DATABASE openfire CHARACTER SET='utf8′;
CREATE USER 'openfire'@'localhost' IDENTIFIED BY 'openfire';
GRANT ALL PRIVILEGES ON openfire.* TO openfire@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

2016/05/30

How to install Docker on Ubuntu 14.04

-------Install Docker-------
curl -sSL https://get.docker.com/ | sudo sh

-------Install Docker-Compose-------
curl -L https://github.com/docker/compose/releases/download/1.7.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

2016/05/26

How to Install Bugzilla 5.0 on Ubuntu Server 14.04

-------Install Prerequisites-------
apt-get update
apt-get install -y git nano
apt-get install -y apache2 mysql-server libappconfig-perl libdate-calc-perl libtemplate-perl libmime-perl build-essential libdatetime-timezone-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-modifier-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl apache2-mpm-prefork libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libauthen-sasl-perl libtemplate-perl-doc libfile-mimeinfo-perl libhtml-formattext-withlinks-perl libfile-which-perl libgd-dev libmysqlclient-dev lynx-cur graphviz python-sphinx rst2pdf

2016/05/18

How To Install the Munin Monitoring Tool on Ubuntu 14.04

Munin Monitoring Server 1

1.sudo su
2.apt-get update
3.apt-get install -y apache2 apache2-utils
4.apt-get install -y libcgi-fast-perl libapache2-mod-fcgid
5./usr/sbin/apachectl -M | grep -i cgi < Check output display should be "fcgid_module (shared)" >

optional command: a2enmod fcgid < If step 5 is fail >

6.apt-get install -y munin
7.gedit /etc/munin/munin.conf
8.Find these lines to remove # and modify to "htmldir   /var/www/munin"

dbdir     /var/lib/munin
htmldir   /var/www/munin
logdir    /var/log/munin
rundir    /var/run/munin

tmpldir /etc/munin/templates

2016/05/16

How to display hidden folder and files on MAC OS X

Open Terminal, type the command as below.

Enable
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder

Disable
defaults write com.apple.finder AppleShowAllFiles NO
killall Finder

2016/05/09

How to install Tarantula on CentOS

yum -y install make gcc readline-devel zlib-devel openssl-devel libyaml redhat-lsb
curl -L https://get.rvm.io | sudo bash -s stable --rails
cd /usr/local/rvm/archives/
tar -zxvf rvm-1.27.0.tgz
cd rvm-1.27.0
./install
source /etc/profile.d/rvm.sh
cd /etc/profile.d/
yum -y install http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum -y install nano
nano /etc/selinux/config
SELINUX=permissive

2016/05/01

How to install and run Tsung 1.6 on Ubuntu 14.04

Update system
1.[user@localhost ~]$ sudo apt-get update

Install Tsung report generator tool
2.[user@localhost ~]$ sudo apt-get install -y gnuplot-nox libtemplate-perl libhtml-template-perl libhtml-template-expr-perl

Install Erlang
3.[user@localhost ~]$ sudo apt-get install -y erlang

Download and install Tsung
4.[user@localhost ~]$ tar -zxvf tsung-1.6.0.tar.gz -C /home/tsung
5.[user@localhost ~]$ cd /home/tsung/tsung-1.6.0/
6.[user@localhost ~]$ ./configure && make && sudo make install
7.[user@localhost ~]$ tsung -v

2016/01/29

How to modify OS description on Windows boot menu

1.Press "Win+R" and type "cmd" to open Windows Command Prompt.
2.Type "bcdedit" and enter, you'll see all of OS options.
3.Type "bcdedit /set {identifier} description "Windows 10 Pro x64 #10586" to modify it which OS you want.
4.It will show "The operation completed successfully." message after finished.