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
#!/bin/bash | |
# install the smartctl package first! (apt-get install smartctl) | |
if sudo true | |
then | |
true | |
else | |
echo 'Root privileges required' |
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/env bash | |
### BEGIN INIT INFO | |
# Provides: vmwareautostart | |
# Required-Start: $vmware $network $syslog | |
# Required-Stop: $vmware $network $syslog | |
# X-Start-Before: | |
# X-Stop-After: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
#!/bin/bash | |
# AUTHOR: Tommy Butler | |
# | |
# DESCRIPTION: | |
# Run this script to offline and delete a disk from your Linux system. | |
# It should work for most people, but if you've got an old kernel it may not. | |
# Unless you know what you're doing, DO NOT USE THIS SCRIPT! | |
# | |
# LICENSE: Perl Artistic License - http://dev.perl.org/licenses/artistic.html |
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 $start = scalar localtime; | |
my @records = ( 'some', 'dbi', 'fetchrow', 'hashrefs' ); | |
$promises->{first}->then | |
( | |
sub | |
{ | |
warn 'DONE WITH FIRST PROMISE'; | |
warn 'START: ' . $start; | |
warn 'FINISH: ' . scalar localtime; |
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
# inside my mojo route... | |
my $result = $library->run_object_method_that_runs_mojo_promise_map(); | |
if ( Scalar::Util::blessed( $result ) && $result->isa( 'Mojo::Promise' ) ) | |
{ | |
$c->render_later(); | |
my $start = scalar localtime; | |
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
return Mojo::Promise->map | |
( | |
{ concurrency => 10 }, | |
sub | |
{ | |
my $record = $_; | |
my $promise = Mojo::Promise->new(); | |
Mojo::IOLoop->subprocess->run | |
( |
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
#!perl | |
use strict; | |
use warnings; | |
use 5.020; | |
my $cap = 10; | |
my @ints = | |
qw( | |
6.1 |
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 $pdf = 'my-html-template-for-conversion-to-pdf'; # needs to be a .html.ep template | |
my $mail = 'my-template-for-the-html-email'; # needs to be a .mail.ep template | |
$pdf = $c->render_to_string( $pdf )->to_string(); | |
$pdf = PDF::WebKit->new( \$pdf, %pdf_opt )->to_pdf(); # see PDF::WebKit documentation for details | |
$c->mail | |
( | |
mail => | |
{ |
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
find . -type f | perl -nE '$_ =~ s/.*\///g ; $_ =~ m/.+\..+$/ && $_ =~ s/.*\./\./ && say $_' | sort | uniq |
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
#!perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
my $last_access = {}; | |
my $tot = 0; | |
my $cnt = 0; |
NewerOlder