Ubuntu: Difference between revisions

3,976 bytes added ,  4 years ago
 
(16 intermediate revisions by the same user not shown)
Line 171:
UUID=467A89307A891DB5 /VM ntfs defaults 0 2
/mnt/folderonyourcomp / cifs username=aman,password=cisco,domain=yourdomain 0 2
 
===== NFS Mount =====
 
Source: [https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04 digitalocean.com]
 
{{notice|This section needs to be tested.}}
 
;On Server side:
 
Installation
sudo apt-get install nfs-kernel-server
 
*Make a share directory called nfs:
sudo mkdir /var/nfs/general -p
 
*NFS will translate any root operations on the client to the nobody:nogroup credentials as a security measure.
*Therefore change the directory ownership to match those credentials:
sudo chown nobody:nogroup /var/nfs/general
 
*For /home do not change permissions, else it will break down the system.
 
*Configuring the NFS Exports
sudo nano /etc/exports
/var/nfs/general 203.0.113.256(rw,sync,no_subtree_check)
/home 203.0.113.256(rw,sync,no_root_squash,no_subtree_check)
 
'''rw:''' This option gives the client computer both read and write access to the volume.
'''sync:''' This option forces NFS to write changes to disk before replying. This results in a more stable and consistent environment since the reply reflects the actual state of the remote volume. However, it also reduces the speed of file operations.
'''no_subtree_check:''' This option prevents subtree checking, which is a process where the host must check whether the file is actually still available in the exported tree for every request. This can cause many problems when a file is renamed while the client has it opened. In almost all cases, it is better to disable subtree checking.
'''no_root_squash:''' By default, NFS translates requests from a root user remotely into a non-privileged user on the server. This was intended as security feature to prevent a root account on the client from using the file system of the host as root. no_root_squash disables this behavior for certain shares.
 
Restart NFS
sudo systemctl restart nfs-kernel-server
 
;On Client side:
sudo apt-get install nfs-common
 
*Edit fstab file:
sudo nano /etc/fstab
10.10.1.30:/home/cores /mnt/cores/ nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp
 
*Test the mount:
sudo mount -a
 
==== Different ways to disable IPv6 for network efficiency====
Line 372 ⟶ 415:
To verify status:
sudo systemctl status networking.service
 
===== IP Traffic Forwarding =====
 
Enable IPv4 Forwarding:
# sudo su
# echo "1" > /proc/sys/net/ipv4/ip_forward
 
Verify:
# cat /proc/sys/net/ipv4/ip_forward
1
 
Make the change persistent:
# sysctl -a | grep ip_forward
net.ipv4.ip_forward = 1 ==> Copy this line
 
# vi /etc/sysctl.conf
net.ipv4.ip_forward = 1 ==> Paste it at the end of this file
 
IPtables rules:
iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE
iptables -A FORWARD -i ens193 -o ens192 -j ACCEPT
iptables -A FORWARD -i ens193 -o ens192 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables-save
 
===Software Centre===
Line 628 ⟶ 694:
 
* Remove language related ign from apt-get update:
sudo geditnano /etc/apt/apt.conf.d/00aptitude
 
Add the following line at the end of this file:
Line 667 ⟶ 733:
* Check If Your Hard Drive Is Overworking
sudo apt install iotop
 
* Use Bootchart to find out slow services/processes:
systemd-analyze time
systemd-analyze blame
systemd-analyze plot > bootchart.svg
 
* Slow boot due to nonexistent swap partition [https://askubuntu.com/questions/1030867/ubuntu-18-04-how-to-diagnose-fix-very-slow-boot askubuntu.com]:
 
At some point during the upgrade, the initramfs config was modified, adding a line pointing to a nonexistent swap partition.
The slow boot was because it was looking for this partition and then timing out after 30 seconds.
 
sudo nano /etc/default/grub
 
Add '''noresume''' to the below line:
 
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume"
sudo update-grub
sudo reboot
 
===Miscellaneous===
Line 1,007 ⟶ 1,091:
echo $(dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p') $(dpkg --list | grep linux-headers | awk '{ print $2 }' | sort -V | sed -n '/'"$(uname -r | sed "s/\([0-9.-]*\)-\([^0-9]\+\)/\1/")"'/q;p') | xargs sudo apt-get -y purge
 
==== FIGlet ====
Source: [http://www.shellhacks.com/en/Creating-ASCII-Text-Banners-from-the-Linux-Command-Line shellhacks.com]
 
Line 1,036 ⟶ 1,120:
You can alter the complete MOTD message from below files:
/etc/update-motd.d/
 
==== Mount VMDK file ====
 
Source: [https://stackoverflow.com/questions/22327728/mounting-vmdk-disk-image stackoverflow.com]
 
Installation:
sudo apt install libguestfs-tools
 
Check Disks & partitions
sudo lsblk
 
Create Mount point:
sudo mkdir /mnt/vmdk
 
Mount the VMDK Image:
sudo guestmount -a pro_nlb_avi-se-02old-disk1.vmdk -m /dev/sda3 --ro /mnt/vmdk
cd /mnt/vmdk
 
Unmount the image:
sudo guestunmount /mnt/vmdk
 
==== Thumbnails for Media ====
 
Install Thumbnail applications
sudo apt install ffmpegthumbnailer
sudo apt install gstreamer1.0-libav
 
Clear the cache
rm -r ~/.cache/thumbnails/fail
Or
rm -rf ~/.cache/thumbnails/*
 
 
 
<br />