This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf "System Info for CBM Servers\n\n" >> ~/SystemInformation.txt | |
printf "\nProduction\n\n" >> ~/SystemInformation.txt | |
printf "\nOS Release:\n" >> ~/SystemInformation.txt | |
cat /etc/release >> SystemInformation.txt | |
printf "\nHostname:\n" >> ~/SystemInformation.txt | |
hostname >> SystemInformation.txt | |
printf "\nIP Address:\n" >> ~/SystemInformation.txt | |
/usr/sbin/ifconfig -a | awk 'BEGIN { count=0; } { if ( $1 ~ /inet/ ) { count++; if( count==2 ) { print $2; } } }' >> SystemInformation.txt | |
printf "\n\nRAM Info\n" >> ~/SystemInformation.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rename 's/\.added$//' *.added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git tag new old | |
git tag -d old | |
git push origin :refs/tags/old | |
git push --tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $variable =~ s/ /_/ig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $variable =~ s/z//ig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modes | |
/i makes the regex match case insensitive. | |
/s enables "single-line mode". In this mode, the dot matches newlines. | |
/m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string. | |
/x enables "free-spacing mode". In this mode, whitespace between regex tokens is ignored, and an unescaped # starts a comment. | |
Regular expressions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sentence = "the boy is 20"; | |
if($sentence =~ /the/) | |
{ | |
print "true"; | |
} | |
if($sentence =~ /Trhe/) | |
{ | |
print "true"; #will return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# if the string ends in z regardless of case the below returns true | |
my $string = '"abcdefz"'; | |
my $string2 = "abcefj"; | |
my $last; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use warnings; | |
#To view This Program's Documentation execute `perldoc programname.pl` | |
=head2 utilityName.pl | |
AUTHOR: Joe Developer | |
CREATION DATE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
package moduleName; | |
use strict; | |
use warnings; | |
#To view This Module's Documentation execute `perldoc modulename.pl` | |
=head2 module.pm | |
AUTHOR: Joe Developer |