Author Archives: Brian - Page 4

Arch Linux

I decided that I would like to try a Linux distro that was less “do it all for you.” After consulting with the people I consult with on things like that, I decided to try out Arch Linux. So far I am pretty impressed. It is definitely a DIY distribution, but they have documentation to help you through just about everything.

I am running it on an Acer 5672 laptop. I will post here with possible problems I find and any solutions…

  • Special keys (Play/Pause, Stop, Volume, Mute, etc)
  • Card Reader
    • Run the following command: sudo setpci -s 09.0 4c=0x22
  • Webcam
    • Add gspca_vc032x to your modules list in /etc/rc.conf. You can also just modprobe it to test. If compiz is enabled, the picture will flicker unless you modify  your xorg.conf.
    • Section "Device"
      ........
      Option "VideoOverlay" "off"
      Option "OpenGLOverlay" "on"
      Option "TexturedVideo" "off"
      .........
      EndSection
  • No Automounting in Gnome
    • Make sure your /etc/fstab file does not contain entries for the cd/dvd drives. Removing those had it working immediately for me

PHP Script for Deleting Orphaned Images

The title for this sucks. But that is because it isn’t easy to concisely describe (in a title fashion) what the script does. Imagine you have a lot of pictures from a photo shoot in both tif and jpg formats. You pick out the jpgs you want to keep and delete the rest. You still have all the tifs and want to delete the ones without a corresponding jpg. This script will do that. It takes three arguments: directory to delete from, directory to base that on, and an optional backup directory to move instead of deleting.

If you want it to handle different extensions, edit the code where it says jpg and tif

#!/usr/bin/php

< ?php

$deleteFromDir = rtrim($argv[1], '/');
$basedOnDir = rtrim($argv[2], '/');
$backupDir = rtrim($argv[3], '/');

if(!empty($backupDir) && !file_exists($backupDir)){
	if(!mkdir($backupDir)){
		dir("Unable to create backup directory. Quitting\n");
	}
}

$dh = opendir($deleteFromDir);
if($dh){
	while(false !== ($file = readdir($dh))){
		if($file[0] != '.' && !empty($file)){
			$info = pathinfo($deleteFromDir . '/' . $file);
			if($info['extension'] == 'tif' && !file_exists($basedOnDir . '/'. $info['filename'] . '.jpg')){
				echo $file . "\n";
				if(!empty($backupDir)){
					rename($deleteFromDir . '/' . $file, $backupDir . '/' . $file);
				}else{
					unlink($deleteFromDir . '/' . $file);
				}
			}
		}
	}
}else{
	echo "Unable to open $dir\n";
}

Ubuntu + Google Calendar

This is finally working for me in Intrepid Ibex (8.10). I am able to sync my desktop calendar with the google calendar without noticing that Evolution is involved. My primary goal was to get calendar events to show up in the clock/calendar dropdown in the top right corner (by default). To do this is actually pretty simple. In the settings for your Google calendar, copy the private ics link. Paste the link into the address bar and change the http(s) to webcal. Hit enter and it should prompt you to open it using evolution-webcal. Let it do that, answer the questions it asks and all should be good in the world.

Slicehost

I have finally upgraded to my own VPS. Dreamhost was a great host, but I prefer being able to setup and break everything all by myself. Also, having dedicated resources makes things like photo galleries work much better. As such, 3dgo.net and all of its related sites are now running on a 256 slice from Slicehost. I’m running Ubuntu Hardy with Lighttpd as the web server.

When I was setting up the server I initially used Apache as it is what I am most familiar with and it is pretty easy to get up and running. But when I was trying to use my site, I realized that Apache is far too heavy with its memory usage. Even caching various things there was still not enough memory available for any kind of load. I had used Lighttpd once at work for a Rails app and had heard that it was significantly lighter than Apache. As such, I decided to try getting it up and working. That was easier said than done…

Problem: PHP wouldn’t work
Solution: Install php5-cgi and then activate the fcgi module (not the other way around)

Problem: Multiple virtual hosts by hostname?
Solution: http://www.debianhelp.co.uk/virtualhostslighttpd.htm

Problem: No .htaccess support (for mod_rewrite, mod_deflate)
Solution: No ideal solution for this one really, but you can setup mod_rewrite/mod_deflate rules in the config for each vhost. I prefer the .htaccess method, but this works for now. For most popular apps you should be able to find lighttpd rules to replace the .htaccess rewrite rules.

On the off-chance, you want to signup for Slicehost and wouldn’t mind using me as a referral, here is my affiliate link: https://manage.slicehost.com/customers/new?referrer=de41b271f1865e85d87b32e6996d4ee9

Google Chrome

Everyone else is talking about it, so why shouldn’t I? Actually, that’s a terrible reason to talk about it, but I will anyways.

As just about everyone who does anything with computers knows, Google has released a beta of their very own browser called Google Chrome. Currently the beta is only available for Windows, but they claim to be working on Linux and Mac versions as well. I sincerely hope this is the case as after using it for a while on both my work and home Windows computers, it seems to have great potential. Currently it has two major things going for it:

  1. It separates tabs into different processes. Thus, if one tab is being stupid, it doesn’t destroy the whole browser.
  2. It is fast. Not just any kind of fast though. Ridiculously fast. If you have the bandwidth to handle it, you will notice a huge increase in page render times.

There are other interesting things about it, but those two are the most pertinent for regular users.