I hate it when I download a source archive, uncompress it, and find that instead of creating a package directory, with the contents of the archive, the archive was created with a bunch of files at the root directory. Suppose I have a downloads directory with lots of archives. After I uncompress this new archive, I now have a bunch of archive files and a bunch of project specific files all in the same directory. Yuck.
> cd downloads
> tar -xzf latestdownload.tar.gz
> # yuck, stupid package contents in my downloads directory.
Yeah, Yeah, I know I could have listed the package contents (tar -tzf ..) and found that I needed to create a directory first but I’m lazy. So the mess is there. Now to clean it up:
> tar -tzf latestdownload.tar.gz | xargs rm -rf
There. Files gone. You can do the same thing with unzip -t for zip archives.
I’ve always known that virtualizing things can make management of all types of resources easier. Recently, I had the most pleasant experience adding disk space to a virtual machine. Of course, if you use LVM, this can happen just as easily with real physical disks, but for me, I was able to do this without restarting my machine.
Issue: I’m out of disk space on my root partition.
Solution: The root partition is created on a logical volume with LVM2. Just add another disk, extend the volume group, and then extend the logical volume.
# Added new physical partition /dev/sda3
# create a physical volume out of it
> pvcreate /dev/sda3
# Now, add it to the volume group that my logical volume is on
> vgextend VolGroup00 /dev/sda3
# Now that the volume group has more disk space, the logical volume can grow
> lvextend -L+11G /dev/VolGroup00/LogVol00
# Ok, last of all, I want to filesystem to recognize that more space is available
> fsadm resize /dev/VolGroup00/LogVol00
# sweet, I have more space now
> df -h
All that was done without having to take the system off line. Linux makes life easy sometimes doesn’t it!
I’d wager many of you know this already. Having done this a couple times the last two days though, I thought I’d add it for those that don’t. Maybe it’s useful to someone.
Problem: You want to log into a remote server with SSH and you don’t want to type a password. You know about key pairs and authorized_keys and are ready to copy your public key. You might be tempted to do it like this:
- SCP your identity to the remote machine (have to type your password again).
- ssh to the remote server (have to type your password again)
- append the public id to the authorized keys file
- delete the copied file
- try the keyless login
Here is where you can save a few steps. You can append the file with ssh instead of copying the file over with scp. This saves you a login and typing your password once.
cat id_dsa.pub | ssh remote_server "cat >> [path to user home]/.ssh/authorized_keys"
There. Type your password once for the copy and then test the passwordless login.
I’m a Linux advocate myself. My servers run Linux. I use Linux primarily for my work. At home, I either use Linux or my iMac. While I can get all the services I’m happy with, I have to realize that some people like services that are harder to find and host with Linux. I’ve come across my second situation recently where someone wanted a hosted exchange server. Some might advocate attempting a non-Microsoft work alike for this but I find there comes a point when it’s more work than it’s worth. This is especially true when you can set up a service like Sharepoint hosting for as little as $8.95 per month.
SherWeb provides a complete package with their Microsoft Sharepoint hosting. In addition to email, you can set up calendars, contact lists, tasks, alerts, rss feeds and a few other things. The rss feeds, for instance, can be connected to any of the Sharepoint features. You can create an rss feed for a contact list or calendar, and then allow certain users access to that rss feed. There is also a way to work on office documents with the document workspace hosted and shared. Another exciting feature for many business users, is the option to connect to, modify, and and new content with a mobile device.
All of these features are sharable with an unlimited number of users. You can add unlimited users to your system no matter which data plan you choose. Furthermore, all the features of Sharepoint are included with every data plan. The more expensive plans simply allow you more disk space. You can relatively cheaply try out all the benefits and then spend more as you grow.
I just updated all my blogs to WordPress 2.7. I like the new admin interface. The upgrade was pleasantly easy and quick.
For a couple years now, I’ve been learning and applying various tricks for developing and hosting multiple Python web sites on my development machines. During that time, I made a migration to Mac OS X. Most setup files for python applications and libraries work out of the box on the Linux distributions I’ve tried. For OS X, you can find a lot of prebuilt packages for the necessary dependencies but those packages want to be installed in the OS X system library location for Python.
If you want to host or develop more than one site with Python, you’ll need to use virtual environments. This applies equally to any OS, not just Mac OS X. There seem to be a few more tricks to getting things up and running on OS X however. Here is the process I went through to get TurboGears applications hosted in virtual environments on OS X.
Continue reading “Virtual Hosting TurboGears Applications on Mac OS X Leopard”