- cp: omitting directory
- Create symbolic links
- Test disk performance with hdparm
- Install from source
- Install .bin
- RPM installation
- Find USB devices
- Mount USB storage devices
- Static IP configuration for Linux
- Install default LAMP stack (Ubuntu) using apt-get
- Network interface disappeared after moving VMware virtual machine
- Update and patch CentOS / Redhat
- Show list of software to be updated
- Some packages are being held back
- Basic IPTables configuration
- Only update specific packages
- Configure SELinux to be permissive
tail -f /var/log/messages
Problem: when trying to copy a directory to another location I get the following error cp: omitting directory.
Solution: add -r after the command cp, which means copy directories recursively.
cp -r old_file new_file
ln -s /etc/apache2 /home/user
* Directories must use soft links.
hdparm -Tt /dev/sda
tar zxvf file.tar.gz
Move to the newly created directory.
Execute the script.
chmod +x file.bin
Execute the script.
Install RPM package.
rpm -iuh packages
Upgrade RPM package.
rpm -uvh package
The USB drive will be mount in to the folder named “mount” located in the users home directory.
mount /dev/usb mount
Assign the mount directory proper permission.
chmod 777 /mount/point
Unmount the USB device.
The configuration is located at /etc/network/interfaces.
# The primary network interface # allow-hotplug eth0 auto eth0 iface eth0 inet static address 192.168.1.3 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 gateway 192.168.1.1
Set DNS to resolve /etc/resolv.conf.
apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server
The solution is to remove the persistent-net.rules.
In Debian the file has the name of :
On Ubuntu the file name changes to :
To update CentOS or Redhat issue the following command with Root privileges.
The output will be
yum list updates
The following allows port 22, 80 and 443 in.
*filter # Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 -A INPUT -i lo -j ACCEPT -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT # Accepts all established inbound connections -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Allows all outbound traffic # You can modify this to only allow certain traffic -A OUTPUT -j ACCEPT # Allows HTTP and HTTPS connections from anywhere (the normal ports for websites) -A INPUT -p tcp --dport 80 -j ACCEPT -A INPUT -p tcp --dport 443 -j ACCEPT # Allows SSH connections # # THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE # -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT # Allow ping -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT # log iptables denied calls -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7 # Reject all other inbound - default deny unless explicitly allowed policy -A INPUT -j REJECT -A FORWARD -j REJECT COMMIT
yum update packagename
yum update httpd
To modify SELINUX we need to edit the file /etc/selinux/config, do not forget to become root before modifying the files.
Search for the line that reads :
The following alternative options are available :
permissive and disabled
I prefer the service to function under “permissive”.
Now, reboot the system and the changes should take effect.