ubuntu linux
mount and umount a iso file
bash
# create the directory where the iso file will be mounted
sudo mkdir /media/iso
# mount the file
sudo mount -o loop YOUR_FILE.ISO /media/iso
# umount the file
sudo umount /media/isoreplace servers on sources.list
bash
sudo sed -i 's/us.archive.ubuntu.com/br.archive.ubuntu.com/g' /etc/apt/sources.listreference: http://askubuntu.com/a/20416
identify a new network card
in my case, an Realtek RTL8029AS from parallels desktop.
bash
lsmod |grep ne
modprobe -v ne
modprobe -v ne2k-pcithe drive was not listed. so, i need to check if the network card was found.
bash
lspci -v | grep -A12 "Ethernet"the nic was here, but no ip was set up. so, i removed the contents of 70-persistent-net.rules file, and restarted the server.
bash
echo "" > /etc/udev/rules.d/70-persistent-net.rules
shutdown -r nowfix setting locale failed error
bash
locale-gen pt_BR.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure localescreating a swap file
bash
# create a 4Gb swap file
sudo fallocate -l 4G /swapfile
# set permissions
sudo chmod 600 /swapfile
# format the file
sudo mkswap /swapfile
# enable swap on this file
sudo swapon /swapfile
# set some options on ubuntu, to better swap use
sudo sysctl vm.swappiness=10
sudo sysctl vm.vfs_cache_pressure=50to made this changes permanent, add this to /etc/fstab
txt
/swapfile none swap sw 0 0and add this to /etc/sysctl.conf
txt
vm.swappiness = 10
vm.vfs_cache_pressure = 50removing the canonical landscape service
bash
sudo apt-get remove --purge landscape-client landscape-client-ui landscape-client-ui-install landscape-commoninstall vmware tools
bash
sudo apt-get install --no-install-recommends open-vm-dkms
sudo apt-get install open-vm-toolsredefining the apt-cacher's cache
bash
# stop the service
sudo /etc/init.d/apt-cacher-ng stop
# move the old cache to a new place. This way, we can remove it
# in background (depending on the size, deletion may take a while)
sudo mv /var/cache/apt-cacher-ng /var/cache/apt-cacher-ng.old
sudo rm -rf /var/cache/apt-cacher-ng.old &
# create the new cache hierarchy, and set the correct owner
sudo mkdir -p /var/cache/apt-cacher-ng/{headers,import,packages,private,temp}
sudo chown -R apt-cacher-ng:apt-cacher-ng /var/cache/apt-cacher-ng
# start the service again
sudo /etc/init.d/apt-cacher-ng start