2011-02-28

Perl - How to uninstall / delete Perl module

Installing Perl modules can use the cpanm utility, but how about removing Perl modules? App::pmuninstall module is the answer!

Installation :

$ cpanm App::pmuninstall
--> Working on App::pmuninstall
Fetching http://search.cpan.org/CPAN/authors/id/X/XA/XAICRON/App-
pmuninstall-0.16.tar.gz ... OK
Configuring App-pmuninstall-0.16 ... OK
Building and testing App-pmuninstall-0.16 ... OK
Successfully installed App-pmuninstall-0.16

Usage :

2011-02-25

vim - How to stop vim creating "tilde" backup files

Vim, aka the Programmer's Editor, by default creates backup files (ends with a tilde character) whenever editing file. E.g. myfile~, another_file~, yet_another_file~ and etc.

After some time, this generates too many backup laying around the file system. Too messy. This is how to stop vim create these backup files :

2011-02-21

Perl - How to find out what Core Modules installed

Perl comes with a set of core modules. Perl core modules comes with default installation.
E.g. :
- Env
- File::Spec
- File::Basename
- Time::localtime

These are just some of the gems to a system administrator. So, how to find out what core modules are included with your perl installation?




Here's how :

2011-02-18

FreeBSD - How to change screen to use BASH

Purpose :
Make screen, the virtual terminal program, changes the user's default shell from tcsh to BASH when starting.

Command :

2011-02-11

Bash - How to output all (stdout & stderr) into log file in Bash

Purpose :
When scripting Bash scripts, often we'll need to output all stdout & stderr of a particular command into a log file, for logging purposes or diagnostic purposes.






Command :

2011-02-07

FreeBSD - How to check device or CPU performance

Platform :
FreeBSD

Purpose :
Monitoring disk read/write activity.

Command :
iostat


Installation :
The "iostat" command comes with the base installation.

Useful switches :
-w == update frequency, in seconds
-d == only show devices, hdd related
-C == show CPU activity only

Example :

2011-02-04

ssh - How to pipe output from local to remote server

In Bash, with pipe (the "|" symbol) and ssh makes a good combination of server administration tool, securely. Some examples :