How to change the DNS setting?
Answer:
1. Edit the /etc/resolv.conf file, assume Debian/Ubuntu
sudo vi /etc/resolv.conf
2. Add or replace, e.g. using Google Public DNS servers
nameserver 8.8.8.8
nameserver 8.8.4.4
3. Done.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to change the DNS setting?
Answer:
1. Edit the /etc/resolv.conf file, assume Debian/Ubuntu
sudo vi /etc/resolv.conf
2. Add or replace, e.g. using Google Public DNS servers
nameserver 8.8.8.8
nameserver 8.8.4.4
3. Done.
How to turn off SELinux?
Answer: (pick either one)
1. Change the run-time configuration (won't take effect when you reboot)
# sestatus informs you of the two permission mode statuses,
# the current mode in runtime and the mode from the config
# file referenced during boot:
sestatus | grep -i mode
Current mode: enforcing
Mode from config file: enforcing
# Changing the runtime enforcement doesn't effect the
# boot time configuration:
setenforce 1
sestatus | grep -i mode
Current mode: permissive
Mode from config file: enforcing
2. Turn off SELinux permanently, use the following command
system-config-securitylevel
How to remove BOM from UTF-8?
Answer:
# awk '{if(NR==1)sub(/^\xef\xbb\xbf/,"");print}' text.txt
Source: http://stackoverflow.com/questions/1068650/using-awk-to-remove-the-byte-order-mark
Updated: (Suggested by Van Overveldt Peter)
# tail --bytes=+4 text.txt
Safely reboot a Linux server?
Answer: Use the following command:
shutdown -r now
How to check if a rpm package is already installed?
Answer:
To query if a package is installed, e.g.
rpm -q httpd
To display package information, e.g.
rpm -qi httpd