Arrow

All the miscellaneous crap that I've spent so much time looking for on the Internet... perhaps I should share it all and help other people find such things easier!

Installing the Subversion client on a CentOS WHM / cPanel VPS Share on Facebook

July 3rd, 2010

If you’re semi-familiar with CentOS (a type of Linux operating system), you probably know about the package installer yum. When it’s working great, it not only installs and updates packages but also takes care of dependencies.

Installing a Subversion (SVN) client on a CentOS server should be as simple as running the command “yum install subversion”. Unfortunately, I recently ran into a problem on a VPS (Virtual Private Server) hosting account where that simple yum command yielded the error:

Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

A few of the typical troubleshooting steps might be to try to run “yum install perl-uri” (which might tell you that “perl-uri” is not available), or to run the command “yum clean all” (hoping to clear some outdated cache), or to start fiddling with the repositories and their settings in /etc/yum.repos.d (hoping that the machine was configured incorrectly). You might also consider just manually downloading and installing perl-uri. In my case, however, the simple problem was that yum was being prevented from doing anything with perl-related packages. The top of the main yum configuration file at /etc/yum.conf was:

[main]
exclude=apache* bind-chroot courier* dovecot* exim* httpd* mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail*

Presumably, this is a security measure to prevent people from messing with key applications. If you know what you’re doing and you just want to install the Subversion client, temporarily remove perl* from the exclude list!

Acer laptop: Vista or Windows 7 screen brightness resets upon every boot Share on Facebook

July 3rd, 2010

I recently dealt with a problem on an Acer laptop running Windows Vista, whereby every time the notebook was restarted, the screen was very dark. The user had to manually increase the brightness level every time (Windows button aka Start Menu button + arrow keys; or Function key + one of the F1-F12 keys; or even Windows button + x to bring up the Windows Mobility Center). Since adjusting the brightness still worked, this seemed to indicate that there was nothing physically wrong with the machine. But Windows was somehow storing a default brightness setting and always reverting back to it. On-the-fly adjustment of brightness was only temporary.

As it turns out, the default brightness setting was stored in Power Options, which enable you to define a different set of computer options to balance energy efficiency and performance. Of course, screen brightness is a big component of this. To get at these options, click the battery icon in the status bar, then click either “Adjust screen brightness” or “More power options”.

Power Options menu in the status bar

This should bring up a listing of power plans, on which you can click “Change plan settings”. From there, you can adjust the default brightness.

Adjusting the brightness for one of the power plans

In the particular case that I was looking at, the brightness slider was all the way to the left. We have no idea how that brightness setting had been turned down to nothing in the first place, but restoring a more reasonable base setting fixed the issue upon subsequent reboots.

This is not limited to Acer computers. If you’re using an HP, Sony, Toshiba, Dell, Asus… basically any computer running Windows, you’ll find similar power options, although such computers might have their own power utility that override the default Windows power options.

Recycle old running shoes at any Nike Store Share on Facebook

June 19th, 2010

If you outgrow or tire of your runners, tennis shoes, basketball shoes, cross trainers and so on, first consider donating them to be redistributed to someone else. However, if you’re the type of person who wears your shoes until they get holes and they start to fall apart, it’s still not time to throw them out — take them to a Nike Store for recycling!

First, check Nike’s Reuse-A-Shoe website to find the nearest Nike Store drop-off location. Nike will turn your worn-out shoes into something they call Nike Grind. Nike Grind is used to help build sports facility playing surfaces, such as tracks, tennis courts, and basketball courts. In some cases it is even used as part of the material for new shoes.

The shoes that get recycled / re-used do not need to be Nike branded. Reebok, Adidas, Fila, Saucony and more are all fair game! Non-athletic shoes are not accepted, though. For example, the Reuse-A-Shoe website mentions that they will not take “sandals, flip-flops, dress shoes, boots and other types of shoes”. Be sure to leave a comment if you know of a use for the other types of shoes!

Creating symbolic links in Windows Vista and Windows 7 Share on Facebook

June 17th, 2010

A symbolic link (or “symlink”) is quite useful to have a file system treat a file or folder like it is in a specific location, when the file or folder actually resides elsewhere. Some of my recent uses for symbolic links include having Dropbox sync files outside of its parent directory; and having programs and websites use files checked out via SVN elsewhere. Symbolic links can come in handy in some lesser technical situations as well, as a tool to keep your digital files organized.

In Windows XP and lower, if you wanted to create something similar to a Unix symbolic link (the “ln -s” command) you would have to look into things like junction points, which were poorly documented and required some mysterious plugins or add-ons.

In Windows Vista and higher, you can use the “mklink” function on the command line. Its basic syntax is: “mklink newlinkname target”, and one of the parameter options is “/D” if you’re creating a directory symbolic link. For example, I was working on a website at c:\www\site which needed to have a folder that sat at c:\www\shared\extension; “extension” needed to stay in its original location. On the command line under the “site” folder, I used “mklink /D extension ..\shared\extension”. In the image below, you can see the contents of c:\www\site; the symbolic links have the same icons as shortcuts do. However, instead of normal Windows shortcut, browsing “extension” would open that folder as if all of its contents were actually at c:\www\site\extension.

Symbolic link in Windows

This way, when I browse c:\www\site\extension, it’s as if the “extension” folder was actually there. If any edits (including deletions) are made within that folder, it is reflected in its original location and also its symbolic location.

“mklink” is well-explained a bit more here and here.

Google Docs Viewer review: Embed a PDF or PowerPoint file in your website without Flash Share on Facebook

May 23rd, 2010

In Google search results, you might have noticed that PDF results can be viewed in “Quick View”, showing you an in-browser representation of the file without having to open an external program or browser plugin. You can use this same viewer to display files inline in your website.

Google Docs Viewer is free and easy to use. It officially supports .pdf, .ppt, and .tiff / .tif files. I’ve also had success using it with some (but not all) Microsoft Word (.doc) files.

From a technical standpoint, Google Docs Viewer seems to convert pages to images for viewing, and then has quite a bit of supporting JavaScript for viewing controls. The one requirement is that you have a public URL for that file.

To quickly view any file in your browser, simply open a URL such as this:

http://docs.google.com/viewer?url=http://url_to_your_file

To embed it within a webpage, use code such as:

<iframe src="http://docs.google.com/viewer?url=http://url_to_your_file&embedded=true" width="425" height="560"></iframe>

The “embedded” URL parameter removes some of the full view controls for more compact viewing. You can adjust the width and height as needed and the viewer adjusts quite well.

Here’s an example embedded PDF: