© 2023 PodTECH IO
All rights reserved.

Get in Touch

Perl UNIX

CPAN – Perl Command Line

CPAN – Perl Command Line There are several ways to get Perl modules from CPAN installed on your unix-based system. Keep in mind that there is always more than one way to do it with Perl, and this is no different. Before embarking upon any installation, it’s a good idea to download the module, unzip […]

Apache UNIX

Install Google Mod Speed on Ubuntu / Debian

Install Google Mod Speed on Ubuntu / Debian mod_pagespeed is an open-source Apache module that automatically optimizes web pages and resources on them. It does this by rewriting the resources using filters that implement web performance best practices. Webmasters and web developers can use mod_pagespeed to improve the performance of their web pages when serving […]

Mac OSX UNIX

Search String in Directory – UNIX

Search String in Directory – UNIX How to search for a string in a selection of files (-exec grep …). [bash] find . -exec grep “searchstring” ‘{}’ \; -print [/bash] [bash] find . -exec grep “searchstring” ‘{}’ \; -ls [/bash] This command will search in the current directory and all sub directories. All files that […]

Perl UNIX

Date/Time in a Timestamp format – Perl

Date/Time in a Timestamp format – Perl [perl] use Date::Manip; #### – Get DATE / TIME in correct format – ########## my $day= strftime “%d”, localtime; my $month= strftime “%m”, localtime; my $year = strftime “%Y”, localtime; my $now = localtime(time()); #################################################### $form_date_start = “$year/$month/$day 06:00:00”; [/perl]

UNIX

RedHat vs Ubuntu – Useful Package Commands

RedHat vs Ubuntu – Useful Package Commands Task Red Hat/Fedora Ubuntu Refresh list of available packages Yum refreshes each time it’s used apt-get update Install a package from a repository yum install package_name apt-get install package_name Install a package file yum install package.rpm rpm -i package.rpm dpkg –install package.deb Remove a package rpm -e package_name […]

Perl UNIX

Add a timestamp to every STDOUT line

Add a timestamp to every STDOUT line I found this useful for debugging and just handy to have in the toolbox. Alias within your profile! Use: ./anyscript_you_choose | ./addtime [perl] #!/bin/perl -w # filename: ./addtime my($old)=select(STDOUT); $|=1; select(STDIN); $|=1; select ($old); while(<>) { my($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst)= localtime (time); printf “%02d:%02d:%4d %02d:%02d:%02d %s”,$mday,$mon+1,$year+1900,$hour,$min,$sec,$_; } [/perl]

Perl UNIX

Perl – Get the md5 hash for a file

Perl – Get the md5 hash for a file Get the MD5 hash for a file on the command line, using Digest::MD5 usage: ./md5sum.pl [filename] [-f] -f do not display filename [perl] use warnings; use strict; use Digest::MD5; sub md5sum { my $file = shift; my $digest = “”; eval{ open(FILE, $file) or die “Can’t […]

UNIX

Copying a filesystem with Veritas

Copying a filesystem with Veritas This procedure is to create an exact copy of a Veritas filesystem. You will need enough spare disks in your volume group, and ideally anything using the filesystem should be killed. create a mirror # vxassist -g tier3dg mirror tier3fs # vxprint tier3fs Disk group: tier3dg TY NAME ASSOC KSTATE […]

UNIX

VxVM – Volume Management

Volume Management Add a volume (Normal UFS mounted filesystem) # # vxassist -g datadg maxsize # # iostat -En > /tmp/iostat_en_<date> # # devfsadm # # iostat -En > /tmp/iostat_en_<date>.NEW # # luxadm probe # If no disk appears add disk manually ## # vxdmpadm listctlr all ## # cfgadm -c configure c2 ## # […]