Press "Enter" to skip to content

Posts published in “Linux”

CentOS Basic Configuration


The CentOS Project is a community-driven free software effort focused on delivering a robust open source ecosystem. For users, CentOS offers a consistent manageable platform that suits a wide variety of deployments. For open source communities, CentOS offers a solid, predictable base to build upon, along with extensive resources to build, test, release, and maintain their code. 1. Find Out Installed Package [john@linux1 /]$ rpm -qa |lessplymouth-0.8.9-0.24.20140113.el7.centos.x86_64libsoup-2.48.1-3.el7.x86_64libaio-0.3.109-13.el7.x86_64dmidecode-2.12-9.el7.x86_64passwd-0.79-4.el7.x86_64bind-libs-lite-9.9.4-29.el7_2.2.x86_64sed-4.2.2-5.el7.x86_64grub2-2.02-0.34.el7.centos.x86_64libcom_err-1.42.9-7.el7.x86_64rsyslog-7.4.7-12.el7.x86_64biosdevname-0.6.2-1.el7.x86_64dracut-config-rescue-033-360.el7_2.x86_64libacl-2.2.51-12.el7.x86_64openssh-clients-6.6.1p1-23.el7_2.x86_64xe-guest-utilities-6.5.0-1432.x86_64libgcrypt-1.5.3-12.el7_1.1.x86_64libpcap-1.5.3-8.el7.x86_64cronie-1.4.11-14.el7.x86_64iwl6050-firmware-…….[john@linux1 /]$ rpm -qa |grep syslogrsyslog-7.4.7-12.el7.x86_64 2. Network Interface Configuration DHCP or Static:Step 1 » Check the network interface name by typing…

Ubuntu Basic Configurations and LAMP Installation


1. Interfaces Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-16-generic x86_64) * Documentation: packages can be updated.37 updates are security updates.Last login: Sat Feb 13 20:16:03 2016 from$ cd /etc/networkjohn@ubuntu15:/etc/network$ sudo vi interfaces[sudo] password for john:  # This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interfaceauto loiface lo inet loopback# The primary network interface — use DHCP auto eth0iface eth0 inet dhcp# The secondart network interface…

Basic Linux Commands (Tips and Tricks)


1. Basic Commands man : manualls :List Directory Contentspwd :print working directorycd :change directorymkdir :Make directorycp :Copymv :Movefind and locate and whereiskill passwd :Passwordmd5sum :Compute and Check MD5 Message Digesthistory :History (Event) Record。sudo :(super user do)touch :Update the access and modification times of each FILE to the current timechmod :change file mode bitschown :change file owner and groupapt :Advanced Package Tooldd: Convert and Copy a file        root@linux:~# dd if=/home/user/Downloads/debian.iso of=/dev/sdb1 bs=512M; synctar : Tape Archivecal : Calendarcat…

Linux : find big file in the all directories


1. Juniper Firewall   find . -type f -size +10000 -exec ls -lh {} ;  Sample output: root@FW% find . -type f -size +10000 -exec ls -lh {} ; -rw-r–r–  1 930  929   134M Jan  5 17:34 ./cf/packages/junos-11.4R6.6-domestic-rw-r–r–  1 root  wheel   139M Sep  8  2011 ./cf/var/log/junos-srxsme-11.2R2.4-domestic.tgz-rw-r—–  1 root  wheel   4.9M Feb 11 17:12 ./cf/var/db/idpd/db/secdb_02.db-rw-r—–  1 root  wheel   6.7M Feb 11 17:13 ./cf/var/db/idpd/db/secdb_03.db-rw-r—–  1 root  wheel    64M Feb 11 17:13 ./cf/var/db/idpd/db/secdb_06.db-rwxr-xr-x  1 admin  20    24M May…

Use your ssh key to encrypt / decrypt files


Create a file:echo ‘This is a sekret’ >/tmp/msg.txt Export public key:openssl rsa -in ~/private.pem -out /tmp/ -outform PEM -pubout Encrypt file with public key (anyone can have this key):openssl rsautl -encrypt -inkey /tmp/ -pubin -in /tmp/msg.txt -out /tmp/file.enc Decrypt the file with private key (only you should have the private key):openssl rsautl -decrypt -inkey ~/private.pem -in /tmp/file.enc -out /tmp/decrypted.txt Check decoded message:cat /tmp/decrypted.txt