Categories
Unix

Expanding disk space on a KVM virtual machine

I use KVM on CentOS 6.2 and had a need to expand the disk space for one of the VMs. In some cases, it makes sense to have the VM’s disk space relatively small before you know how much you are going to need, and then expand it when ready. I hate having a few VMs that are running at 20% disk usage, knowing that I am wasting space. Of course, you could use your VM with auto-expanding space, but I don’t want the trade-off of reduced disk access speed.

So, in a succinct fashion here are the steps I used to get this done! In this example, my vm is called “vm10” and I’m adding 200G

  • <shutdown your VM if running>
  • <cd into your VM image directory>
  • mv vm10.img vm10.img.bk
  •  qemu-img create -f raw addon.raw 200G
  • cat vm10.img.bak addon.raw >> vm10.img
  • <start the VM>
  • fdisk /dev/vda
  • p
  • d
  • 2
  • p
  • n
  • p
  • 2
  • <enter>
  • <enter>
  • p
  • t
  • 2
  • 8e
  • p
  • w
  • reboot
  • pvdisplay
  • pvresize /dev/vda2
  • lvresize /dev/VolGroup00/LogVol00 -l +100%FREE
  • resize2fs /dev/VolGroup00/LogVol00
  • reboot

And there you go! A newly sized VM.

Categories
Unix

“containing working copy admin area is missing” in SVN

I was recently working with SVN and somehow a directory got fubar’ed and I was getting that message when trying to commit.

The resolution was to do a fresh checkout in a temp directory, then TAR up the .svn folder for my fubar’ed directory and copy it over to my current SVN workspace. I had to make sure I still added any files that were not added in the other .svn folder, but that was no problem and my issue was resolved!

Categories
Unix Websites

Webmail on Linux

I maintain my own mail server and for cases where I can’t easily connect directly with an IMAP mail client, I use a webmail interface.

I’ve been using SquirrelMail for a while, and just recently installed Roundcube webmail which looks worlds better!

The only drawback is that it does not have vacation plugin that works right away with Dovecot, so I’m still playing around with that functionality…

Categories
Unix

Installing Fedora 16 with Tips 

I have to admit I wasn’t too thrilled with Fedora 15, it seemed slower than when I had Fedora 13 running. Perhaps it was because I did the “upgrade” instead of a fresh install. But I did decide to upgrade my hardware and did a fresh install of Fedora 16.

In general, the install went well, there are a few areas I have some notes and tips that may help you if you are encountering problems.

/etc/init.d has changed

Yes it has, but don’t panic! You basically use the “systemctl” command to handle things now, it is a little tricky because you will need to “enable” the service first, THEN you can start/stop/restart like you may have done with init.d in the past. So, for example:

systemctl enable httpd.service

systemctl start httpd.service

To see a full listing of what is available:

systemctl -t service

One thing that is not as obvious, are the iptables commands. For this, you can use:

/usr/libexec/iptables.init save

to save the iptables so they don’t get lost on reboot.

Setting Up Virtualbox

Here are the quick commands to get the awesome Virtualbox going:

cd /etc/yum.repos.d/

wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo

yum install kernel-devel kernel-headers gcc dkms

/etc/init.d/vboxdrv setup

I would also install Google Chrome:

Add following to /etc/yum.repos.d/google.repo file (this is for a 64 bit machine):

