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 | |
# fb - file backup with timestamp and sequensal numbers | |
# usage : $0 filename [filename [...]] | |
today=`date '+%Y%m%d'` | |
for fn in $* | |
do | |
seq='' |
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; | |
my (%s) ; | |
$s{ "999999999999" } = ''; | |
while (<>){ | |
if( /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/ ){ |
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
$ ping x.x.x.x | ruby -rdate -pe 'BEGIN{$stdout.sync=true; trap(:INT){exit}}; print DateTime.now.strftime("\[%T\] ")' |
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
$ ping x.x.x.x | perl -MPOSIX -pe 'BEGIN{ $|=1 } s/^/strftime "\[%T\] ", localtime(time)/e' |
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
$ ping x.x.x.x | sed -le 's/^/] /' | while read x; do echo "`date '+[%T'`$x"; done |
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 | |
MYSQL_USER=root # mysql user | |
MYSQL_PWD=******** # mysql password | |
INTERVAL=1 # update interval (sec.) | |
export MYSQL_PWD | |
dbname=test_db | |
table=test_table |
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 python | |
# -*- coding: utf-8 -*- | |
# send-mail.py - mail send script with SMTP over SSL and SMTP-AUTH | |
# usage: $0 [-n <sender name>] [-f <sender address>] <recipient address> <subject> | |
#----#----#----#----#----#----#----#----#----#----#----#----#----#----#----# | |
# 送信サーバ設定 | |
mailserver = 'mailserver.example.com:25' | |
auth_user = 'username' | |
auth_pass = 'password' |
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 ruby | |
require "net/http" | |
query_url = 'http://standards.ieee.org/cgi-bin/ouisearch' | |
irregular = { | |
"080027" => "VirtualBox Guest", | |
"525400" => "QEMU/KVM Guest", | |
} |
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 ruby | |
# -*- coding: utf-8 -*- | |
# oui.txtの入手方法: | |
# curl -O http://standards.ieee.org/develop/regauth/oui/oui.txt | |
# OUIデータベースの読み込み | |
def oui_store filename,o | |
# ファイルから読み込む |
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
: | |
pathmunge () { | |
case ":${PATH}:" in | |
*:"$1":*) | |
;; | |
*) | |
if [ "$2" = "after" ] ; then | |
PATH=$PATH:$1 | |
else |
OlderNewer