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
use IPC::Cmd qw/can_run run/; | |
our $OPENSSL = can_run('openssl') or die 'openssl is not installed!'; | |
my $ok = run( | |
verbose => 0, | |
command => [ | |
"openssl", "enc", | |
"-e", "-aes256", | |
"-in", $input, |
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
opendir DH, $dir or die "Error: can't open $dir : $!"; | |
while (my $file = readdir DH) { | |
next if $file =~ /^\.{1,2}$/; | |
print $file, "\n"; | |
} | |
closedir DH; |
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
use File::Find; | |
my $dir = '/home/takus'; | |
find(\&print_file, $dir); | |
sub print_file { | |
print $File::Find::name, "\n"; | |
} |
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 perl | |
my $base_dir = shift; | |
my $ref_files = &get_file_paths($base_dir); | |
for (@$ref_files) { | |
print "$_\n"; | |
} |
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 perl | |
use strict; | |
use warnings; | |
use File::Temp; | |
use File::Copy; | |
my $origin_file = shift; |
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/sh | |
# hook script of rm | |
# | |
# Setup | |
# alias rm="foo/bar/rm-with-trash.sh" | |
trash=$HOME/.trash | |
if [ ! -d $trash ] |
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/sh | |
find . -name '*.pdf' | xargs -i cp {} /tmp |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="make_exec_jar" default="jar" basedir="." > | |
<target name="jar"> | |
<jar basedir="../classes" jarfile="hello.jar"> | |
<manifest> | |
<attribute name="Main-Class" value="me.takus.sample.Hello"/> | |
</manifest> | |
</jar> | |
</target> | |
</project> |
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
ssh -t user@host "cd /path/to/dir && /bin/bash" |
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
plot "output" | |
pause 0.1 | |
reread | |
watch |
OlderNewer