By piping commands together you can save yourself the trouble of filling your harddisk with the uncompressed logical volume manager (LVM) image and pipe the image direct to a logical volume.
the LV is here: /dev/lg_storage/lv_harddisk (16 gigs)
the compressed image is: disk_backup.gz (2 gigs - 16 gigs uncompressed)
you have pv installed (apt-get install pv)
as root do:
pv disk_backup.gz | gzip -d | dd of=/dev/lg_storage/lv_harddisk
this will give you:
0.88GB 0:02:09 [84.41MB/s] [=========> ] 41% ETA 0:04:30
By default, ubuntu will force each connection to have a reverse-dns lookup before establishing the session, this is great when doing a forensic audit of which IP address/FQDN logged into your server, but for day to day internal lan use, this added security measure is a PITA when you dont have a reverse dns as all it does is delay the establishment of the SSH session.
This post will be an ongoing work:
I like to have a few standard tools I like to use:
sudo apt-get install nano mc htop ncdu
I also like the desktop to default to list view not icons:
In nautilus, go to Edit -> Preferences and select "list view", instead of "icon view" (in the "default view" section).
Sometimes when you are altering the network interfaces in your computer, or in a virtual machine, you find you need to force the client to request a new lease from the DHCP server, you can do this with the command (Replace eth0 with your interface):
sudo dhclient eth0
To add a repo:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
to remove a repo:
sudo apt-add-repository --remove ppa:ubuntugis/ubuntugis-unstable
If you find yourself with an old version of ubuntu that is unable to update or upgrade, the solution is very simple.
For example, if you are running Ubuntu 10.10 (Maverick Meerkat) and you want to upgrade it
Ubuntu maintains a repo for this so open your sources file in the terminal with:
sudo nano /etc/apt/sources.list
then comment out all your repos, and use this(substitute maverick with the old code of your outdated ubuntu):
## EOL upgrade sources.list
deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted universe multiverse
So, you built a ubuntu machine and called your admin user tester, now you want to rename your user from tester to John Doe (jdoe), well if you dont know how, this can be VERY frustrating. Heres what you do (works for 10.10-12.04):
First, reboot the system, and before it boots, press and hold the shift key until you enter the grub menu
Next choose the first recovery mode option below the main current kernel and select it.
SO today I noticed one of my VMs had a full disk, but when I did the usual tricks to find the culprits I discovered 4 gigs in the root folder:
Shocked, I tried to examine the files, but there were too many to look at, and even to many to delete with the RM command.
So to solve the problem I became root with:
This is a viable approach - Start by stopping/ shutting down the VM:
Now we need to grow the qcow2 disk. First, change to the folder with your VM images
Next convert you image to raw (Takes a while)
sudo qemu-img convert -f qcow2 /var/lib/libvirt/images/sparcs_wx.img -O raw ~/mydisk.raw
I then expanded the disk to be 20GB (takes a second)
sudo dd if=/dev/zero of=mydisk.raw bs=1M count=0 seek=20480
Many trick work, this is just one ;-)
sudo rm /var/lib/apt/lists/* -
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update
Recent blog posts
- Easy exporting of Drupal 7 custom fields for use in module code.
- Midnight Commander on OS-X
- Get lists of NIDs from DB filtering by fields without having to do joins - Hello "Entity Field Query"
- Setting the maximum upload size or php memory for Drupal 7
- Charts and Graphs in Drupal 7
- Restore a LVM image to LVM direct from gzip to LVM with a progress bar
- Check if port XXX is listening on your server
- Fix slow SSH response on your Ubuntu Server
- Things i like to do to Ubuntu to make it rock.
- Find and eliminate rogue or ghost KVM Virtual machines under Cloudmin