[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Then:

yum install google-chrome-stable

Getting Flash Installed

rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
yum check-update
yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

NVidia Drivers

Lastly, here are my tips on getting NVidia drivers going, I have three monitors across two NVidia graphics cards that each have 1 DVI and 1 VGA, so I have 2 monitors on the DVI ports, and 1 on the VGA.

Get nvidia drivers direct from nvidia.com, go to the drivers/download section and you will download a linux “.run” file which is basically a shell command file.

Disable nouveau, by appending the following to /etc/modprobe.d/blacklist.conf

blacklist nouveau

options nouveau modeset=0

Drop out of “X” windows, as root do “init 3” — if that does not work, you can ssh into your host from another to get a non-windows login.

Run the nvidia “run” file, i.e. “sh NVIDIA-Linux-x86_64-295.33.run”

Start “X” back up and configure your xorg.conf. Of course, this is an insanely troublesome thing to do, and since all systems are going to be different I can’t tell you what to put exactly. But, I can provide my xorg.conf file and you can perhaps get some help from checking it out.

One last important note… when you eventually “yum update” your system and get a new kernel, you will need to re-run that NVIDIA run file. For me, my system comes up with blank screens until I ssh into my box from another host, re-run the “run” file, and reboot.

Those are my Fedora 16 tips! Hope they help you!

 

Categories
Hardware Movies Unix

Ubuntu and XBMC

Xbox Media Center be praised!

I just installed this on a linux Ubuntu box, and I used the “Live” version which I put onto a USB drive. So, the steps:

  1. Download the ISO file from http://xbmc.org/download/
  2. Burn the ISO onto a thumb drive (or CD)
  3. Boot your host off the USB/CD, you may need to hit F11 during bootup to get to your BIOS and choose boot media.
  4. When booting you can either install or boot off the media to see how it works on your setup. Once you verify your setup, you should install.
  5. Hook up to your TV and stereo and go!

Now, I actually have a file server in my home that stores all my movies in AVI format. So, my XBMC is a very shrunk down system, you could even put it on a small solid state flash drive which would be nice and fast. Then the question is, how to access the files from another server?

I use NFS on my server and mount them on the XBMC host. However, I had to do a few steps to get this going:

  1. You need to install nfs-common to be able to mount. But, the Live install does not have that by default. So, you need to SSH into your XBMC. This is a little tricky, since XBMC will use DHCP to get an IP address and you may not know what IP it has!
  2. Find the IP. One way is to use a “pinger” program that will try and ping every IP in your home network range, and once you do that you can try SSH’ing into each IP that turns up. I use PUTTY if on a windows box to do SSH.
  3. Once logged in, then do “sudo apt-get update”
  4. Then do “sudo apt-get install nfs-common”
  5. Edit your fstab file, i.e. “sudo vi /etc/fstab”
  6. You’ll want to add your file server, usually something like “192.168.2.100:/movies                /movies         nfs     defaults        0       0”
  7. Make sure you mkdir your mount point (/movies in this example) on the xbmc host, then do “sudo mount -a” and your xbmc host should mount the movies
  8. In XBMC, go to Video and add “root file system” to point to your new mount point!
  9. Enjoy!

 

Categories
Cellphone

HTC Incredible 2 Tips

I was using the Android Motorola X for over a year when the GPS function stopped working… not sure if it was because I dropped the phone or something, but when the big Black Friday shopping day came around I decided to switch to the Incredible 2 from HTC. I had used the Incredible 1 in the past and liked it, I switch to the X for the bigger screen and HDMI output.

But after a while, I missed the small form factor of the Incredible! So now I am back it it and really do like the little things HTC adds to its version of Android. Here are a few tips I can offer after taking the time to bring this new phone up to speed.

  • Install Amazon app store. I like this store, and it does a great job of keeping your apps and making them easy to re-install when you switch phones.
  • Ignore the Skype that comes w/ the phone. You can’t (easily) uninstall it, but just go to the Android marketplace and install the official Skype (NOT the one from Verizon) then you can do web calls w/ the front facing camera
  • If you use Swype (and if you don’t, you should try it), the Incredible 2 does not come with it installed. You need to visit swype.com and download the “beta” which is really better than a beta at this point.
  • Install Vlingo for voice recognition functions like calling, asking questions, etc. It’s Android’s “Siri”.
Categories
Unix

Upgrading to Fedora 15 (Lovelock)

After playing damn whack-a-mole with the annoying “want to upgrade?” popup that my Fedora 13 install was throwing at me on a daily basis for months, I finally am upgrading to Fedora 15. I decided to jump right to 15 instead of 14, because why go halfway? And, who wouldn’t jump at installing a release with such a catchy code name.

If you review the past code names for Fedora, you get the idea that the people making them went from being alcoholics, to Twilight fans, to gassy historians, to Nasa enthusiasts, to Bachelor-Pad viewers who like the letter “L”.

But I digress.

Outside of some sys admin changes that can throw you for a loop if you are used to core things not changing, the system feels the same which is nice. One GREAT thing is that I didn’t have to adjust anything for my 3 screens/monitors configuration to still work!

One oddity is that Thunderbird 6 (I had thunderbird 3 previously) seems to run slow, so I am investigating plugins/settings to see what can be done.

Categories
Unix

Webmin PCI Compliance

PCI compliance! Just the phrase is enough to ruin one’s day. But fear not, here is some handy info on what I’ve learned.

For Webmin, you should:

  1. Go to Webmin -> Webmin Configuration -> SSL Encryption
  2. Enter this into Allowed SSL Ciphers field: “ALL:!ADH:!LOW:!MEDIUM:!SSLv2:!EXP:+HIGH”
  3. Set SSL protocol version to “3”

You can check from the command line to make sure SSL-2 is not allowed via:

openssl s_client -connect localhost:10000 -ssl2

and you should get a line that has “error” in it to verify.

Categories
Hardware

Cisco851 Router Working With Comcast

I got a Comcast connection the other day so now my house is dual-homed to the Internet! I have DSL with 5 static IPs (which is why I am keeping it), and now a lickity quick Comcast connection.

I did have problems getting the NATing properly working on the Cisco851 however. The first attempt had the Cisco getting the Comcast IP assigned properly w/ DHCP, and the router could ping out just fine. But, no computers behind it using NAT could get out. After much trial-and-error and dozens of google results, I got the following config that worked. I haven’t fully cleaned it up yet and fleshed out the access lists completely, but the important stuff is there 🙂

Another point to add, is that I had heard things about the MAC address getting tied to the first computer you plug in. When I was troubleshooting, I called Comcast and talked to a tech about this, and it is NOT a worry when you are plugging a router in. They claim they only use the MAC with Comcast equipment. I will say that I had first plugged a laptop in to test the line, and then I switched to the cisco without reseting the box, so my experience seemed to prove the tech’s statement.

Click here for the cisco config

Categories
Cellphone

Android Version 2.3.3 Sucks Battery?

I just updated my Android X to version 2.3.3 a few days ago, and now it seems my battery doesn’t last as long!

I haven’t changed any settings, I only keep the bluetooth on (no wi-fi or gps) and whereas my battery would usually last around 14+ hours with normal usage, this new version seems to die in around 8 hours.

UPDATE: I had a reason to flush my android and start from scratch, and this seemed to clear up the battery problem! Why? Who knows! Logic would indicate some app was causing a problem, but I am careful on apps and when I reinstalled everything the battery life was still good.