Posts

How to Image compression faster web pages

Image
Web developers want to fast loading web pages. How to optimize image for web site with PNGs image. I using Linux operating system. Checking load web page I am use Browser Calories plugin add-ons to check web page. Web optimization Installing the tool gimp, imagemagick and optipng [huupv@huupv DR]$ sudo yum install gimp ImageMagick optipng Step 1: Get some basic information about Image Using the file command to get some information about this image [huupv@huupv Banner]$ file Devopsroles.png The screen output terminal Devopsroles.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced Using identify command get some basic information about image [huupv@huupv Banner]$ identify Devopsroles.png The screen output terminal Devopsroles.png PNG 512x512 512x512+0+0 8-bit sRGB 27579B 0.000u 0:00.000 Step 2: Run optipng command to losslessly optimize your images. [huupv@huupv Banner]$ optipng -o7 Devopsroles.png The screen output terminal ** Pro

ls command

Image
In this tutorial, How do i use ls command. The syntax ls command ls [Option] Full list [Option] of ls command ls -a list all files including hidden file starting with '.' ls -r list in reverse order ls -R list recursively directory tree ls -s list file size ls -S sort by file size ls -t sort by time & date ls -X sort by extension name ls --color colored list [=always/never/auto] ls -d list directories - with ' */' ls -F add one char of */=>@| to enteries ls -i list file's inode index number ls -l list with long format - show permissions ls -la list long format including hidden files ls -lh list long format with readable file size ls -ls list with long format with file size For example List all files and folder with option list reverse order, sort by time & date [huupv@huupv huuphan.com]$ ls -lrt The different between files and folders and symbolic link and other with ls -F option [huupv@huupv huuphan.com]$ ls -F Here, "/&

How to write cron job from linux command

Image
In this tutorial, How do i use linux command write cron job. Crontab example Run cron job At every 15th minute for zimbra_full_backup.sh */15 * * * * /opt/scripts/zimbra_full_backup.sh https://crontab.devopsroles.com/ Write cron job from linux command [root@huupv huuphan.com]# echo "$(crontab -l; echo '*/15 * * * * /opt/scripts/zimbra_full_backup.sh')" | crontab - The screen output terminal: Conclusion Thought the article, How to write cron job from linux command as above . I hope will this your helpful.

How to MySQL change user password

In this tutorial, How do i use MySQL change user password. MySQL and MariaDB are the popular open source Database for Linux Opearating System.   Mysql change root password Note: MySQL default root password is empty when you installed Mysql or MariaDB. Now, How to reset Mysql root or other users password on linux. For MySQL 5.7 or above version Step 1: Open the command terminal. sudo mysql -u root Step 2: select the database. use mysql; Step 3: Change the root password. UPDATE mysql.user SET authentication_string=PASSWORD(' YOUR_NEW_PASSWORD ') WHERE USER='root'; FLUSH PRIVILEGES; exit For MySQL 5.7 version or older version Step 1: Open the command terminal. sudo mysql -u root Step 2: select the database. use mysql; Step 3: To change the MySQL root user password. update user set password=PASSWORD(" YOUR_NEW_PASSWORD ") where User='root'; FLUSH PRIVILEGES; exit  Step 4: restart the MySQL service systemctl restart mysq

How to create a local yum repository for Centos/Redhat/Fedora

Image
In this tutorial, How to create a local yum repository for Centos / Redhat / Fedora . Step 1: mount your ISO file Create folder path /mnt/dvd [huupv@huupv huuphan.com]$ sudo mkdir -p /mnt/dvd If you used a physical DVD [huupv@huupv huuphan.com]$ sudo umount /dev/sr0 [huupv@huupv huuphan.com]$ sudo mount -t iso9660 -o ro /dev/sr0 /mnt/dvd If you used an IOS file [huupv@huupv huuphan.com]$ sudo mount -t iso9660 -o loop,ro /opt/CentOS-7-x86_64-Minimal-1511.iso /mnt/dvd Step 2: Create the repository I'll use vi editor. [huupv@huupv huuphan.com]$  vi /etc/yum.repos.d/local.repo Add the following lines: [local] name=Local DVD or ISO repository baseurl= file:///mnt/dvd gpgcheck=0 enabled=1 Step 3: Test your local repository I installing nginx package using local repository. [huupv@huupv huuphan.com]$  yum install --disablerepo="*" --enablerepo="local" nginx

Linux find command

Image
In this tutorial, Using find command to search for file or directory in linux. How to use linux find command find all folder or file. Using -exec flag. Linux find command How to find all folder not contain path ".backup" as below [huupv@huupv huuphan.com]$ find ./ -type d -not -path "*/.backup*"    -exec ls -ld {} \; The screen output terminal: How to find all symbolic link in current folder. [huupv@huupv huuphan.com]$ find ./ -type l -exec ls -l {} \; The screen output terminal: Conclusion Thought the article, you can use Linux find command. I hope will this your helpful

Linux alias tips

Image
In this tutorial, How do I  use alias command to stop and start service with human language. Linux alias tips For example, you execute command " vagrant halt app1 " to stop server app1  or " vagrant halt db " to stop server db in Vagrant . you can use alias command the define command  "stop_app1" or "stop_db" Step 1: Add command end of line in .bashrc file  [huupv@huupv ~]$ vim .bashrc The terminal output as below Step 2: Apply the change [huupv@huupv ~]$ source .bashrc The screen output terminal: [huupv@huupv ~]$ cd my_ansible/example01/ [huupv@huupv example01]$ stop_app1 DEPRECATION: The 'sudo' option for the Ansible provisioner is deprecated. Please use the 'become' option instead. The 'sudo' option will be removed in a future release of Vagrant. ==> app1: Attempting graceful shutdown of VM... [huupv@huupv example01]$ stop_db DEPRECATION: The 'sudo' option for the Ansible provi

How to Install sublime text editor on Fedora with DNF

Image
In this tutorial, How to Install sublime text editor on Fedora with DNF. Sublime Text is a powerful tool for web developer. I love it Install sublime Text editor Use sublime official yum repository for fedora system. Open terminal and import gpg $ sudo rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg $ sudo dnf config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo Install sublime text latest version your system. $ sudo dnf install sublime-text Access sublime text Yeah coding :)

netstat command not found in CentOS 7 / RHEL 7

Netstat command is tool to check the network configure and activity. The default centos 7 and RHEL 7 not found netstat command. How to use netstat command on Centos 7 and RHEL 7 To find out which package provides "netstat" command. yum provides */netstat Or yum whatprovides */netstat The output screen as below net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools Repo        : @base Matched from: Filename    : /bin/netstat Install netstat command # yum install net-tools The output screen as below: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile  * base: ftp.jaist.ac.jp  * epel: mirror.ehost.vn  * extras: ftp.jaist.ac.jp  * updates: ftp.jaist.ac.jp Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.22.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================

Linux commands cheat sheet

System Commands Command Description Examples shutdown bring your system down shutdown -h now --> Halt or poweroff after shutdown shutdown -r now --> Reboot after shutdown halt stop your system. halt reboot reboot your system. reboot uptime Tell how long the system has been running. uptime runlevel find the previous and current system runlevel. runlevel printenv print all or part of environment printenv env run a program in a modified environment env hostname show or set the system's your host name hostname --> show the system's host name hostname newhostname -->- set the system's uname print system information uname -a --> print all information locale Displays information about the current locale, or