Posts

screen command on linux

To install screen on linux For centos/RHEL base system sudo yum install screen -y For ubuntu base system sudo apt-get install screen -y screen command useful for wget,ryncs not lose session, when you detach it. For example, create the screen with title $ screen -t 'zimbra' ssh [email protected] pressing "ctrl+a" n: next the screen (switch between screen) pressing "ctrl+a" p: previous the screen (switch between screen) pressing "ctrl+a" x : lock the screen pressing "ctrl+a" k: kill the screen pressing ctrl+a d : deattach To list the screen [huupv@huupv ~]$ screen -ls There is a screen on:     31083.pts-0.huupv    (Detached) 1 Socket in /var/run/screen/S-huupv. To resume the screen screen -r 31083 How to deattached screen with Attached status [huupv@localhost]$ screen -ls The output There is a screen on: 20655.pts-4.ra3 (Attached)1 Socket in /var/run/screen/S-huupv. [huupv@localhost]$ screen -r -d 20655.pts-4.ra3 Error

How to install ibus-bogo on fedora 25

Image
How to install ibus-bogo on fedora 25. I'm running commands as privileged ! To download ibus-bogo-0.4-12.fc26.noarch.rpm wget https://kojipkgs.fedoraproject.org//packages/ibus-bogo/0.4/12.fc26/noarch/ibus-bogo-0.4-12.fc26.noarch.rpm To install ibus-bogoon fedora 25 sudo rpm -ivh ibus-bogo-0.4-12.fc26.noarch.rpm  To configure ibus-bogo on fedora 25 ibus-daemon & ibus restart ibus-setup  Note: for program writen QT, example: skype... vim ~/.bash_profile The content as following: export GTK_IM_MODULE=ibus export QT4_IM_MODULE=xim export QT_IM_MODULE=xim export XMODIFIERS=@im=ibus To after, logout and login. Thanks for reading!

How to install mediawiki on centos 6

Image
Links to below you maybe likes: How to install php7 on centos 6 How to install and configure redmine on centos 6 How to owncloud 9 install ssl certificate centos 7 How To Install the BIND DNS Server on CentOS 6 KeepAlived IP Failover on CentOS & Red Hat How to install mediawiki on centos 6 To require nginx php MySQL Step 1: To update and install epel repo, ntpd #yum update -y #yum install -y epel-release #yum install -y ntp #chkconfig ntpd on #ntpdate pool.ntp.org #service ntpd start Step 2: To install the dependencies #yum install gd sendmail gcc pcre yum-utils wget Step 3:  To install php7 for nginx remi centos 6 Step 4: To install ImageMagick #yum install php-mbstring php-fpm php-devel php-mysql php-pear ImageMagick ImageMagick-devel --enablerepo=remi-php70 #pecl install imagick #echo "extension=imagick.so" > /etc/php.d/imagick.in Step 5: To enable module php-mbstring for nginx #find / -name mbstring.so The result /opt/remi/php70/roo

Linux basic commands

