Easily installing Perl modules with Yum

Although many Perl modules are available through Red Hat and CentOS’s repositories, the name the modules have in the repository differ from the name of the module itself.

To use yum to install a Perl module using the module name, just place ‘”perl()”‘ around the name of the module (double quotes included) when giving it as an argument to yum. For example, to install the ‘Net::Telnet’ module, you would run ‘yum install “perl(Net::Telnet)”‘.

Alternatively, to construct the correct package name, you would prepend the module’s name with ‘perl-’, and change all of the instances of ‘::’ to ‘-’. For example, the package for the ‘Net::Telnet’ module would be ‘perl-Net-Telnet’.

Finding space hogs

I know this is a common post out there, as a google search will bring this up multiple times, but here it is anyway. A great alias to set up on your system to aid in finding space hogs in a given filesystem or directory is as follows:

alias ducks=’du -cks * |sort -rn |head -11′

Add the aliases to whichever file you keep them in (.bashrc, .aliases, etc)  and then run ‘ducks’ for output similar to this: Continue reading “Finding space hogs”

OpenSSH SOCKS proxy support

Often, when you’re administering or developing on servers remotely, you may need to access resources that are not available to the public. There are several different ways that you can gain access to protected services from a remote location, including a VPN, port forwarding over SSH, and stunnel.

However, one method that is not as well known is OpenSSH’s SOCKS proxy option. Introduced in OpenSSH 3.7, SOCKS support allows you to easily tunnel traffic from any application that has support for a SOCKS4 or SOCKS5 proxy through your SSH connection. To do this, you simply need to add ‘-D <port>’ to your ssh connection string, where <port> is the port you would like your proxy to run on. Then, configure your application to use a proxy at localhost:<port>, and all of the traffic from that application will be tunneled through your SSH connection.

In addition to accessing protected resources, you can also use this for more everyday tasks – such as encrypting traffic sent over a public wireless connection.

Mysql table opens, caching and iowait times

One issue that seems to be very common when running a MySQL server is high iowait. As we have delved into our servers, one of the main causes we have found is that our table_cache was set too low, causing an ever increasing number of table opens

One issue that seems to be very common when running a MySQL server is high iowait. As we have delved into our servers, one of the main causes we have found is that our table_cache was set too low, causing an ever increasing number of table opens. As we increased the table_cache, and watched for higher hit percentages, we were stumped regarding how many table opens in a given time period were acceptable. A number which I use as a guideline was given to me during a MySQL training course this year. We use a guideline of no more than 10 table opens per hour. More than that- and we need to increase table_cache.

Human readable disk usage

Finding out what directories and files are using up the disk space on your server is fairly easy with du, but the output is not always easy to read.

However, it’s not too hard to pretty up the output with some perl and the module Number::Bytes::Human (available from CPAN). To convert normal du output into a more human readable form, which shows file size in the correct units (K, M, or G) and also includes the percentage of the total space each entry is using, use the follwing steps.

Finding out what directories and files are using up the disk space on your server is fairly easy with du, but the output is not always easy to read.

However, it’s not too hard to pretty up the output with some perl and the module Number::Bytes::Human (available from CPAN). To convert normal du output into a more human readable form, which shows file size in the correct units (K, M, or G) and also includes the percentage of the total space each entry is using, use the follwing steps. Continue reading “Human readable disk usage”

Building a kernel RPM from source

While it is reasonably easy to build a kernel RPM on a Redhat or CentOS system using the kernel src rpm, another way is to do a standard kernel build (download your kernel from kernel.org), configure as usual. However, instead of just doing a standard “make” or “make bzImage”, do “make rpm“, and voila! You’ll be left with your kernel rpm in /usr/src/redhat/RPMS/{arch}, and your very own src rpm in /usr/src/redhat/SRPMS. Easy, right?

TNR Global and Hidden-Tech Present: Developing a Dynamic Web Site for Your Business – Joomla!

Date: January 29, 2008, 5:30 p.m. — 7:30 p.m
Location: Lord Jeffrey Inn, Amherst, MA

Hidden-Tech members are invited to an evening seminar to explore the Joomla! content management system. Learn how you can use open source tools to create an interactive website for your business or organization. The Joomla! web content management system allows non-programmers to create dynamic websites with forums, blogs, newsletters, calendars, polls, ad banners, user registration, directories, and more.

Who can benefit?
If your organization—
a. has a lot of content
b. needs an interactive site
c. wants to update web content easily
— then consider Joomla!

University of Massachusetts – Mind the Gap Women & Technology Summit

Natasha Goncharova, Managing Director of TNR Global, LLC, will be a panel participant at the Technology Trends in Industry session at the University of Massachusetts’s “Mind the Gap” Women & Technology Summit, on September 27, 2007. The event, organized by the Commonwealth Alliance for IT Education (CAITE), provides a venue for women to explore career options in technology fields.