Skip to content

Instantly share code, notes, and snippets.

@opmat
opmat / monitor_mysql.pl
Created November 23, 2023 02:38 — forked from utdrmac/monitor_mysql.pl
Perl Script to Monitor MySQL Replication and Send Email on Failure
#!/usr/bin/perl
use DBI;
use Email::MIME;
use Log::Log4perl qw(get_logger :levels);
use Data::Dumper;
use strict;
# For backgrounding
@bohwaz
bohwaz / dns_get_record_from.php
Last active September 3, 2025 17:34
PHP script to retrieve a DNS record from a custom nameserver
<?php
/**
* Make a DNS a request to a custom nameserver, this is similar to dns_get_record, but allows you to query any nameserver
* Usage: dns_get_record_from('ns.server.tld', 'A', 'mydomain.tld');
* => ['42.42.42.42']
* @author bohwaz
*/
function dns_get_record_from(string $server, string $type, string $record, string $protocol = 'udp'): array
{
@utdrmac
utdrmac / monitor_mysql.pl
Last active April 21, 2024 06:16
Perl Script to Monitor MySQL Replication and Send Email on Failure
#!/usr/bin/perl
use DBI;
use Email::MIME;
use Log::Log4perl qw(get_logger :levels);
use Data::Dumper;
use strict;
# For backgrounding
@afair
afair / gist:2402068
Last active September 21, 2024 21:06
Perl References for Kittens

Perl References

Simple Perl variables are called scalars. Examples of scalar values are

   $number      = 123;
   $string      = "String";
   $file_handle = open "<filename";
   $null_value  = undef;
 $instance = MyClass-&gt;new;