Linux basic commands How to check version Ubuntu lsb_release -a How to check to distribute cat /etc/*release How to check CPU information cat /proc/cpuinfo How to check PCI devices lspci How to list all USB devices lsusb How to get PC name from IP nmblookup -A <ip> nbtscan <ip> How many connect on server who -H How many core processor nproc How to check full CPU information lscpu  How to create new user adduser huupv passwd huupv For centos usermod -aG wheel huupv For ubuntu echo "huupv ALL=(ALL) ALL" >> /etc/sudoers How to find UUID disk blkid /dev/sda6 lsblk -f To continuous....

How to install php7 on centos 6

Image
How to install php7 on centos 6, I'm use remi repo to install remi-php70. I'm running commands as root account. To install php7  yum install wget yum-utils wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6.rpm yum-config-manager --enable remi-php70 yum install php --enablerepo=remi-php70 To check for available repositories yum repolist For example: To install php7 for nginx ( Due to, nginx use php-fpm and php-mysql) yum install php-fpm php-mysql --enablerepo=remi-php70 Thanks for reading! How to install php7 on centos 6

How to install and configure redmine on centos 6

Image
How to install and configure redmine on centos 6. I'm running commands as root account! Links to below you maybe likes: How to install php7 on centos 6 How to install and configure redmine on centos 6 How to owncloud 9 install ssl certificate centos 7 How To Install the BIND DNS Server on CentOS 6 KeepAlived IP Failover on CentOS & Red Hat To require install redmine on centos 6 CentOS is installed and works Nginx   is installed and works MySQL is installed and works Your are logged as root To install the the dependence packages yum update yum install -y wget gcc gcc-c++ mysql-server mysql-devel openssl-devel readline-devel zlib-devel curl-devel libxslt-devel pcre ImageMagick-devel yum install -y epel-release  yum install -y ntp chkconfig ntpd on ntpdate pool.ntp.org service ntpd start To install ruby on centos 6 cd /usr/local/src/ wget -qO- https://cache.ruby-lang.org/pub/ruby/stable/ruby-2.3.4.tar.gz | tar xvz cd ruby-2.3.4/ ./configure --disable-inst

How to send email using mail command in linux

Image
in my post, i'm use mail command to send message email. mail -s "Subject title huuphan.com" -S [email protected] <<EOF ---------------------------------------- The content email Hello phan van huu My site: huuphan.com ----------------------------------------- EOF The script sending 100 email from command. #!/bin/sh i=1 for (( i = 1 ; i <= 100 ; i++ )); do  echo "Test Mail $i, Send from mail.huuphan.com" | mailx -v -r "[email protected]" -s "Test Mail $i" -a "/tmp/quotausage" -S smtp="mail.huuphan.com:25" -S smtp-auth=login -S smtp-auth-user="[email protected]" -S smtp-auth-password="123456789" -S ssl-verify=ignore -S nss-config-dir=/etc/ssl/certs [email protected],[email protected] done

Log file zimbra script

Image
The function read /var/log/zimbra.log use bash script. To input 1. FILE1=/var/log/zimbra.log 2. FOLDER=/tmp/test 2. NUMBER=/tmp/test/number.txt file To output TEMP_LOG=$FOLDER/tmp_zimbra.log Function f_check_folder to check folder existing yes or no. f_check_folder () {         if [[ -d $FOLDER ]]; then                 if [[ ! -s $NUMBER ]]; then                         touch $NUMBER                         echo 0 > $NUMBER                 fi         else                 mkdir -p $FOLDER                 touch $NUMBER                 echo 0 > $NUMBER         fi } Function f_get_log read /var/log/zimbra.log file f_get_log () {         NUM=`cat $NUMBER`         SUM=`expr "$NUM" + 1`         tail -n +"$SUM" $FILE1 > $TEMP_LOG         echo `wc -l < $FILE1` > $NUMBER }

curl: (35) SSL connect error

Image
How to solve problem " curl: (35) SSL connect error " For example, curl command to https://huuphan.com error and appear code 35 error as below [root@huupv httpdocs]# curl -v https://huuphan.com * About to connect() to huuphan.local port 443 (#0) *   Trying xxx.xxx.xxx.xxx... connected * Connected to huuphan.com (xxx.xxx.xxx.xxx) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb *   CAfile: /etc/pki/tls/certs/ca-bundle.crt   CApath: none * NSS error -5990 * Closing connection #0 * SSL connect error curl: (35) SSL connect error Solve problem: To update curl and nss package For centos: # yum update curl nss For ubuntu: #apt-get update curl nss

xdotool − command−line X11 automation tool

Image
To install xdotool on ubuntu sudo apt-get update sudo apt-get install xdotool To install xdotool on fedora sudo yum install xdotool To display the current coordinates of the mouse cusrsor on linux #while true; do clear; xdotool getmouselocation; sleep 0.1; done The simple script for xdotool #!/bin/bash xdotool mousemove 343 755 click 1 sleep 2 while true do     xdotool mousemove 392 44 click 1     xdotool key "Return"     sleep 3     xdotool key Page_Up     sleep 3     xdotool mousemove 277 580 click 1     sleep 3     xdotool key Page_Down     sleep 3     xdotool mousemove 718 152 click 1     sleep 3     xdotool mousemove 46 482 click 1     sleep 3     xdotool mousemove 383 15 click 1     sleep 3 done Man xdotool http://man.cx/xdotool