Skip to content

Instantly share code, notes, and snippets.

@ywatase
ywatase / replace_node2n.sh
Created July 5, 2019 05:34
source インストールしたnodeをnに入れ替えるスクリプト
#!/bin/bash
prefix=/usr/local
current_version=$(/usr/local/bin/node --version)
which rsync >/dev/null 2>&1 || yum install -y rsync
install_n () {
if ! [ -x $prefix/bin/n ] ; then
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o $prefix/bin/n
chmod a+x $prefix/bin/n
diff -N -u wiki.cgi.old wiki.cgi
--- wiki.cgi.old 2012-11-13 18:47:10.000000000 +0900
+++ wiki.cgi 2018-04-24 00:18:18.000000000 +0900
@@ -83,6 +83,14 @@
}
#==============================================================================
+ # Redirect if URI is escaped twice and pointed page exists.
+ #==============================================================================
+ if (not $wiki->page_exists($cgi->param('page'))
#!/bin/sh
# install & set up daemontools and so on.
#
# Author : Y.Watase
# Date : 2007/01/11
# Last Modified: 2016/03/03.
# Mail : [email protected]
################################################################################
#!/usr/bin/env perl
use strict;
use warnings;
use Path::Tiny;
use XML::LibXML::Simple qw(XMLin);
my $xml = path('sample.xml')->slurp_utf8;
my $dom = eval { XMLin $xml };
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DateTime::Format::HTTP;
use DateTime;
sub t {
use strict;
use utf8;
use Plack::Request;
use Graph::Easy;
# cpanm Graph::Easy::As_svg;
my $body = <<END;
<!DOCTYPE html>
<html>
<body>
#!/usr/bin/env perl
use strict;
use warnings;
use Resque;
use String::CamelCase qw(decamelize);
use Proclet;
my $cmd = shift @ARGV;
my $job = shift @ARGV;
my $worker = shift @ARGV || 1;
This file has been truncated, but you can view the full file.
<cacti>
<hash_04002412c493499dbf92883d5e1b00144fe390>
<name>F5 BigIP - Snat Statistics</name>
<description>Pull per Snat statistics from a F5 BigIP</description>
<xml_path>&lt;path_cacti&gt;/resource/snmp_queries/f5_bigip_snat.xml</xml_path>
<data_input_id>hash_030024bf566c869ac6443b0c75d1c32b5a350e</data_input_id>
<graphs>
<hash_110024efe0a7ff0304073f1f9acde9a30cdb60>
<name>Snat Traffic (bits/sec)</name>
<graph_template_id>hash_000024b5dfb11167905fd2146817249be1a0d5</graph_template_id>
@ywatase
ywatase / .pryrc
Created March 3, 2014 06:08
debugger for rails
# snippet from http://qiita.com/yusabana/items/8ce54577d959bb085b37
## Settings
Pry.config.color = true
Pry.config.editor = "vim"
Pry.config.prompt = proc do |obj, level, _|
prompt = ""
prompt << "#{Rails.version}@" if defined?(Rails)
prompt << "#{RUBY_VERSION}"