sudo aptitude install debootstrap coreutils util-linux e2fsprogs
df -h
#!/usr/bin/env perl | |
use utf8; use strict; use warnings; | |
use Getopt::Std 'getopt'; | |
use HTTP::Tiny; use JSON::PP; | |
use IO::Uncompress::Gunzip 'gunzip'; | |
use Socket qw'AF_UNIX SOCK_STREAM PF_UNSPEC'; | |
use List::Util qw'min max'; | |
use Encode::Locale; | |
use POSIX qw'setsid sigaction SIGHUP SA_SIGINFO'; | |
use POSIX::SigAction; |
sub rounded_mask { | |
my ($img, $rad) = @_; | |
state $ss = 4; # subsample smooth | |
my $srad = int $rad*$ss; | |
my $corner = Imager->new(xsize => $srad, ysize => $srad, channels => 1) | |
->arc(qw'x 0 y 0 d1 0 d2 90', r => $srad - $ss/2) | |
->scale(scalefactor => 1/$ss); | |
my ($w, $h) = ($img->getwidth, $img->getheight); | |
my $mask = Imager->new(xsize => $w, ysize => $h, channels => 1); | |
$mask->box(box => [$rad, 0, $w - 1 - $rad, $h - 1], filled => 1); |
use strict; use warnings; | |
use File::Temp qw'tempfile tempdir'; use File::Spec::Functions 'catfile'; | |
use Symbol 'geniosym'; use Socket; use Net::EmptyPort 'empty_port'; use Getopt::Std; | |
my %in = (qw'h 127.0.0.1 p 5498 n 4'); getopts('p:n:', \%in); | |
print "torium[$$] listens $in{p}\n"; | |
my @children; |
use strict; use warnings; | |
use Gtk3 -init; | |
my $dialog = Gtk3::FileChooserDialog->new( | |
'Select files..', Gtk3::Window->new('toplevel'), | |
qw'open OK ok'); | |
$dialog->set_select_multiple(Gtk3::true); | |
$dialog->signal_connect( response => sub { |
(desktop-save-mode) | |
(add-to-list 'desktop-globals-to-save 'custom-enabled-themes) | |
(defun desktop-load-theme () "load custom theme" (interactive) | |
(dolist (th custom-enabled-themes) (load-theme th))) | |
(add-hook 'desktop-after-read-hook 'desktop-load-theme) |
use utf8; use strict; use warnings; use feature qw'say state'; | |
use URI; use HTTP::Tiny; | |
use IO::Uncompress::Gunzip 'gunzip'; | |
say fetch('http://some-site'); | |
sub fetch { | |
my $response = (state $ua = HTTP::Tiny->new(default_headers => {qw'Accept-Encoding gzip'}))->get(URI->new($_[0])); | |
say join '', ($response->{success} ? 'ok' : 'fail'), ': ', $_[0]; | |
$response->{success} && length $response->{content} |
use strict; use warnings; | |
use feature qw'say state'; | |
use File::Basename 'basename'; | |
use Spreadsheet::XLSX; | |
use DBI; | |
use IO::Prompt::Tiny 'prompt'; | |
use Getopt::Std 'getopt'; | |
getopt(my $arg = 'hPupfd', my $opts = {qw(h localhost u root)}); # host user pass file ?db_name | |
my ($host, $port, $user, $pass, $file, $db_name) = @$opts{split'',$arg}; |
cpanm U Plack | |
# later | |
plackup -MU -MPlack::Builder -e 'builder { enable "Auth::Basic", authenticator => sub {$_[0].$_[1] eq 'a0b0'}; Plack::App::Directory->new->to_app }' |