Posts

Criticical BASH vulnerability discovered – update BASH on your CentOS7

[rprasad@vm ~]$ sudo env x='() { :;}; echo vulnerable' bash -c "echo this is a test"         //Run following command to check. If it outputs vulnerable then our bash is vulnerable vulnerable this is a test [rprasad@vm ~]$ sudo su -                                               //Become root [root@vm ~]# yum clean all && yum update bash Loaded plugins: fastestmirror Cleaning repos: base extras updates Cleaning up everything Loaded plugins: fastestmirror base                                                     | 3.6 kB     00:00 extras                                                ...

CentOS7 boot from USB thumbdrive.

Image
Ref. to How to install using USB Using Windows Starting with CentOS 6.5, one can create a bootable USB key simply by installing the ISO file on the key using a program such as  Win32 Disk Imager . This will delete all information already on the key. Downoad: Win32 Disk Imager Install Win32 Disk Imager Transfer the ISO image to USB using above Win32 Disk Imager. Click on "Write" button. Ready to boot and install from your USB key.

Grep using list of words from a file.

You need to use the option  -f : $ grep -f A B The option  -F  does a fixed string search where as  -f  is for specifying a file of patterns. You may want both if the file only contains fixed strings and not regexps. $ grep -Ff A B You may also want the  -w  option for matching whole words only: $ grep -wFf A B Read  man grep  for a description of all the possible arguments and what they do. NOTE: A= file. Searching in file B to see if ANY of the words in file A occur in it.

compare file A from file B, and save the content in file C

while read line; do grep -q $line A.txt || echo $line; done < B.txt >C.txt I have got the above example, its very interesting and helpful as well.  If A  is the file with the first content and B  is the file with the second content.  It prints what is not found in the second file. Can save output using redirection operator.

Racktable on ubuntu installation

Racktable dependency packages :- rajeshp@ubuntu01:~$sudo apt-get install apache2 apache2.2-common libapache2-mod-php5 \ php5-snmp php5-ldap php5 php5-common php5-gd curl php5-mysql \ mysql-client mysql-common mysql-server \ Add user for Racktable:- rajeshp@ubuntu01:~$sudo useradd -u 4000 -g users -s /sbin/nologin -c "RackTables User" -md /home/racktables racktables MYSQL for Racktables :- mysql> create database racktables; mysql> grant all on racktables.* to root; mysql> grant all on racktables.* to root@localhost; mysql> grant all on racktables.* to rackuser; mysql> grant all on racktables.* to rackuser@localhost; mysql> grant all on racktables.* to 'rackuser'@'localhost' identified by 'rackpw'; mysql> exit chown www-data:www-data secret.php; chmod 400 secret.php

Query Package pre-installed or not - Ubuntu

rajeshp@ubuntu01:~$ dpkg-query -l |grep apache ii  apache2                             2.4.6-2ubuntu2.2                 amd64        Apache HTTP Server ii  apache2-bin                         2.4.6-2ubuntu2.2                 amd64        Apache HTTP Server (binary files and modules) ii  apache2-data                        2.4.6-2ubuntu2.2                 all          Apache HTTP Server (common files) or, simply use  rajeshp@ubuntu01:~$  dpkg-query -l              //For all the installed packages in current server If you know the package name :- ...

Disabling IPv6 on -Ubuntu

Check IPv6(disabled or enabled), with rajeshp@ubuntu:~$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6 0                           //Enabled Disabled IPv6 with the following lines in /etc/sysctl.conf : - net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 Above, using command line(CLI):- rajeshp@ubuntu:~$ echo "#Disable ipv6" | sudo tee -a /etc/sysctl.conf rajeshp@ubuntu:~$ echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf rajeshp@ubuntu:~$ echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf rajeshp@ubuntu:~$   echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf Reactivate the above configuration by, executing :- rajeshp@ubuntu:~$ sysctl -p rajeshp@ubuntu:~$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6 1                   ...