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
#!/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 |
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 | |
=pod | |
Fetches slow query logs from slow_log table of Amazon RDS. | |
Things to change in this script for your own setup: | |
<root_user> to your rds root user (e.g. "root") | |
<root_pass> to your rds root password (e.g. "password") | |
<host_domain> to your rds host domain (e.g. "hoge.ap-northeast-1.rds.amazonaws.com") |
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 | |
=pod | |
purge unnecessary logs from MongoDB | |
=cut | |
use strict; | |
use warnings; | |
use MongoDB; |
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
# Max line width is 78 cols | |
-l=78 | |
# Indent level is 4 cols | |
-i=4 | |
# Continuation indent is 4 cols | |
-ci=4 | |
# Output to STDOUT |